From 008a01847ee8d056243a00aeacf9e1c3eeb2504a Mon Sep 17 00:00:00 2001 From: Peng Li Date: Mon, 17 Aug 2015 00:21:02 +0800 Subject: [PATCH] emacs - add org init file --- emacs.d/config/init-ggtags.el | 16 ++++++++-------- emacs.d/config/init-helm.el | 23 +++++++++++++++++++++-- emacs.d/config/init-org.el | 20 ++++++++++++++++---- emacs.d/config/my-packages.el | 2 ++ emacs.d/init.el | 36 ++++++++++++++++++++++++++++++++++++ 5 files changed, 83 insertions(+), 14 deletions(-) diff --git a/emacs.d/config/init-ggtags.el b/emacs.d/config/init-ggtags.el index bc22547..d109e68 100644 --- a/emacs.d/config/init-ggtags.el +++ b/emacs.d/config/init-ggtags.el @@ -2,14 +2,14 @@ ;;;; show default directory on mode-line (ggtags-mode 1) -;; using ido-completion for ggtags -;; https://github.com/leoliu/ggtags/issues/56 -(setq ggtags-completing-read-function - (lambda (&rest args) - (apply #'ido-completing-read - (car args) - (all-completions "" ggtags-completion-table) - (cddr args)))) +;;;; using ido-completion for ggtags +;;;; https://github.com/leoliu/ggtags/issues/56 +;;(setq ggtags-completing-read-function +;; (lambda (&rest args) +;; (apply #'ido-completing-read +;; (car args) +;; (all-completions "" ggtags-completion-table) +;; (cddr args)))) (custom-set-variables '(ggtags-split-window-function (quote split-window-vertically))) diff --git a/emacs.d/config/init-helm.el b/emacs.d/config/init-helm.el index 1b423b5..2487a0a 100644 --- a/emacs.d/config/init-helm.el +++ b/emacs.d/config/init-helm.el @@ -4,12 +4,22 @@ (require 'helm-adaptive) (helm-mode 1) +;; helm-M-x (global-set-key (kbd "M-x") 'helm-M-x) -;; http://tuhdo.github.io/helm-intro.html -(global-set-key (kbd "C-x b") 'helm-mini) +(setq helm-M-x-fuzzy-match t) ;; optional fuzzy matching for helm-M-x + +;; helm-mini +;;(global-set-key (kbd "C-x b") 'helm-mini) +(global-set-key (kbd "C-o C-j") 'helm-mini) (setq helm-buffers-fuzzy-matching t helm-recentf-fuzzy-match t) +;; helm-find-file +;(global-set-key (kbd "C-x C-f") 'helm-find-files) +(global-set-key (kbd "C-o C-f") 'helm-find-files) + + + ;; http://stackoverflow.com/questions/9992475/how-to-show-anything-buffers-always-in-new-window (setq helm-display-function (lambda (buf) @@ -18,6 +28,15 @@ (switch-to-buffer buf))) +;;;;;;; http://tuhdo.github.io/helm-intro.html +;;;;;(setq helm-split-window-in-side-p t ; open helm buffer inside current window, not occupy whole other window +;;;;; helm-move-to-line-cycle-in-source t ; move to end or beginning of source when reaching top or bottom of source. +;;;;; helm-ff-search-library-in-sexp t ; search for library in `require' and `declare-function' sexp. +;;;;; helm-scroll-amount 8 ; scroll 8 lines other window using M-/M- +;;;;; helm-ff-file-name-history-use-recentf t) + + + (helm-autoresize-mode 1) (helm-adaptive-mode 1) (helm-adaptative-mode 1) diff --git a/emacs.d/config/init-org.el b/emacs.d/config/init-org.el index 6d23722..f814058 100644 --- a/emacs.d/config/init-org.el +++ b/emacs.d/config/init-org.el @@ -17,7 +17,19 @@ (global-set-key "\C-cb" 'org-iswitchb) -(add-hook 'org-mode-hook - (lambda () - (org-set-local 'yas/trigger-key [tab]) - (define-key yas/keymap [tab] 'yas/next-field-or-maybe-expand))) +;;(add-hook 'org-mode-hook +;; (lambda () +;; (org-set-local 'yas/trigger-key [tab]) +;; (define-key yas/keymap [tab] 'yas/next-field-or-maybe-expand))) + + + + +;; org-capture +(setq org-directory "~/Private/org") +(setq org-default-notes-file (concat org-directory "/notes.org")) +(define-key global-map "\C-cc" 'org-capture) + + + +(provide 'init-org) diff --git a/emacs.d/config/my-packages.el b/emacs.d/config/my-packages.el index e953b74..39faf48 100644 --- a/emacs.d/config/my-packages.el +++ b/emacs.d/config/my-packages.el @@ -57,6 +57,8 @@ pp-c-l session use-package + helm-gtags + icicles ) "a list of packages to ensure are installed at launch.") (require 'cl) diff --git a/emacs.d/init.el b/emacs.d/init.el index 9005a3a..d0c3e17 100644 --- a/emacs.d/init.el +++ b/emacs.d/init.el @@ -83,3 +83,39 @@ ;; savehist-additional-variables '(extended-command-history)) ; (setq split-height-threshold 0) + + + + + +;;;(require 'helm-gtags) +;;;;(require 'setup-helm-gtags) +;;;;(helm-gtags-mode 1) +;;;;;; Enable helm-gtags-mode +;;;(add-hook 'c-mode-hook 'helm-gtags-mode) +;;;(add-hook 'c++-mode-hook 'helm-gtags-mode) +;;;(add-hook 'asm-mode-hook 'helm-gtags-mode) +;;; +;;;;; customize +;;;(custom-set-variables +;;; '(helm-gtags-path-style 'relative) +;;; '(helm-gtags-ignore-case t) +;;; '(helm-gtags-auto-update t)) +;;; +;;;;; key bindings +;;;(eval-after-load "helm-gtags" +;;; '(progn +;;; (define-key helm-gtags-mode-map (kbd "M-t") 'helm-gtags-find-tag) +;;; (define-key helm-gtags-mode-map (kbd "M-r") 'helm-gtags-find-rtag) +;;; (define-key helm-gtags-mode-map (kbd "M-s") 'helm-gtags-find-symbol) +;;; (define-key helm-gtags-mode-map (kbd "M-g M-p") 'helm-gtags-parse-file) +;;; (define-key helm-gtags-mode-map (kbd "C-c <") 'helm-gtags-previous-history) +;;; (define-key helm-gtags-mode-map (kbd "C-c >") 'helm-gtags-next-history) +;;; (define-key helm-gtags-mode-map (kbd "M-,") 'helm-gtags-pop-stack))) + + +;(require 'icicles) +;(icy-mode 1) + + +(require 'init-org) -- 2.11.0