forked from eschulte/emacs24-starter-kit
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinit.el
214 lines (193 loc) · 8.99 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
;;; init.el --- Where all the magic begins
;;
;; Part of the Emacs Starter Kit
;;
;; This is the first thing to get loaded.
;;
;; load Org-mode from source when the ORG_HOME environment variable is set
;; Added by Package.el. This must come before configurations of
;; installed packages. Don't delete this line. If you don't want it,
;; just comment it out by adding a semicolon to the start of the line.
;; You may delete these explanatory comments.
(require 'package)
(add-to-list 'package-archives '("melpa" . "https://melpa.org/packages/") t)
(package-initialize)
(when (getenv "ORG_HOME")
(let ((org-lisp-dir (expand-file-name "lisp" (getenv "ORG_HOME"))))
(when (file-directory-p org-lisp-dir)
(add-to-list 'load-path org-lisp-dir)
(require 'org))))
;; load the starter kit from the `after-init-hook' so all packages are loaded
(add-hook 'after-init-hook
`(lambda ()
;; remember this directory
(setq starter-kit-dir
,(file-name-directory (or load-file-name (buffer-file-name))))
;; only load org-mode later if we didn't load it just now
,(unless (and (getenv "ORG_HOME")
(file-directory-p (expand-file-name "lisp"
(getenv "ORG_HOME"))))
'(require 'org))
;; load up the starter kit
(org-babel-load-file (expand-file-name "starter-kit.org" starter-kit-dir))))
;;; init.el ends here
; franee customizations
;; set default dir
(setq default-directory "~/code/coinhouse")
;; Customizing colors used in diff mode
(defun custom-diff-colors ()
"update the colors for diff faces"
(set-face-attribute
'diff-added nil :foreground "green")
(set-face-attribute
'diff-removed nil :foreground "red")
(set-face-attribute
'diff-changed nil :foreground "purple"))
(eval-after-load "diff-mode" '(custom-diff-colors))
;; remove menu bar
(menu-bar-mode -1)
;; show line numbers
(global-linum-mode 1)
;; show indent line
(indent-guide-global-mode 1)
(set-face-background 'indent-guide-face "dimwhite")
;; show column numbers
(setq column-number-mode t)
;; store all backup and autosave files in the tmp dir
(setq backup-directory-alist
`((".*" . ,temporary-file-directory)))
(setq auto-save-file-name-transforms
`((".*" ,temporary-file-directory t)))
;; remove trailing spaces on save
(add-hook 'before-save-hook 'delete-trailing-whitespace)
;; stop ruby from adding the magic comments
(setq ruby-insert-encoding-magic-comment nil)
;; Kills live buffers, leaves some emacs work buffers
;; optained from http://www.chrislott.org/geek/emacs/dotemacs.html
(defun nuke-all-buffers (&optional list)
"For each buffer in LIST, kill it silently if unmodified. Otherwise ask.
LIST defaults to all existing live buffers."
(interactive)
(if (null list)
(setq list (buffer-list)))
(while list
(let* ((buffer (car list))
(name (buffer-name buffer)))
(and (not (string-equal name ""))
(not (string-equal name "*Messages*"))
(not (string-equal name "*Buffer List*"))
(not (string-equal name "*buffer-selection*"))
(not (string-equal name "*Shell Command Output*"))
(not (string-equal name "*scratch*"))
(/= (aref name 0) ? )
(if (buffer-modified-p buffer)
(if (yes-or-no-p
(format "Buffer %s has been edited. Kill? " name))
(kill-buffer buffer))
(kill-buffer buffer))))
(setq list (cdr list))))
;; set shortcut for dumb-jump
(global-set-key (kbd "C-x .") 'dumb-jump-go)
;; set default theme
(load-theme 'dracula t)
;; (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.
;; '(ansi-color-names-vector
;; ["#073642" "#dc322f" "#859900" "#b58900" "#268bd2" "#d33682" "#2aa198" "#657b83"])
;; '(compilation-message-face 'default)
;; '(cua-global-mark-cursor-color "#2aa198")
;; '(cua-normal-cursor-color "#657b83")
;; '(cua-overwrite-cursor-color "#b58900")
;; '(cua-read-only-cursor-color "#859900")
;; '(custom-safe-themes
;; '("3e27c4a8de1ea4e0e7195815ef9ddba53a7dd5cdd1279b0309e9f8e9553be3b7" "285d1bf306091644fb49993341e0ad8bafe57130d9981b680c1dbd974475c5c7" "00445e6f15d31e9afaa23ed0d765850e9cd5e929be5e8e63b114a3346236c44c" "7f1d414afda803f3244c6fb4c2c64bea44dac040ed3731ec9d75275b9e831fe5" "0fffa9669425ff140ff2ae8568c7719705ef33b7a927a0ba7c5e2ffcfac09b75" "830877f4aab227556548dc0a28bf395d0abe0e3a0ab95455731c9ea5ab5fe4e1" "13a8eaddb003fd0d561096e11e1a91b029d3c9d64554f8e897b2513dbf14b277" "51ec7bfa54adf5fff5d466248ea6431097f5a18224788d0bd7eb1257a4f7b773" "2809bcb77ad21312897b541134981282dc455ccd7c14d74cc333b6e549b824f3" "81c3de64d684e23455236abde277cda4b66509ef2c28f66e059aa925b8b12534" "a8245b7cc985a0610d71f9852e9f2767ad1b852c2bdea6f4aadc12cce9c4d6d0" "d91ef4e714f05fff2070da7ca452980999f5361209e679ee988e3c432df24347" "0598c6a29e13e7112cfbc2f523e31927ab7dce56ebb2016b567e1eff6dc1fd4f" default))
;; '(fci-rule-color "#eee8d5")
;; '(highlight-changes-colors '("#d33682" "#6c71c4"))
;; '(highlight-symbol-colors
;; (--map
;; (solarized-color-blend it "#fdf6e3" 0.25)
;; '("#b58900" "#2aa198" "#dc322f" "#6c71c4" "#859900" "#cb4b16" "#268bd2")))
;; '(highlight-symbol-foreground-color "#586e75")
;; '(highlight-tail-colors
;; '(("#eee8d5" . 0)
;; ("#B4C342" . 20)
;; ("#69CABF" . 30)
;; ("#69B7F0" . 50)
;; ("#DEB542" . 60)
;; ("#F2804F" . 70)
;; ("#F771AC" . 85)
;; ("#eee8d5" . 100)))
;; '(hl-bg-colors
;; '("#DEB542" "#F2804F" "#FF6E64" "#F771AC" "#9EA0E5" "#69B7F0" "#69CABF" "#B4C342"))
;; '(hl-fg-colors
;; '("#fdf6e3" "#fdf6e3" "#fdf6e3" "#fdf6e3" "#fdf6e3" "#fdf6e3" "#fdf6e3" "#fdf6e3"))
;; '(hl-paren-colors '("#2aa198" "#b58900" "#268bd2" "#6c71c4" "#859900"))
;; '(nrepl-message-colors
;; '("#dc322f" "#cb4b16" "#b58900" "#546E00" "#B4C342" "#00629D" "#2aa198" "#d33682" "#6c71c4"))
;; '(package-selected-packages
;; '(osm speed-type terraform-mode go-mode dracula-theme google-translate helm dumb-jump helm-ebdb fzf solarized-theme indent-guide coffee-mode))
;; '(pos-tip-background-color "#eee8d5")
;; '(pos-tip-foreground-color "#586e75")
;; '(smartrep-mode-line-active-bg (solarized-color-blend "#859900" "#eee8d5" 0.2))
;; '(term-default-bg-color "#fdf6e3")
;; '(term-default-fg-color "#657b83")
;; '(vc-annotate-background nil)
;; '(vc-annotate-background-mode nil)
;; '(vc-annotate-color-map
;; '((20 . "#dc322f")
;; (40 . "#ffff7fff0000")
;; (60 . "#ffffbfff0000")
;; (80 . "#b58900")
;; (100 . "#ffffffff0000")
;; (120 . "#ffffffff0000")
;; (140 . "#ffffffff0000")
;; (160 . "#ffffffff0000")
;; (180 . "#859900")
;; (200 . "#aaaaffff5555")
;; (220 . "#7fffffff7fff")
;; (240 . "#5555ffffaaaa")
;; (260 . "#2aaaffffd554")
;; (280 . "#2aa198")
;; (300 . "#0000ffffffff")
;; (320 . "#0000ffffffff")
;; (340 . "#0000ffffffff")
;; (360 . "#268bd2")))
;; '(vc-annotate-very-old-color nil)
;; '(weechat-color-list
;; '(unspecified "#fdf6e3" "#eee8d5" "#990A1B" "#dc322f" "#546E00" "#859900" "#7B6000" "#b58900" "#00629D" "#268bd2" "#93115C" "#d33682" "#00736F" "#2aa198" "#657b83" "#839496"))
;; '(xterm-color-names
;; ["#eee8d5" "#dc322f" "#859900" "#b58900" "#268bd2" "#d33682" "#2aa198" "#073642"])
;; '(xterm-color-names-bright
;; ["#fdf6e3" "#cb4b16" "#93a1a1" "#839496" "#657b83" "#6c71c4" "#586e75" "#002b36"]))
;; (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.
;; '(file-name-shadow ((t (:inherit ##))))
;; '(header-line-highlight ((t (:inherit highlight :background "black"))))
;; '(highlight ((((class color) (min-colors 89)) (:background "#834c98"))))
;; '(isearch-fail ((t (:background "black"))))
;; '(line-number ((t (:inherit (shadow default) :foreground "green"))))
;; '(linum ((t (:inherit (## default)))))
;; '(match ((t (:background "white"))))
;; '(region ((t (:background "white"))))
;; '(secondary-selection ((t (:background "white")))))
; go-mode tab setting
(add-hook 'go-mode-hook (lambda () (setq tab-width 4)))
(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.
'(custom-safe-themes
'("81c3de64d684e23455236abde277cda4b66509ef2c28f66e059aa925b8b12534" "2809bcb77ad21312897b541134981282dc455ccd7c14d74cc333b6e549b824f3" default)))
(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.
)