-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathemacs
More file actions
218 lines (193 loc) · 7.32 KB
/
emacs
File metadata and controls
218 lines (193 loc) · 7.32 KB
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
;; GENERAL SETTINGS
(setq directory-free-space-program nil) ;; add to your .emacs file. It's because df runs so slowly on NT fs
(add-to-list 'custom-theme-load-path "~/.emacs.d/themes/")
(add-to-list 'load-path "~/.emacs.d/lisp/") ;; Tell emacs where is your personal elisp lib dir
(electric-indent-mode 0)
;; MELPA
(require 'package) ;; You might already have this line
(add-to-list 'package-archives
'("melpa" . "https://melpa.org/packages/"))
(when (< emacs-major-version 24)
;; For important compatibility libraries like cl-lib
(add-to-list 'package-archives '("gnu" . "http://elpa.gnu.org/packages/")))
(package-initialize) ;; You might already have this line
;; BACKUPS
(setq backup-directory-alist `(("." . "~/.emacs.d/saves")))
(setq backup-by-copying t)
(setq delete-old-versions t
kept-new-versions 6
kept-old-versions 2
version-control t)
;; Enable paren matching
(show-paren-mode 1)
;; Emable column number in status line
(setq column-number-mode t)
;; show trailing whitespace
(setq-default show-trailing-whitespace t)
;; enable line wrap
(setq default-truncate-lines nil)
;; make side by side buffers function the same as the main window
(setq truncate-partial-width-windows nil)
;; regexp
(global-set-key (kbd "C-x C-r") 'replace-regexp)
;; Add F12 to toggle line wrap
(global-set-key (kbd "<f12>") 'toggle-truncate-lines)
(defun trunc()
(toggle-truncate-lines))
;; Scroll single lines up or down
(defun scroll-up-one-line()
(interactive)
(scroll-up 1))
(defun scroll-down-one-line()
(interactive)
(scroll-down 1))
(global-set-key [?\M-.] 'scroll-down-one-line)
(global-set-key [?\M-,] 'scroll-up-one-line)
;; Uniquify lines functions
(defun uniquify-region-lines (beg end)
"Remove duplicate adjacent lines in region."
(interactive "*r")
(save-excursion
(goto-char beg)
(while (re-search-forward "^\\(.*\n\\)\\1+" end t)
(replace-match "\\1"))))
(defun uniquify-buffer-lines ()
"Remove duplicate adjacent lines in the current buffer."
(interactive)
(uniquify-region-lines (point-min) (point-max)))
(defun uniquify-all-lines-region (start end)
"Find duplicate lines in region START to END keeping first occurrence."
(interactive "*r")
(save-excursion
(let ((end (copy-marker end)))
(while
(progn
(goto-char start)
(re-search-forward "^\\(.*\\)\n\\(\\(.*\n\\)*\\)\\1\n" end t))
(replace-match "\\1\n\\2")))))
(defun uniquify-all-lines-buffer ()
"Delete duplicate lines in buffer and keep first occurrence."
(interactive "*")
(uniquify-all-lines-region (point-min) (point-max)))
;; ediff
(defun command-line-diff (switch)
(let ((file1 (pop command-line-args-left))
(file2 (pop command-line-args-left)))
(ediff file1 file2)))
(add-to-list 'command-switch-alist '("diff" . command-line-diff)) ;; Usage: emacs -diff file1 file2
;; Standard Jedi.el setting
;;(add-hook 'python-mode-hook 'jedi:setup)
;;(setq jedi:complete-on-dot t)
;; Type:
;; M-x package-install RET jedi RET
;; M-x jedi:install-server RET
;; Then open Python file.
;; IDO
(require 'ido)
(ido-mode t)
;; load nextflow mode.
(when (load "nextflow-mode" t)
(load "nextflow-mode")) ;; best not to include the ending “.el” or “.elc”
;; use cperl-mode instead of perl-mode
(setq auto-mode-alist (rassq-delete-all 'perl-mode auto-mode-alist))
(add-to-list 'auto-mode-alist '("\\.\\(p\\([lm]\\)\\)\\'" . cperl-mode))
(setq interpreter-mode-alist (rassq-delete-all 'perl-mode interpreter-mode-alist))
(add-to-list 'interpreter-mode-alist '("perl" . cperl-mode))
(add-to-list 'interpreter-mode-alist '("perl5" . cperl-mode))
(add-to-list 'interpreter-mode-alist '("miniperl" . cperl-mode))
(custom-set-faces
'(cperl-array-face ((t (:weight normal))))
'(cperl-hash-face ((t (:weight normal))))
)
;; Theses are set via the emacs settings menus
(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-faces-vector
[default default default italic underline success warning error])
'(ansi-color-names-vector
["#242424" "#e5786d" "#95e454" "#cae682" "#8ac6f2" "#333366" "#ccaa8f" "#f6f3e8"])
'(compilation-message-face (quote default))
'(cua-global-mark-cursor-color "#2aa198")
'(cua-normal-cursor-color "#839496")
'(cua-overwrite-cursor-color "#b58900")
'(cua-read-only-cursor-color "#859900")
'(custom-enabled-themes (quote (tango-dark)))
'(custom-safe-themes
(quote
("0598c6a29e13e7112cfbc2f523e31927ab7dce56ebb2016b567e1eff6dc1fd4f" "604ac011fc9bd042bc041330b3a5e5a86e764a46f7e9fe13e2a1f9f83bf44327" "fad9c3dbfd4a889499f6921f54f68de8857e6846a0398e89887dbe5f26b591c0" "713f898dd8c881c139b62cf05b7ac476d05735825d49006255c0a31f9a4f46ab" "7d16f75538c42cd57d098fa582a469ef75b9d55891b8fb7b27a5236c6ccc0594" default)))
'(fci-rule-color "#073642")
'(highlight-changes-colors (quote ("#d33682" "#6c71c4")))
'(highlight-symbol-colors
(--map
(solarized-color-blend it "#002b36" 0.25)
(quote
("#b58900" "#2aa198" "#dc322f" "#6c71c4" "#859900" "#cb4b16" "#268bd2"))))
'(highlight-symbol-foreground-color "#93a1a1")
'(highlight-tail-colors
(quote
(("#073642" . 0)
("#546E00" . 20)
("#00736F" . 30)
("#00629D" . 50)
("#7B6000" . 60)
("#8B2C02" . 70)
("#93115C" . 85)
("#073642" . 100))))
'(hl-bg-colors
(quote
("#7B6000" "#8B2C02" "#990A1B" "#93115C" "#3F4D91" "#00629D" "#00736F" "#546E00")))
'(hl-fg-colors
(quote
("#002b36" "#002b36" "#002b36" "#002b36" "#002b36" "#002b36" "#002b36" "#002b36")))
'(hl-paren-colors (quote ("#2aa198" "#b58900" "#268bd2" "#6c71c4" "#859900")))
'(ido-enable-flex-matching t)
'(inhibit-startup-screen t)
'(nrepl-message-colors
(quote
("#dc322f" "#cb4b16" "#b58900" "#546E00" "#B4C342" "#00629D" "#2aa198" "#d33682" "#6c71c4")))
'(package-selected-packages (quote (solarized-theme tangotango-theme)))
'(pos-tip-background-color "#073642")
'(pos-tip-foreground-color "#93a1a1")
'(smartrep-mode-line-active-bg (solarized-color-blend "#859900" "#073642" 0.2))
'(tab-width 4)
'(term-default-bg-color "#002b36")
'(term-default-fg-color "#839496")
'(vc-annotate-background nil)
'(vc-annotate-background-mode nil)
'(vc-annotate-color-map
(quote
((20 . "#dc322f")
(40 . "#c37300")
(60 . "#b97d00")
(80 . "#b58900")
(100 . "#a18700")
(120 . "#9b8700")
(140 . "#948700")
(160 . "#8d8700")
(180 . "#859900")
(200 . "#5a942c")
(220 . "#439b43")
(240 . "#2da159")
(260 . "#16a870")
(280 . "#2aa198")
(300 . "#009fa7")
(320 . "#0097b7")
(340 . "#008fc7")
(360 . "#268bd2"))))
'(vc-annotate-very-old-color nil)
'(weechat-color-list
(quote
(unspecified "#002b36" "#073642" "#990A1B" "#dc322f" "#546E00" "#859900" "#7B6000" "#b58900" "#00629D" "#268bd2" "#93115C" "#d33682" "#00736F" "#2aa198" "#839496" "#657b83")))
'(xterm-color-names
["#073642" "#dc322f" "#859900" "#b58900" "#268bd2" "#d33682" "#2aa198" "#eee8d5"])
'(xterm-color-names-bright
["#002b36" "#cb4b16" "#586e75" "#657b83" "#839496" "#6c71c4" "#93a1a1" "#fdf6e3"]))
(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.
)