emacs - aadd hydra mapping
[dotfiles.git] / emacs.d / init.el
1
2
3 ;; Added by Package.el.  This must come before configurations of
4 ;; installed packages.  Don't delete this line.  If you don't want it,
5 ;; just comment it out by adding a semicolon to the start of the line.
6 ;; You may delete these explanatory comments.
7 ;(package-initialize)
8
9  (load-library "url-handlers")
10
11 (setenv "PATH" (concat (getenv "PATH") ":/usr/local/bin"))
12 (setq exec-path (append exec-path '("/usr/local/bin")))
13
14 ;; package manager
15 (require 'package)
16
17 (add-to-list 'package-archives
18              '("melpa" . "http://melpa.milkbox.net/packages/") t)
19 (add-to-list 'package-archives
20              '("org" . "http://orgmode.org/elpa/") t)
21 ;(add-to-list 'package-archives
22 ;             '("marmalade" . "http://marmalade-repo.org/packages/") t)
23
24 (package-initialize)
25
26 ;; use-package
27 (unless (package-installed-p 'use-package)
28   (package-refresh-contents)
29   (package-install 'use-package))
30
31 (require 'use-package)
32
33 ;;;;; load path
34 (add-to-list 'load-path "~/.emacs.d/elisp")
35
36 ;;; load elisp config
37 (require 'init-base)
38 (require 'init-magit)
39 (require 'init-helm)
40 (require 'init-projectile)
41 (require 'init-org)
42
43
44
45
46
47
48
49
50
51 (use-package ido-vertical-mode
52   :ensure t)
53
54
55 (use-package hydra
56   :ensure t
57   :config
58   (hydra-add-font-lock))
59
60
61 ;;;;;;;;;
62 (use-package ace-jump-mode
63   :commands ace-jump-mode
64   :init
65   (bind-key "C-." 'ace-jump-mode))
66
67 (use-package sublime-themes
68   :ensure t
69   :config
70   (load-theme 'spolsky t)
71   )
72
73
74
75
76
77
78
79
80
81
82
83
84
85 ;(add-to-list 'load-path "~/.emacs.d/config")
86
87 ;; remove custom setting out of init.el
88 ;; http://emacsblog.org/2008/12/06/quick-tip-detaching-the-custom-file/
89 ;(setq custom-file "~/.emacs.d/custom.el")
90 ;(load custom-file 'noerror)
91 ;(require 'my-packages)
92 ;(require 'init-base)
93 ;(require 'init-font)
94
95 ;(require 'init-helm)
96
97 ;(require 'init-color-theme)
98 ;(require 'init-color-theme-2)
99 ;(require 'init-ido)
100 ;(require 'init-magit)
101 ;(require 'init-evil)
102 ;(require 'init-project)
103 ;(require 'init-ggtags)
104
105 ;(require 'init-projectile)
106
107 ;;;; conflict with C-c . in org-mode, disable it temporarily
108 ;;;;(require 'init-c-cpp)
109 ;(require 'init-key-binding)
110 ;(require 'init-winner)
111 ;(require 'init-minibuffer)
112 ;(require 'init-eshell)
113
114 ;; http://stackoverflow.com/questions/11484225/fix-an-auto-complete-mode-and-linum-mode-annoyance
115 ;;;(ac-linum-workaround)
116
117
118 ;(require 'init-mode-line)
119 ;(require 'init-workgroup2)
120 ;(require 'init-perl)
121
122 ;(add-to-list 'load-path "~/.emacs.d/Emacs-PDE-0.2.16/lisp/")
123 ;(load "pde-load")                       ;
124
125 ;(require 'init-linum)
126
127 ;(require 'auto-complete)
128 ;(require 'auto-complete-config)
129 ;(ac-config-default)
130
131
132
133
134 ;; page break configuration
135 ;(require 'pp-c-l)
136 ;(pretty-control-l-mode 1)
137
138 ;; persist command history of helm
139 ;(require 'session)
140 ;(add-hook 'after-init-hook 'session-initialize)
141
142
143 ;(require 'use-package)
144
145 ;; persist command history of helm
146 ;(use-package savehist
147 ;  :init (savehist-mode)
148 ;  :config
149 ;  (setq history-length 1000
150 ;        history-delete-duplicates t
151 ;        savehist-additional-variables '(extended-command-history))) 
152
153 ;;(savehist-mode)
154 ;;  (setq history-length 1000
155 ;;        history-delete-duplicates t
156 ;;        savehist-additional-variables '(extended-command-history)) 
157
158 ;    (setq split-height-threshold 0)
159
160
161
162
163
164 ;;;(require 'helm-gtags)
165 ;;;;(require 'setup-helm-gtags)
166 ;;;;(helm-gtags-mode 1)
167 ;;;;;; Enable helm-gtags-mode
168 ;;;(add-hook 'c-mode-hook 'helm-gtags-mode)
169 ;;;(add-hook 'c++-mode-hook 'helm-gtags-mode)
170 ;;;(add-hook 'asm-mode-hook 'helm-gtags-mode)
171 ;;;
172 ;;;;; customize
173 ;;;(custom-set-variables
174 ;;; '(helm-gtags-path-style 'relative)
175 ;;; '(helm-gtags-ignore-case t)
176 ;;; '(helm-gtags-auto-update t))
177 ;;;
178 ;;;;; key bindings
179 ;;;(eval-after-load "helm-gtags"
180 ;;;  '(progn
181 ;;;     (define-key helm-gtags-mode-map (kbd "M-t") 'helm-gtags-find-tag)
182 ;;;     (define-key helm-gtags-mode-map (kbd "M-r") 'helm-gtags-find-rtag)
183 ;;;     (define-key helm-gtags-mode-map (kbd "M-s") 'helm-gtags-find-symbol)
184 ;;;     (define-key helm-gtags-mode-map (kbd "M-g M-p") 'helm-gtags-parse-file)
185 ;;;     (define-key helm-gtags-mode-map (kbd "C-c <") 'helm-gtags-previous-history)
186 ;;;     (define-key helm-gtags-mode-map (kbd "C-c >") 'helm-gtags-next-history)
187 ;;;     (define-key helm-gtags-mode-map (kbd "M-,") 'helm-gtags-pop-stack)))
188
189
190 ;(require 'icicles)
191 ;(icy-mode 1)
192
193
194 ;;(require 'init-org)
195 ;(setq help-window-select t)
196
197
198
199 ;(require 'init-keychord)
200
201 ;(setq hydra-examples-verbatim t)
202 ;(require 'init-hydra)
203
204
205 ;(require 'ace-window)
206 ;(global-set-key (kbd "M-p") 'ace-window)
207
208
209 ;(require 'init-multi-term)
210 ;(require 'init-projectile)
211
212 ;(require 'page-break-lines)
213 ;(turn-on-page-break-lines-mode)
214 ;(global-page-break-lines-mode 1)
215
216 ;(setq projectile-completion-system 'helm)
217 ;(helm-projectile-on)
218
219
220 ;; show projectile name in mode-line
221
222
223 ;(if (locate-library "ediff")
224 ;    (progn
225 ;      (autoload 'ediff-files "ediff")
226 ;      (autoload 'ediff-buffers "ediff")
227 ;
228 ;       (eval-after-load "ediff" '(progn
229 ;                         (message "doing ediff customisation")
230 ;                         (setq diff-switches               "-u"
231 ;                               ediff-custom-diff-options   "-U3"
232 ;                               ediff-split-window-function 'split-window-horizontally
233 ;                               ediff-window-setup-function 'ediff-setu;p-windows-plain)
234 ;
235 ;                         (add-hook 'ediff-startup-hook 'ediff-toggle-w;ide-display)
236 ;                         (add-hook 'ediff-cleanup-hook 'ediff-toggle-w;ide-display)
237 ;                         (add-hook 'ediff-suspend-hook 'ediff-toggle-wide-display)))))
238
239
240
241 ;(defun update-diff-colors ()
242 ;  "update the colors for diff faces"
243 ;  (set-face-attribute 'diff-added nil
244 ;                      :foreground "white" :background "blue")
245 ;  (set-face-attribute 'diff-removed nil
246 ;                      :foreground "white" :background "red3")
247 ;  (set-face-attribute 'diff-changed nil
248 ;                      :foreground "white" :background "purple"))
249 ;(eval-after-load "diff-mode"
250 ;  '(update-diff-colors))
251
252
253
254 ;(require 'helm-ag)
255 ;(require 'flx)
256 ;(flx-ido-mode t)
257
258
259
260 ;(fringe-mode (quote (0 . 0)))
261
262
263 (custom-set-variables
264  ;; custom-set-variables was added by Custom.
265  ;; If you edit it by hand, you could mess it up, so be careful.
266  ;; Your init file should contain only one such instance.
267  ;; If there is more than one, they won't work right.
268  '(package-selected-packages
269    (quote
270     (helm yasnippet workgroups2 w3m use-package tangotango-theme tabbar smex session rich-minority relative-line-numbers recentf-ext projectile-speedbar pp-c-l powerline persp-projectile paradox page-break-lines org-cliplink org-caldav org-bullets multi-term monokai-theme molokai-theme moe-theme minibuffer-line markdown-mode magit linum-relative key-chord jekyll-modes irony iedit ido-vertical-mode ido-ubiquitous icicles hydra highlight-tail highlight-escape-sequences highlight-current-line helm-projectile helm-ls-svn helm-ls-git helm-gtags helm-ag google-c-style ggtags flyspell-lazy flymake-google-cpplint flymake-cursor flx-ido fiplr eyebrowse evil-leader evil-escape ecb dired+ diff-hl cyberpunk-theme company color-theme-sanityinc-tomorrow color-theme color-identifiers-mode auto-complete-c-headers ace-window ace-jump-mode))))
271 (custom-set-faces
272  ;; custom-set-faces was added by Custom.
273  ;; If you edit it by hand, you could mess it up, so be careful.
274  ;; Your init file should contain only one such instance.
275  ;; If there is more than one, they won't work right.
276  )