-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathanagrius-prog.el
65 lines (37 loc) · 1.79 KB
/
anagrius-prog.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
(require 'highlight-symbol)
(setq-default indent-tabs-mode nil)
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Highlight Symbols ;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(require 'highlight-symbol)
(add-hook 'prog-mode-hook 'highlight-symbol-mode)
(setq highlight-symbol-idle-delay 0.2)
(setq highlight-symbol-on-navigation-p nil)
(global-set-key [f3] 'highlight-symbol-next)
(global-set-key [(shift f3)] 'highlight-symbol-prev)
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Keybindingins ;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Indent using RET (instead of just newline).
(add-hook 'prog-mode-hook
'(lambda () (local-set-key (kbd "RET") 'newline-and-indent)))
(global-set-key (kbd "s-r") 'replace-regexp)
(global-set-key (kbd "s-f") 'isearch-forward)
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Whitespace ;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Delete Whitespace on save.
;; TODO: Look into more leient alternative that only,
;; delete if it way already clean when the file was loaded.
(add-hook 'before-save-hook 'delete-trailing-whitespace)
;; Delete white space with ease M-SPC and M-S-SPC.
(defun pancake-delete-whitespace-except-one ()
(interactive)
(just-one-space -1))
(global-set-key (kbd "M-SPC") 'pancake-delete-whitespace-except-one)
(defun pancake-delete-whitespace ()
(interactive)
(just-one-space -1)
(delete-backward-char 1))
(global-set-key (kbd "M-S-SPC") 'pancake-delete-whitespace)
(provide 'anagrius-prog)