-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsample.emacs
70 lines (57 loc) · 2.11 KB
/
sample.emacs
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
;========================================================
; general
; on close, save open buffers for next time
(desktop-save-mode 1)
;========================================================
; Python mode
; use spaces
(add-hook 'python-mode-hook
(lambda ()
(setq indent-tabs-mode nil
tab-width 4
python-guess-indent nil
python-indent 4)))
;========================================================
; spell checking
; use hunspell for spell checking
(when (executable-find "hunspell")
(setq-default ispell-program-name "hunspell")
(setq ispell-really-hunspell t))
; enable spell checking on the fly for text files only
(setq-default flyspell-mode nil)
(dolist (hook '(text-mode-hook))
(add-hook hook (lambda () (flyspell-mode 1))))
; enable spell checking on the fly in comments
(dolist (mode '(emacs-lisp-mode-hook
python-mode-hook
js-mode-hook
R-mode-hook))
(add-hook mode
'(lambda ()
(flyspell-prog-mode))))
; check the whole buffer when flyspell-mode is started
(add-hook 'flyspell-mode-hook 'flyspell-buffer)
;========================================================
; yaml mode
(add-to-list 'load-path (concat (getenv "GITHUB") "/yaml-mode"))
(require 'yaml-mode)
(add-to-list 'auto-mode-alist '("*.yml" . yaml-mode))
;========================================================
; Dockerfile mode
(add-to-list 'load-path (concat (getenv "GITHUB") "/dockerfile-mode"))
(require 'dockerfile-mode)
(add-to-list 'auto-mode-alist '("Dockerfile\\'" . dockerfile-mode))
;========================================================
; Snakemake mode
(add-to-list 'load-path (concat (getenv "GITHUB") "/snakemake-mode"))
(require 'snakemake-mode)
;========================================================
; Org mode
;; The following lines are always needed. Choose your own keys.
(global-set-key "\C-cl" 'org-store-link)
(global-set-key "\C-ca" 'org-agenda)
(global-set-key "\C-cc" 'org-capture)
(global-set-key "\C-cb" 'org-iswitchb)
;========================================================
; Shell mode
(add-hook 'comint-output-filter-functions 'comint-strip-ctrl-m)