-
Notifications
You must be signed in to change notification settings - Fork 1
/
init.el
187 lines (158 loc) · 5.56 KB
/
init.el
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
;(desktop-save-mode 1)
; ELPA packagin
(add-to-list 'load-path
"~/.emacs.d/plugins/package.el")
(load "package")
(package-initialize)
; disabling menu-bar-mode
(menu-bar-mode -1)
; deft mode
(add-to-list 'load-path "~/.emacs.d/plugins/deft")
(when (require 'deft nil 'noerror)
(setq
deft-extension "org"
deft-directory "~/.deft/"
deft-text-mode 'org-mode)
(global-set-key (kbd "<f9>") 'deft))
; actionscript mode
(add-to-list 'load-path "~/.emacs.d/plugins/actionscript")
(require 'actionscript-mode)
(add-to-list 'auto-mode-alist '("\\.as$" . actionscript-mode))
(add-to-list 'auto-mode-alist '("\\.mxml$" . xml-mode))
; coffeescript mode
(add-to-list 'load-path "~/.emacs.d/plugins/coffee-mode")
(require 'coffee-mode)
; /coffeescript mode
; move line/region up/down
(load-file "~/.emacs.d/plugins/movelineregion/movelineregion.el")
; haml & sass
(add-to-list 'auto-mode-alist '("\\.scss$" . sass-mode))
(add-to-list 'auto-mode-alist '("\\.haml$" . haml-mode))
; nxhtml mode
(add-to-list 'load-path
"~/.emacs.d/plugins/nxhtml")
; (load "autostart.el")
; textmate.el (autobrackets behavior)
(load-file "~/.emacs.d/plugins/textmate.el/textmate.el")
(require 'textmate-mode)
(defun textmate-mode-enable-hook ()
(textmate-mode t))
(add-hook 'feature-mode-hook 'textmate-mode-enable-hook)
(add-hook 'ruby-mode-hook 'textmate-mode-enable-hook)
(add-hook 'emacs-lisp-mode-hook 'textmate-mode-enable-hook)
(add-hook 'clojure-mode-hook 'textmate-mode-enable-hook)
; swap buffers in window (by ChrisWebber)
(setq swapping-buffer nil)
(setq swapping-window nil)
(defun swap-buffers-in-windows ()
"Swap buffers between two windows"
(interactive)
(if (and swapping-window
swapping-buffer)
(let ((this-buffer (current-buffer))
(this-window (selected-window)))
(if (and (window-live-p swapping-window)
(buffer-live-p swapping-buffer))
(progn (switch-to-buffer swapping-buffer)
(select-window swapping-window)
(switch-to-buffer this-buffer)
(select-window this-window)
(message "Swapped buffers."))
(message "Old buffer/window killed. Aborting."))
(setq swapping-buffer nil)
(setq swapping-window nil))
(progn
(setq swapping-buffer (current-buffer))
(setq swapping-window (selected-window))
(message "Buffer and window marked for swapping."))))
(global-set-key (kbd "C-c p") 'swap-buffers-in-windows)
; deleting trailing whitespace on save
(add-hook 'before-save-hook 'delete-trailing-whitespace)
; adding yasnippet
(add-to-list 'load-path
"~/.emacs.d/plugins/yasnippet-0.6.1c")
(require 'yasnippet)
(setq yas/root-directory "~/.emacs.d/snippets")
(yas/initialize)
(yas/load-directory yas/root-directory)
; markdown mode hook
(setq auto-mode-alist
(cons '("\\.text" . markdown-mode) auto-mode-alist))
(setq auto-mode-alist
(cons '("\\.md" . markdown-mode) auto-mode-alist))
; gist.github
(set 'gist-view-gist 1)
(add-to-list 'load-path "~/.emacs.d/plugins/gist.el")
(require 'gist)
; mo-git-blame
(add-to-list 'load-path "~/.emacs.d/plugins/mo-git-blame")
(autoload 'mo-git-blame-file "mo-git-blame" nil t)
(autoload 'mo-git-blame-current "mo-git-blame" nil t)
(global-set-key (kbd "C-c g c") 'mo-git-blame-current)
(global-set-key (kbd "C-c g f") 'mo-git-blame-file)
; ido
(require 'ido)
(ido-mode t)
; git-emacs
(add-to-list 'load-path "~/.emacs.d/plugins/git-emacs")
(require 'git-emacs-autoloads)
; yaml-mode
(add-to-list 'load-path "~/.emacs.d/plugins/yaml-mode")
(require 'yaml-mode)
(add-to-list 'auto-mode-alist '("\\.yml$" . yaml-mode))
; emacs list expectations (rspec is dependent on it)
(add-to-list 'load-path "~/.emacs.d/plugins")
(require 'el-expectations)
; mode-compile (required by rspec-mode)
(add-to-list 'load-path "~/.emacs.d/plugins/mode-compile")
(require 'mode-compile)
(require 'ansi-color)
; rspec-emacs
(add-to-list 'load-path "~/.emacs.d/plugins/rspec-mode")
(require 'rspec-mode)
; applying color heme
(require 'color-theme)
(load-file "~/.emacs.d/themes/color-theme-railscasts.el")
(load-file "~/.emacs.d/themes/twilight/color-theme-twilight.el")
(color-theme-twilight)
; disabling tool bar
(tool-bar-mode)
; disabling all scroll bars
(scroll-bar-mode)
; loading Feature mode cucumber.el
(add-to-list 'load-path "~/.emacs.d/plugins/cucumber.el")
(require 'feature-mode)
(add-to-list 'auto-mode-alist '("\.feature$" . feature-mode))
;; Rinari
(add-to-list 'load-path "~/.emacs.d/plugins/rinari")
(require 'rinari)
(custom-set-variables
;; custom-set-variables was added by Custom.
;; If you edit it by hand, you could mess it up, so be careful.
;; Your init file should contain only one such instance.
;; If there is more than one, they won't work right.
'(inhibit-startup-screen t)
'(rails-ws:default-server-type "webrick"))
(custom-set-faces
;; custom-set-faces was added by Custom.
;; If you edit it by hand, you could mess it up, so be careful.
;; Your init file should contain only one such instance.
;; If there is more than one, they won't work right.
)
; defining line duplication hotkey
(defun duplicate-line ()
(interactive)
(move-beginning-of-line 1)
(kill-line)
(yank)
(newline)
(yank)
)
(global-set-key (kbd "C-c d") 'duplicate-line)
;; auto-complete
(add-to-list 'load-path "~/.emacs.d/plugins/auto-complete/")
(require 'auto-complete-config)
(add-to-list 'ac-dictionary-directories "~/.emacs.d/plugins/auto-complete/ac-dict")
(ac-config-default)
(setq custom-file "~/.emacs.d/customizations.el")
(load custom-file)