-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathdot-emacs
177 lines (138 loc) · 5.79 KB
/
dot-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
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
;; A lighter-weight init.el for 24
(require 'package)
(add-to-list 'package-archives
'("marmalade" . "https://marmalade-repo.org/packages/"))
(package-initialize)
(when (null package-archive-contents)
(package-refresh-contents))
(defvar my-packages '(better-defaults
idle-highlight-mode
elisp-slime-nav paredit
smex scpaste parenface-plus
find-file-in-project magit
ido-ubiquitous clojure-mode
cider))
(dolist (p my-packages)
(when (not (package-installed-p p))
(package-install p)))
(setq-default ispell-program-name "aspell")
(set-face-foreground 'vertical-border "white")
;; this looks gross in low-color mode
(when (<= (display-color-cells) 8)
(defun hl-line-mode () (interactive)))
;;; erc? why not
(setq erc-prompt ">"
erc-fill-column 75
erc-header-line-format nil
erc-hide-list '("JOIN" "PART" "QUIT" "NICK")
erc-track-exclude-types '("324" "329" "332" "333" "353" "477" "MODE"
"JOIN" "PART" "QUIT" "NICK")
erc-lurker-threshold-time 3600
erc-track-priority-faces-only t
erc-join-buffer 'bury
erc-autojoin-timing :ident
erc-flood-protect nil
erc-server-send-ping-interval 45
erc-server-send-ping-timeout 180
erc-server-reconnect-timeout 60
erc-autojoin-channels-alist
'(("freenode.net" "#emacs" "#clojure" "#leiningen" "#seajure"))
erc-prompt-for-nickserv-password nil)
(eval-after-load 'erc
'(progn
(when (not (package-installed-p 'erc-hl-nicks))
(package-install 'erc-hl-nicks))
(require 'erc-spelling)
(require 'erc-services)
(require 'erc-truncate)
(require 'erc-hl-nicks)
(require 'notifications)
(erc-services-mode 1)
(erc-truncate-mode 1)
(setq erc-complete-functions '(erc-pcomplete erc-button-next))
(setq-default erc-ignore-list '("Lajla"))
(add-to-list 'erc-modules 'hl-nicks)
(add-to-list 'erc-modules 'spelling)
(define-key erc-mode-map (kbd "C-c r") 'pnh-reset-erc-track-mode)
(set-face-foreground 'erc-input-face "dim gray")
(set-face-foreground 'erc-my-nick-face "blue")))
(defun pnh-reset-erc-track-mode ()
(interactive)
(setq erc-modified-channels-alist nil)
(erc-modified-channels-update)
(erc-modified-channels-display))
;;; bindings
(global-set-key (kbd "C-c C-j") 'cider-jack-in)
(global-set-key (kbd "C-c f") 'find-file-in-project)
(add-hook 'prog-mode-hook
(defun my-kill-word-key ()
(local-set-key (kbd "C-M-h") 'backward-kill-word)))
(global-set-key (kbd "C-M-h") 'backward-kill-word)
(global-set-key (kbd "C-x C-i") 'imenu)
(global-set-key (kbd "C-x M-f") 'ido-find-file-other-window)
(global-set-key (kbd "C-c y") 'bury-buffer)
(global-set-key (kbd "C-c r") 'revert-buffer)
(global-set-key (kbd "C-x O") (lambda () (interactive) (other-window -1)))
(global-set-key (kbd "C-x C-o") (lambda () (interactive) (other-window 2)))
(global-set-key (kbd "C-x m") 'eshell)
(global-set-key (kbd "C-x C-m") 'shell)
(global-set-key (kbd "C-c q") 'join-line)
(global-set-key (kbd "C-c g") 'magit-status)
(global-set-key (kbd "C-c n")
(defun pnh-cleanup-buffer () (interactive)
(delete-trailing-whitespace)
(untabify (point-min) (point-max))
(indent-region (point-min) (point-max))))
;; atreus bindings
(global-set-key (kbd "C-x '") 'delete-other-windows)
(global-set-key (kbd "C-x ,") 'split-window-below)
(global-set-key (kbd "C-x .") 'split-window-right)
(global-set-key (kbd "C-x l") 'delete-window)
(eval-after-load 'paredit
;; need a binding that works in the terminal
'(progn
(define-key paredit-mode-map (kbd "M-)") 'paredit-forward-slurp-sexp)
(define-key paredit-mode-map (kbd "M-(") 'paredit-backward-slurp-sexp)))
;;; eshell
(defun eshell/rgrep (&rest args)
"Use Emacs grep facility instead of calling external grep."
(eshell-grep "rgrep" args t))
(defun eshell/cdg ()
"Change directory to the project's root."
(eshell/cd (locate-dominating-file default-directory ".git")))
;;; programming
;; (add-hook 'prog-mode-hook 'whitespace-mode)
(add-hook 'prog-mode-hook 'idle-highlight-mode)
(add-hook 'prog-mode-hook 'hl-line-mode)
(eval-after-load 'clojure-mode
'(progn
(define-key clojure-mode-map (kbd "RET") 'paredit-newline)))
(add-hook 'clojure-mode-hook 'paredit-mode)
(setq whitespace-style '(face trailing lines-tail tabs))
(add-hook 'emacs-lisp-mode-hook 'turn-on-eldoc-mode)
(add-hook 'emacs-lisp-mode-hook 'elisp-slime-nav-mode)
(add-hook 'emacs-lisp-mode-hook 'paredit-mode)
(define-key emacs-lisp-mode-map (kbd "C-c v") 'eval-buffer)
(define-key read-expression-map (kbd "TAB") 'lisp-complete-symbol)
(define-key lisp-mode-shared-map (kbd "RET") 'reindent-then-newline-and-indent)
;;; other
(defun disapproval () (interactive) (insert "ಠ_ಠ"))
(defun eyeroll () (interactive) (insert "◔_◔"))
(defun tables () (interactive) (insert "(╯°□°)╯︵ ┻━┻"))
(defun mu () (interactive) (insert "無"))
(defun rectification () (interactive) (insert "正名"))
(defun caruso () (interactive) (insert "( •_•) ( -_-)~⌐■-■ (⌐■_■)>"))
(winner-mode)
(global-set-key (kbd "C-c w") 'winner-undo)
(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-enabled-themes (quote (dichromacy))))
(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.
)