This repository has been archived by the owner on Jul 24, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 14
/
Copy pathinit.el
241 lines (210 loc) · 6.45 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
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
(defvar senny-temporary-file-directory (expand-file-name "~/.emacs.d/tmp"))
(setq backup-directory-alist
`((".*" . ,temporary-file-directory)))
(setq auto-save-file-name-transforms
`((".*" ,temporary-file-directory t)))
(add-to-list 'load-path (expand-file-name "modules" user-emacs-directory))
(require 'defuns-cfg)
(require 'keybindings-cfg)
(if (member "Monaco" (font-family-list))
(set-face-attribute 'default nil :font "Monaco 16"))
(if window-system
(progn
(setq frame-title-format '(buffer-file-name "%f" ("%b")))
(tooltip-mode -1)
(mouse-wheel-mode t)
(scroll-bar-mode -1))
(menu-bar-mode -1))
(when (fboundp 'tool-bar-mode)
(tool-bar-mode -1))
(blink-cursor-mode -1)
(setq-default cursor-type '(bar . 2))
(global-hl-line-mode t)
(delete-selection-mode 1)
(transient-mark-mode 1)
(show-paren-mode 1)
(column-number-mode 1)
(defalias 'yes-or-no-p 'y-or-n-p)
(setq inhibit-startup-screen t)
(add-to-list 'initial-frame-alist '(fullscreen . maximized))
(electric-pair-mode 1)
(remove-trailing-whitespace-mode)
(setq-default require-final-newline 'visit-save)
(server-start)
(setenv "PATH" (concat (getenv "PATH") ":/usr/local/bin"))
(setq exec-path (cons "/usr/local/bin" exec-path))
;; Bootstrap `use-package'
(require 'package)
(setq package-enable-at-startup nil)
(add-to-list 'package-archives
'("melpa" . "https://melpa.org/packages/"))
(package-initialize)
(unless (package-installed-p 'use-package)
(package-refresh-contents)
(package-install 'use-package))
(eval-and-compile
(add-to-list 'load-path (expand-file-name "vendor" user-emacs-directory)))
(use-package ido
:config
(setq ido-enable-flex-matching t)
(ido-mode 1))
(use-package ag
:ensure t
:commands (ag ag-regexp ag-project))
(use-package twilight-bright-theme
:ensure t
:config (load-theme 'twilight-bright t))
(use-package helm
:ensure t
:bind (("M-a" . helm-M-x)
("C-x C-f" . helm-find-files)
("C-x f" . helm-recentf)
("C-SPC" . helm-dabbrev)
("M-y" . helm-show-kill-ring)
("C-x b" . helm-buffers-list))
:bind (:map helm-map
("M-i" . helm-previous-line)
("M-k" . helm-next-line)
("M-I" . helm-previous-page)
("M-K" . helm-next-page)
("M-h" . helm-beginning-of-buffer)
("M-H" . helm-end-of-buffer))
:config (progn
(setq helm-buffers-fuzzy-matching t)
(helm-mode 1)))
(use-package helm-descbinds
:ensure t
:bind ("C-h b" . helm-descbinds))
(use-package helm-files
:bind (:map helm-find-files-map
("M-i" . nil)
("M-k" . nil)
("M-I" . nil)
("M-K" . nil)
("M-h" . nil)
("M-H" . nil)))
(use-package helm-swoop
:ensure t
:bind (("M-m" . helm-swoop)
("M-M" . helm-swoop-back-to-last-point))
:init
(bind-key "M-m" 'helm-swoop-from-isearch isearch-mode-map))
(use-package helm-ag
:ensure helm-ag
:bind ("M-p" . helm-projectile-ag)
:commands (helm-ag helm-projectile-ag)
:init (setq helm-ag-insert-at-point 'symbol
helm-ag-command-option "--path-to-ignore ~/.agignore"))
(use-package projectile
:ensure t
:bind (("C-p s" . projectile-switch-open-project)
("C-x p" . projectile-switch-project))
:config
(projectile-global-mode)
(setq projectile-enable-caching t))
(use-package helm-projectile
:ensure t
:bind ("M-t" . helm-projectile-find-file)
:config
(helm-projectile-on))
(use-package enh-ruby-mode
:ensure t
:defer t
:mode (("\\.rb\\'" . enh-ruby-mode)
("\\.ru\\'" . enh-ruby-mode)
("\\.jbuilder\\'" . enh-ruby-mode)
("\\.gemspec\\'" . enh-ruby-mode)
("\\.rake\\'" . enh-ruby-mode)
("Rakefile\\'" . enh-ruby-mode)
("Gemfile\\'" . enh-ruby-mode)
("Guardfile\\'" . enh-ruby-mode)
("Capfile\\'" . enh-ruby-mode)
("Vagrantfile\\'" . enh-ruby-mode))
:config (progn
(setq enh-ruby-indent-level 2
enh-ruby-add-encoding-comment-on-save nil
enh-ruby-deep-indent-paren nil
enh-ruby-bounce-deep-indent t
enh-ruby-hanging-indent-level 2)
(setq enh-ruby-program "/Users/senny/.asdf/installs/ruby/2.6.6/bin/ruby")
(setq ruby-insert-encoding-magic-comment nil)))
(use-package rubocop
:ensure t
:defer t
:init (add-hook 'ruby-mode-hook 'rubocop-mode))
(use-package minitest
:ensure t
:defer t)
(use-package rspec-mode
:ensure t
:defer t)
(use-package rbenv
:ensure t
:defer t
:init (setq rbenv-show-active-ruby-in-modeline nil)
:config (progn
(global-rbenv-mode)
(add-hook 'enh-ruby-mode-hook 'rbenv-use-corresponding)))
(use-package flycheck
:ensure t
:defer 5
:config
(global-flycheck-mode 1))
(use-package drag-stuff
:ensure t
:bind (("M-<up>" . drag-stuff-up)
("M-<down>" . drag-stuff-down)
("M-<left>" . shift-left)
("M-<right>" . shift-right)))
(use-package magit
:ensure t
:defer 2
:bind (("C-x g" . magit-status)))
(use-package slim-mode
:ensure t
:mode ("\\.slim\\'" . slim-mode))
(use-package yaml-mode
:ensure t
:mode ("\\.ya?ml\\'" . yaml-mode))
(use-package markdown-mode
:ensure t
:mode ("\\.md\\'" . markdown-mode))
(use-package web-mode
:ensure t
:mode (("\\.erb\\'" . web-mode)
("\\.mustache\\'" . web-mode)
("\\.html?\\'" . web-mode)
("\\.php\\'" . web-mode))
:config (progn
(setq web-mode-markup-indent-offset 2
web-mode-css-indent-offset 2
web-mode-code-indent-offset 2)))
(use-package go-mode
:defer t
:ensure t
:mode ("\\.go$" . go-mode))
(use-package swift-mode
:ensure t
:bind (:map swift-mode-map
("M-i" . nil)
("M-j" . nil)
("M-l" . nil)
("M-k" . nil)
("M-I" . nil)
("M-K" . nil)
("M-h" . nil)
("M-H" . nil)))
(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.
'(package-selected-packages
(quote
(yaml-mode web-mode use-package twilight-bright-theme swift-mode slim-mode rubocop rspec-mode rbenv minitest markdown-mode magit helm-swoop helm-projectile helm-descbinds helm-ag go-mode flycheck enh-ruby-mode drag-stuff diminish ag))))
(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.
)