-
Notifications
You must be signed in to change notification settings - Fork 0
/
.emacs
123 lines (99 loc) · 3.65 KB
/
.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
;; emacs, please
;; ELPA -- http://tromey.com/elpa/
(when
(load
(expand-file-name "~/.emacs.d/elpa/package.el"))
(package-initialize)
;; init marmalade repo
(add-to-list 'package-archives '("marmalade" . "http://marmalade-repo.org/packages/")))
;; fix []{} etc...
(setq mac-option-modifier 'none)
;; cmd should act as meta, not as super
(setq mac-command-modifier 'meta)
;; Deva-Vu Sans Mono
(custom-set-faces
'(default ((t (:inherit nil :stipple nil :background "white" :foreground "black"
:inverse-video nil :box nil :strike-through nil
:overline nil :underline nil :slant normal :weight normal
:height 120 :width normal :foundry "unknown"
:family "DejaVu Sans Mono")))))
;; Remove annoying starup screen
(custom-set-variables '(inhibit-startup-screen t))
;; Clean up interface
(tool-bar-mode nil)
;(menu-bar-mode nil)
(scroll-bar-mode nil)
;; prevent paranoid autosave files
(setq make-backup-files nil)
(setq auto-save nil)
(setq delete-auto-save-files t)
;; do not store auto save files in current dir
(setq backup-directory-alist
`((".*" . ,temporary-file-directory)))
(setq auto-save-file-name-transforms
`((".*" ,temporary-file-directory t)))
;; keep private installation of color-theme...
;; http://www.nongnu.org/color-theme/
(add-to-list 'load-path "~/.emacs.d/packages/color-theme-6.6.0")
(require 'color-theme)
(eval-after-load "color-theme"
'(progn
(color-theme-initialize)
(color-theme-charcoal-black)))
(defun coffee-custom ()
"coffee-mode-hook"
(set (make-local-variable 'tab-width) 2))
(add-hook 'coffee-mode-hook
'(lambda() (coffee-custom)))
;; major modes for jade and stylus
(add-to-list 'load-path "~/.emacs.d/packages/jade-mode")
(require 'sws-mode)
(require 'jade-mode)
(add-to-list 'auto-mode-alist '("\\.styl$" . sws-mode))
(add-to-list 'auto-mode-alist '("\\.jade$" . jade-mode))
;; apache-mode, for editing apache configuration files
(add-to-list 'load-path "~/.emacs.d/packages/apache-mode")
(require 'apache-mode)
(add-to-list 'auto-mode-alist '("\\.htaccess\\'" . apache-mode))
(add-to-list 'auto-mode-alist '("httpd\\.conf\\'" . apache-mode))
(add-to-list 'auto-mode-alist '("srm\\.conf\\'" . apache-mode))
(add-to-list 'auto-mode-alist '("access\\.conf\\'" . apache-mode))
(add-to-list 'auto-mode-alist '("sites-\\(available\\|enabled\\)/" . apache-mode))
;; nginx-mode, for editing nginx config files
(add-to-list 'load-path "~/.emacs.d/packages/nginx-mode")
(require 'nginx-mode)
;; scrolling behavior
(setq scroll-margin 5)
(setq scroll-conservatively 5)
;; please show me my marked region
(setq transient-mark-mode t)
(custom-set-variables
;; don't wrap lines, truncate
'(truncate-lines t)
;; kill newline as well when killing
'(kill-whole-line t)
;; show column numbers
'(column-number-mode t)
;; indent with spaces, not tabs
'(indent-tabs-mode nil)
;; show annoying trailing whitespace
'(show-trailing-whitespace t)
;; show annoying empty lines
'(indicate-empty-lines t))
;; editing, require final newline
(setq require-final-newline t)
;; indent using spaces, i think it's for the best (for now)
(setq indent-tabs-mode nil)
;; show bash colors when running a shell inside emacs
(add-hook 'shell-mode-hook 'ansi-color-for-comint-mode-on)
;; move between windows
(defun select-next-window ()
"Switch to the next window"
(interactive)
(select-window (next-window)))
(defun select-previous-window ()
"Switch to the previous window"
(interactive)
(select-window (previous-window)))
(global-set-key (kbd "M-<right>") 'select-next-window)
(global-set-key (kbd "M-<left>") 'select-previous-window)