-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathinit-text.el
75 lines (54 loc) · 1.82 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
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
;;; init-text.el --- Basic text editing features
;; No tabs, please
(set-default 'indent-tabs-mode nil)
;; Transparently open compressed files
(auto-compression-mode t)
;; Kill the whole line
(setq kill-whole-line t)
;; Show column numbers
(column-number-mode t)
;; Delete the region
(delete-selection-mode t)
;; Snippets
(require 'yasnippet)
(yas/initialize)
(yas/load-directory (concat dotfiles-dir "/vendor/yasnippet/snippets"))
;; Whitespace mode
(require 'whitespace)
(setq whitespace-line-column 100)
(setq whitespace-style '(trailing
lines
space-before-tab
indentation
space-after-tab))
;; Text mode
(defun text-hook ()
(lambda ()
(auto-fill-mode)
(flyspell-mode)))
(add-hook 'text-mode-hook 'text-hook)
;; Markdown mode
(autoload 'markdown-mode "markdown-mode.el"
"Major mode for editing Markdown files" t)
(add-to-list 'auto-mode-alist '("\\.markdown$" . markdown-mode))
(add-to-list 'auto-mode-alist '("\\.mdown$" . markdown-mode))
(add-to-list 'auto-mode-alist '("\\.md$" . markdown-mode))
(add-hook 'markdown-mode-hook 'text-hook)
;; Textile mode
(autoload 'textile-mode "textile-mode.el"
"Major mode for editing Textile files" t)
(add-to-list 'auto-mode-alist '("\\.textile$" . textile-mode))
(add-hook 'textile-mode-hook 'text-hook)
;; nxhtml stuff
;; this must be loaded before ELPA since it bundles its own
;; out-of-date js stuff. TODO: fix it to use ELPA dependencies
(load "vendor/nxhtml/autostart")
(setq mumamo-chunk-coloring 'submode-colored
nxhtml-skip-welcome t
indent-region-mode t
rng-nxml-auto-validate-flag nil)
(add-to-list 'auto-mode-alist '("\\.xml$" . nxml-mode))
;; CSS
(add-to-list 'auto-mode-alist '("\\.css$" . css-mode))
(provide 'init-text)
;;; init-text.el ends here