-
Notifications
You must be signed in to change notification settings - Fork 0
/
init-text.el
41 lines (33 loc) · 1.17 KB
/
init-text.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
;; Text and spelling.
(setq default-major-mode 'text-mode)
(setq ispell-program-name "aspell")
(ispell-change-dictionary "american" t)
(add-hook 'text-mode-hook 'flyspell-mode 1)
(add-hook 'python-mode-hook 'flyspell-prog-mode 1)
(set-face-attribute 'default nil :height 110)
(setq-default show-trailing-whitespace t)
(add-hook 'before-save-hook 'whitespace-cleanup)
(require 'paren)
(setq show-paren-style 'parenthesis)
(show-paren-mode +1)
(add-hook 'prog-mode-hook '(lambda () (local-set-key "\r" 'newline-and-indent)))
(setq whitespace-line-column 100)
(setq whitespace-style '(face lines-tail))
(add-hook 'prog-mode-hook 'whitespace-mode)
(which-function-mode)
(setq which-func-unknown "n/a")
(defun smarter-move-beginning-of-line (arg)
(interactive "^p")
(setq arg (or arg 1))
;; Move lines first
(when (/= arg 1)
(let ((line-move-visual nil))
(forward-line (1- arg))))
(let ((orig-point (point)))
(back-to-indentation)
(when (= orig-point (point))
(move-beginning-of-line 1))))
;; remap C-a to `smarter-move-beginning-of-line'
(global-set-key [remap move-beginning-of-line]
'smarter-move-beginning-of-line)
(provide 'init-text)