-
Notifications
You must be signed in to change notification settings - Fork 0
/
init.el
182 lines (153 loc) · 5.74 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
;; create by c34031328
;; 2016-12-10
;; el-get at top!
(add-to-list 'load-path "~/.emacs.d/el-get/el-get")
(unless (require 'el-get nil 'noerror)
(url-retrieve
"https://github.com/dimitri/el-get/raw/master/el-get-install.el"
(lambda (s)
(end-of-buffer)
(eval-print-last-sexp))))
(add-to-list 'el-get-recipe-path
"~/.emacs.d/el-get-user/recipes")
(customize-set-variable 'el-get-user-package-directory
"~/.emacs.d/el-get-user/init")
(el-get nil '(el-get
smex markdown-mode pangu-spacing js2-mode
evil evil-surround evil-args evil-numbers evil-goggles
rainbow-delimiters js-comint vimish-fold))
;; fix package list error
;; https://github.com/syl20bnr/spacemacs/issues/3854
(load-library "url-handlers")
(require 'package)
(customize-set-variable
'package-archives
'(("gnu" . "http://elpa.gnu.org/packages/")
("marmalade" . "http://marmalade-repo.org/packages/")
("melpa-stable" . "http://stable.melpa.org/packages/")))
(package-initialize)
;; my own library
(add-to-list 'load-path "~/.emacs.d/lisp")
(require 'evil-little-word)
(require 'evil-command-plus)
(require 'mblog-tool)
(require 'sdcv)
(global-set-key (kbd "C-c d") #'kid-sdcv-to-buffer)
(require 'happy-image-paste)
(defun evil-paste-happy-image-paste-advice (&rest _)
"if clipboard contain image data, paste it."
(happy-image-paste))
(advice-add 'evil-paste-after :before-until
#'evil-paste-happy-image-paste-advice)
(defun disable-pangu-mode ()
(pangu-spacing-mode -1))
(add-hook 'nxml-mode-hook #'disable-pangu-mode)
(require 'ido)
(ido-mode t)
(defun my-ido-bind-key ()
"ido key binding need add as hook, accroding to
<https://emacs.stackexchange.com/questions/3729/how-do-i-bind-keys-in-ido>"
(define-key ido-completion-map (kbd "C-p") 'ido-prev-match)
(define-key ido-completion-map (kbd "C-n") 'ido-next-match))
(add-hook 'ido-setup-hook #'my-ido-bind-key)
(global-set-key (kbd "C-x f") 'ido-find-file)
;; hint elisp function
(add-hook 'emacs-lisp-mode-hook #'eldoc-mode)
(evil-commentary-mode 1)
(evil-vimish-fold-mode 1)
;;;; about Emacs itself
;; emacs has no user-agent default??
(customize-set-variable 'url-user-agent "Emacs25")
;; free most space
(menu-bar-mode -1)
(tool-bar-mode -1)
;; (customize-set-variable 'mode-line-format nil)
(customize-set-variable 'indent-tabs-mode nil)
;; let M-a M-e distinct `,;`
(customize-set-variable
'sentence-end-without-space
(concat sentence-end-without-space ",;")
"break all chinese sentence")
(customize-set-variable
'sentence-end-base
(concat "[," (substring sentence-end-base 1))
"break english sentence at camma.")
(customize-set-variable
'Info-additional-directory-list
'("/home/gholk/.local/share/info/")
"my local info directory, always a symbol link to other directory.")
(global-set-key (kbd "C-c m") #'manual-entry)
(define-key emacs-lisp-mode-map
(kbd "TAB") 'completion-at-point)
(set-face-attribute 'default nil :height 150)
(add-to-list 'auto-mode-alist '("/home/gholk/gholk/text/" . markdown-mode))
(add-to-list 'auto-mode-alist '("\\.m\\'" . octave-mode))
(defadvice ido-find-file
(after find-file-sudo activate)
"Find file as root if necessary."
(unless (and buffer-file-name
(file-writable-p buffer-file-name))
(find-alternate-file (concat "/sudo:root@localhost:"
buffer-file-name))))
;; send to selection if ok
(customize-set-variable
'select-enable-primary t)
(load-theme 'tango-dark)
(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.
'(Info-additional-directory-list (quote ("/home/gholk/.local/share/info/")))
'(default-frame-alist (quote ((height . 24))))
'(delete-by-moving-to-trash t)
'(el-get-user-package-directory "~/.emacs.d/el-get-user/init")
'(evil-disable-insert-state-bindings t)
'(evil-find-skip-newlines t t)
'(evil-goggles-duration 0.1)
'(evil-overriding-maps
(quote
((Buffer-menu-mode-map)
(color-theme-mode-map)
(comint-mode-map)
(compilation-mode-map)
(grep-mode-map)
(dictionary-mode-map)
(ert-results-mode-map . motion)
(speedbar-key-map)
(speedbar-file-key-map)
(speedbar-buffers-key-map))))
'(evil-search-module (quote isearch))
'(evil-search-wrap nil)
'(evil-shift-width 4)
'(evil-want-Y-yank-to-eol t)
'(evil-want-fine-undo t)
'(indent-tabs-mode nil)
'(js2-mode-assume-strict nil)
'(js2-strict-missing-semi-warning nil)
'(org-agenda-files nil)
'(package-archives
(quote
(("gnu" . "http://elpa.gnu.org/packages/")
("marmalade" . "http://marmalade-repo.org/packages/")
("melpa-stable" . "http://stable.melpa.org/packages/"))))
'(pangu-spacing-real-insert-separtor t)
'(safe-local-variable-values
(quote
((happy-image-save-directory . "image"))))
'(select-enable-primary t)
'(sentence-end-base "[,.?!…‽][]\"'”’)}]*")
'(sentence-end-without-space "。.?!,;")
'(url-user-agent "Emacs25"))
(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.
'(diff-changed ((t (:background "dim gray"))))
'(evil-goggles-delete-face ((t (:inherit diff-removed))))
'(evil-goggles-paste-face ((t (:inherit diff-added))))
'(evil-goggles-undo-redo-add-face ((t (:inherit diff-added))))
'(evil-goggles-undo-redo-change-face ((t (:inherit diff-changed))))
'(evil-goggles-undo-redo-remove-face ((t (:inherit diff-removed))))
'(evil-goggles-yank-face ((t (:inherit diff-changed)))))