forked from lowe/dotfiles
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdotemacs
79 lines (60 loc) · 2.25 KB
/
dotemacs
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
;; last updated circa ~2010
;; start with a blank screen
(setq inhibit-startup-message t)
;; never use tabs. always use spaces.
(setq-default indent-tabs-mode nil)
;; 4 spaces on tab
(setq tab-width 4)
(setq default-tab-width 4)
(setq c-indent-level 4)
;; show debugger when an emacs error occurs (probably arising from a .emacs-related bug)
(setq debug-on-error t)
;;; remove trailing whitespace on save.
(add-hook 'before-save-hook 'delete-trailing-whitespace)
;; load .el files from Dropbox
(add-to-list 'load-path (expand-file-name "~/Dropbox/emacs-lisp"))
;; show line numbers
(require 'linum+)
(global-linum-mode 1)
;; at the bottom of the screen, show column number next to current line number
(setq column-number-mode t)
;; show regions selected with the keyboard (using ctrl-space).
(setq transient-mark-mode t)
(set-face-background 'region "#000000") ;; white selection area
;; enable syntax highlighting, with lots of colors
(global-font-lock-mode t)
(setq font-lock-maximum-decoration t)
;; Backspace deletes the selected region
(delete-selection-mode t)
;; Type meta-g to go to a line.
(global-set-key "\M-g" 'goto-line)
;; scss support
(autoload 'scss-mode "scss-mode")
(add-to-list 'auto-mode-alist '("\\.scss\\'" . scss-mode))
(setq scss-compile-at-save nil)
;; pyxl support
;(add-to-list 'load-path "/usr/share/emacs23/site-lisp/python-mode")
;(autoload 'pyxl-mode "pyxl-mode" "Major mode for editing pyxl" t)
;(setq auto-mode-alist
; (cons '( "\\.py\\'" . pyxl-mode ) auto-mode-alist ))
;; coffeescript support
(add-to-list 'auto-mode-alist '("\\.coffee$" . coffee-mode))
(add-to-list 'auto-mode-alist '("Cakefile" . coffee-mode))
(require 'coffee-mode)
(defun coffee-custom ()
"coffee-mode-hook"
;; CoffeeScript uses two spaces.
(make-local-variable 'tab-width)
(set 'tab-width 2)
;; If you don't want your compiled files to be wrapped
(setq coffee-args-compile '("-c" "--bare"))
;; Emacs key binding
;(define-key coffee-mode-map [(meta r)] 'coffee-compile-buffer)
;; Riding edge.
;(setq coffee-command "~/dev/coffee")
;; Compile '.coffee' files on every save
;; (and (file-exists-p (buffer-file-name))
;; (file-exists-p (coffee-compiled-file-name))
;; (coffee-cos-mode t))
)
(add-hook 'coffee-mode-hook 'coffee-custom)