gdritter repos dotfiles / 1735473
Modified names for emacs file type recognition Getty Ritter 9 years ago
4 changed file(s) with 252 addition(s) and 239 deletion(s). Collapse all Expand all
+0
-213
emacs less more
1 ;; basic appearance bits
2
3 (setq initial-scratch-message "")
4 (setq inhibit-startup-message t)
5 (setq inhibit-startup-screen t)
6 (setq-default c-basic-offset 4)
7 (menu-bar-mode 0)
8 (setq column-number-mode t)
9 (setq default-tab-width 4)
10 (setq indent-tabs-mode nil)
11
12 (setq scheme-program-name "guile")
13
14 (if (and (display-graphic-p)
15 (not (getenv "BIG")))
16 (progn
17 (scroll-bar-mode 0)
18 (tool-bar-mode 0)))
19
20
211
22
23 ;; *elpa setup
24 (require 'package)
25 (package-initialize)
26 (add-to-list 'package-archives
27 '("melpa" . "http://melpa.milkbox.net/packages/") t)
28
29 (unless (package-installed-p 'use-package)
30 (package-refresh-contents)
31 (package-install 'use-package))
32 (require 'use-package)
33
34
352
36
37 ;; misc. package setup
38
39 (use-package magit
40 :ensure t)
41
42 (use-package twittering-mode
43 :ensure t
44 :init (setq twittering-use-master-password t))
45
46 ;; for redo syntax highlighting
47 (add-to-list 'auto-mode-alist '("\\.do\\'" . sh-mode))
48
49
503
51
52 ;; tuareg-mode
53
54 (use-package tuareg
55 :ensure t
56 :init
57 (progn
58 (autoload 'tuareg-mode "tuareg-mode"
59 "Major mode for editing Caml or whatever." t)
60 (autoload 'camldebug "camldebug" "Run the Caml debugger" t)
61 (autoload 'tuareg-imenu-set-imenu "tuareg-imenu"
62 "Configuration of imenu for tuareg" t)
63 (add-hook 'tuareg-mode-hook 'tuareg-imenu-set-imenu)
64 (add-to-list 'auto-mode-alist '("\\.ml[ilyp]?\\'" . tuareg-mode))))
65
66
674
68
69 ;; dockerfile mode
70
71 (use-package dockerfile-mode
72 :ensure t
73 :init
74 (progn
75 (add-to-list 'auto-mode-alist '("\\Dockerfile\\'" . dockerfile-mode))))
76
77
785
79
80 ;; rust-mode
81
82 (use-package rust-mode
83 :ensure t
84 :init (add-to-list 'auto-mode-alist '("\\.rs\\'" . rust-mode)))
85
86
876
88
89 ;; various markup/text file modes
90
91 (use-package toml-mode
92 :ensure t
93 :init (add-to-list 'auto-mode-alist '("\\.toml\\'" . toml-mode)))
94
95 (use-package yaml-mode
96 :ensure t
97 :init (add-to-list 'auto-mode-alist '("\.ya?ml\'" . yaml-mode)))
98
99 (use-package markdown-mode
100 :ensure t
101 :init
102 (progn
103 (add-to-list 'auto-mode-alist '("\\.text\\'" . markdown-mode))
104 (add-to-list 'auto-mode-alist '("\\.markdown\\'" . markdown-mode))
105 (add-to-list 'auto-mode-alist '("\\.md\\'" . markdown-mode))))
106
107
1087
109
110 ;; cryptol-mode
111
112 (use-package cryptol-mode
113 :ensure t
114 :init (add-to-list 'auto-mode-alist '("\\.cry\\'" . cryptol-mode)))
115
116
1178
118
119 ;; color things!
120
121 (when (display-graphic-p)
122 (use-package color-theme
123 :ensure t
124 :init
125 (progn
126 (use-package zenburn-theme :ensure t)
127 (use-package solarized-theme :ensure t)
128 (use-package color-theme-sanityinc-tomorrow :ensure t)
129 (color-theme-initialize)
130 (let ((theme (getenv "THEME")))
131 (cond
132 ((string= theme "solarized-dark")
133 (load-theme 'solarized-dark t))
134 ((string= theme "solarized-light")
135 (load-theme 'solarized-light t))
136 ((string= theme "tomorrow")
137 (load-theme 'tomorrow-night t))
138 (t (load-theme 'zenburn t))))))
139 (custom-set-faces
140 '(default
141 ((t (:family "Inconsolata"
142 :foundry "unknown"
143 :slant normal
144 :weight normal
145 :height 98
146 :width normal))))
147 '(tex-verbatim
148 ((t (:family "consolas"))))))
149
150
151
1529
153
154 (use-package whitespace
155 :ensure t
156 :init
157 (progn
158 (setq whitespace-style '(face empty tabs trailing))
159 (global-whitespace-mode t)))
160
161
16210
163
164 ;; haskell-mode
165
166 (use-package haskell-mode
167 :ensure t
168 :init
169 (progn
170 (setq haskell-mode-hook 'turn-on-haskell-simple-indent)
171 (add-to-list 'Info-default-directory-list "/usr/lib/emacs/haskell-mode/")
172 (setq haskell-mode-hook '(turn-on-haskell-indentation))))
173
174
17511
176
177 ;; spacing fixes!
178
179 (defun fix-spacing ()
180 (let ((here (point)))
181 (interactive)
182 (untabify (point-min) (point-max))
183 (replace-regexp "\s*$" "")
184 (goto-char here)
185 (princ "Fixing all spacing...")))
186
187 (setq gdritter/spacing-modes
188 '(c-mode
189 c++-mode
190 asm-mode
191 haskell-mode
192 haskell-cabal-mode
193 emacs-lisp-mode
194 lisp-mode
195 d-mode
196 erlang-mode
197 tuareg-mode))
198
199 (defun fix-spacing-hook ()
200 (when (member major-mode gdritter/spacing-modes)
201 (fix-spacing)))
202
203 (add-hook 'before-save-hook 'fix-spacing-hook)
204
205
20612
207
208 ;; text-fringe-mode (for editing single prose files)
209
210 (define-minor-mode bzg-big-fringe-mode
211 "Minor mode to center text using large fringe"
212 :init-value nil
213 :global t
214 :variable bzg-big-fringe-mode
215 :group 'editing-basics
216 (if (not bzg-big-fringe-mode)
217 (set-fringe-style nil)
218 (progn
219 (set-fringe-mode
220 (/ (- (frame-pixel-width)
221 (* 100 (frame-char-width)))
222 2))
223 (mapcar (lambda (fb) (set-fringe-bitmap-face fb 'org-hide))
224 fringe-bitmaps))))
225
1 ;; basic appearance bits
2
3 (setq initial-scratch-message "")
4 (setq inhibit-startup-message t)
5 (setq inhibit-startup-screen t)
6 (setq-default c-basic-offset 4)
7 (menu-bar-mode 0)
8 (setq column-number-mode t)
9 (setq default-tab-width 4)
10 (setq indent-tabs-mode nil)
11
12 (setq scheme-program-name "guile")
13
14 (if (and (display-graphic-p)
15 (not (getenv "BIG")))
16 (progn
17 (scroll-bar-mode 0)
18 (tool-bar-mode 0)))
19
20
121
22
23 ;; *elpa setup
24 (require 'package)
25 (package-initialize)
26 (add-to-list 'package-archives
27 '("melpa" . "http://melpa.milkbox.net/packages/") t)
28
29 (unless (package-installed-p 'use-package)
30 (package-refresh-contents)
31 (package-install 'use-package))
32 (require 'use-package)
33
34
235
36
37 ;; misc. package setup
38
39 (use-package magit
40 :ensure t)
41
42 (use-package twittering-mode
43 :ensure t
44 :init (setq twittering-use-master-password t))
45
46 ;; for redo syntax highlighting
47 (add-to-list 'auto-mode-alist '("\\.do\\'" . sh-mode))
48
49
350
51
52 ;; tuareg-mode
53
54 (use-package tuareg
55 :ensure t
56 :init
57 (progn
58 (autoload 'tuareg-mode "tuareg-mode"
59 "Major mode for editing Caml or whatever." t)
60 (autoload 'camldebug "camldebug" "Run the Caml debugger" t)
61 (autoload 'tuareg-imenu-set-imenu "tuareg-imenu"
62 "Configuration of imenu for tuareg" t)
63 (add-hook 'tuareg-mode-hook 'tuareg-imenu-set-imenu)
64 (add-to-list 'auto-mode-alist '("\\.ml[ilyp]?\\'" . tuareg-mode))))
65
66
467
68
69 ;; dockerfile mode
70
71 (use-package dockerfile-mode
72 :ensure t
73 :init
74 (progn
75 (add-to-list 'auto-mode-alist '("\\Dockerfile\\'" . dockerfile-mode))))
76
77
578
79
80 ;; rust-mode
81
82 (use-package rust-mode
83 :ensure t
84 :init (add-to-list 'auto-mode-alist '("\\.rs\\'" . rust-mode)))
85
86
687
88
89 ;; various markup/text file modes
90
91 (use-package toml-mode
92 :ensure t
93 :init (add-to-list 'auto-mode-alist '("\\.toml\\'" . toml-mode)))
94
95 (use-package yaml-mode
96 :ensure t
97 :init (add-to-list 'auto-mode-alist '("\.ya?ml\'" . yaml-mode)))
98
99 (use-package markdown-mode
100 :ensure t
101 :init
102 (progn
103 (add-to-list 'auto-mode-alist '("\\.text\\'" . markdown-mode))
104 (add-to-list 'auto-mode-alist '("\\.markdown\\'" . markdown-mode))
105 (add-to-list 'auto-mode-alist '("\\.md\\'" . markdown-mode))))
106
107 (use-package pandoc-mode
108 :ensure t
109 :config (add-hook 'markdown-mode-hook 'pandoc-mode))
110
111
7112
113
114 ;; cryptol-mode
115
116 (use-package cryptol-mode
117 :ensure t
118 :init (add-to-list 'auto-mode-alist '("\\.cry\\'" . cryptol-mode)))
119
120
8121
122
123 (use-package helm
124 :ensure t
125 :diminish helm-mode
126 :defines (helm-apropos-fuzzy-match
127 helm-completion-mode-string
128 helm-ff-file-name-history-use-recentf)
129 :commands (helm-mode))
130
131
9132
133
134 ;; color things!
135
136 (when (display-graphic-p)
137 (use-package color-theme
138 :ensure t
139 :init
140 (progn
141 (use-package zenburn-theme :ensure t)
142 (use-package solarized-theme :ensure t)
143 (use-package color-theme-sanityinc-tomorrow :ensure t)
144 (color-theme-initialize)
145 (let ((theme (getenv "THEME")))
146 (cond
147 ((string= theme "solarized-dark")
148 (load-theme 'solarized-dark t))
149 ((string= theme "solarized-light")
150 (load-theme 'solarized-light t))
151 ((string= theme "tomorrow")
152 (load-theme 'tomorrow-night t))
153 (t (load-theme 'zenburn t))))))
154 (custom-set-faces
155 '(default
156 ((t (:family "Inconsolata"
157 :foundry "unknown"
158 :slant normal
159 :weight normal
160 :height 98
161 :width normal))))
162 '(tex-verbatim
163 ((t (:family "consolas"))))))
164
165
166
10167
168
169 (use-package whitespace
170 :ensure t
171 :init
172 (progn
173 (setq whitespace-style '(face empty tabs trailing))
174 (global-whitespace-mode t)))
175
176
11177
178
179 ;; haskell-mode
180
181 (use-package haskell-mode
182 :ensure t
183 :init
184 (progn
185 (setq haskell-mode-hook 'turn-on-haskell-simple-indent)
186 (add-to-list 'Info-default-directory-list "/usr/lib/emacs/haskell-mode/")
187 (setq haskell-mode-hook '(turn-on-haskell-indentation))))
188
189
12190
191
192 ;; spacing fixes!
193
194 (defun fix-spacing ()
195 (let ((here (point)))
196 (interactive)
197 (untabify (point-min) (point-max))
198 (replace-regexp "\s*$" "")
199 (goto-char here)
200 (princ "Fixing all spacing...")))
201
202 (setq gdritter/spacing-modes
203 '(c-mode
204 c++-mode
205 asm-mode
206 haskell-mode
207 haskell-cabal-mode
208 emacs-lisp-mode
209 lisp-mode
210 d-mode
211 erlang-mode
212 tuareg-mode))
213
214 (defun fix-spacing-hook ()
215 (when (member major-mode gdritter/spacing-modes)
216 (fix-spacing)))
217
218 (add-hook 'before-save-hook 'fix-spacing-hook)
219
220
13221
222
223 ;; text-fringe-mode (for editing single prose files)
224
225 (define-minor-mode bzg-big-fringe-mode
226 "Minor mode to center text using large fringe"
227 :init-value nil
228 :global t
229 :variable bzg-big-fringe-mode
230 :group 'editing-basics
231 (if (not bzg-big-fringe-mode)
232 (set-fringe-style nil)
233 (progn
234 (set-fringe-mode
235 (/ (- (frame-pixel-width)
236 (* 100 (frame-char-width)))
237 2))
238 (mapcar (lambda (fb) (set-fringe-bitmap-face fb 'org-hide))
239 fringe-bitmaps))))
+0
-26
generalrc less more
1 # .bashrc
2
3 # User specific aliases and functions
4 alias cl=clear
5 alias la='ls -a'
6 alias ll='ls -l'
7 alias lpdup='lpr -o sides=two-sided-long-edge -P hp4200n'
8 alias iks='ssh ikshvaku'
9 alias ros='ssh rosencrantz'
10 alias guil='ssh guildenstern'
11 alias iks-elinks='ssh ikshvaku -t "bash -c \". .bashrc && elinks\""'
12 alias iks-finch='ssh ikshvaku -t "bash -c \". .bashrc && finch\""'
13 alias iks-irssi='ssh ikshvaku -t "bash -c \". .bashrc && irssi\""'
14 alias iks-ncmpc='ssh ikshvaku -t "bash -c \". .bashrc && ncmpc\""'
15 alias evil='EVIL=true emacs'
16 alias evilmacs='EVIL=true emacs'
17 alias bigmacs='BIG=true emacs'
18 alias textmacs='NARROW=true emacs'
19 alias em='EVIL=true BARE=true emacs'
20 alias objdump='objdump -M intel'
21 alias pr-paper='lpr -P hp4200n -o number-up=2 -o sides=two-sided-long-edge'
22 alias bigterm='urxvt -fn "xft:Inconsolata:pixelsize=24"'
23 alias hex2raw="tr -d '\\\x' | xxd -r -p"
24
25 export EDITOR="emacs -nw"
26 export BASHFILESIZE=50000
1 # .bashrc
2
3 # User specific aliases and functions
4 alias cl=clear
5 alias la='ls -a'
6 alias ll='ls -l'
7 alias lpdup='lpr -o sides=two-sided-long-edge -P hp4200n'
8 alias iks='ssh ikshvaku'
9 alias ros='ssh rosencrantz'
10 alias guil='ssh guildenstern'
11 alias iks-elinks='ssh ikshvaku -t "bash -c \". .bashrc && elinks\""'
12 alias iks-finch='ssh ikshvaku -t "bash -c \". .bashrc && finch\""'
13 alias iks-irssi='ssh ikshvaku -t "bash -c \". .bashrc && irssi\""'
14 alias iks-ncmpc='ssh ikshvaku -t "bash -c \". .bashrc && ncmpc\""'
15 alias evil='EVIL=true emacs'
16 alias evilmacs='EVIL=true emacs'
17 alias bigmacs='BIG=true emacs'
18 alias textmacs='NARROW=true emacs'
19 alias em='EVIL=true BARE=true emacs'
20 alias objdump='objdump -M intel'
21 alias pr-paper='lpr -P hp4200n -o number-up=2 -o sides=two-sided-long-edge'
22 alias bigterm='urxvt -fn "xft:Inconsolata:pixelsize=24"'
23 alias hex2raw="tr -d '\\\x' | xxd -r -p"
24
25 export EDITOR="emacs -nw"
26 export BASHFILESIZE=50000