-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.emacs
108 lines (87 loc) · 3.34 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
;; EGG for Git.
(add-to-list 'load-path "~/bin/emacs-extras/")
;; Lots of color
(setq font-lock-maximum-decoration t)
;; Don't show git status on every save.
;;(require 'egg)
;;(setq egg-auto-update nil)
;; Whitespace
(setq whitespace-style '(space-after-tab space-before-tab tab-mark space-mark trailing))
; Reconfigure whitespace-mode for day-to-day use
(require 'whitespace)
(setq whitespace-style '(face tabs space-before-tab tab-mark))
(global-whitespace-mode t)
;; Edit templates as HTML
(setq auto-mode-alist (cons '("\\.tmpl$" . html-mode) auto-mode-alist))
;;python-mode should conform to stuff
(add-hook 'python-mode-hook
(lambda()
(setq python-indent 4)
(setq c-basic-offset 4)
(setq tab-width 4)
(setq py-indent-offset 4)
(setq indent-tabs-mode t)
(setq py-smart-indentation t)))
;;html-mode should conform to stuff
(add-hook 'html-mode-hook
(lambda()
(setq tab-width 4)
(setq sgml-basic-offset 4)
(setq indent-tabs-mode t)))
;;java-mode should conform to stuff
(add-hook 'java-mode-hook
(lambda()
(setq tab-width 4)
(setq sgml-basic-offset 4)
(setq indent-tabs-mode t)))
;; ctrl+tab inserts a hard tab. w00t. (courtesy of duncan).
;;(global-set-key [C-TAB] (lambda () (interactive) (insert-char 9 1) ))
(global-set-key [?\C-\t] (lambda () (interactive) (insert-char 9 1) ))
;; Usage: emacs -diff file1 file2
(defun command-line-diff (switch)
(let ((file1 (pop command-line-args-left))
(file2 (pop command-line-args-left)))
(ediff file1 file2)))
(add-to-list 'command-switch-alist '("diff" . command-line-diff))
;; No splashscreen.
(setq inhibit-splash-screen t)
;; Clean up whitespace.
(add-hook 'before-save-hook 'delete-trailing-whitespace)
;; Make Sumeet happy by not including spaces.
;;
;; enhancements for displaying flymake errors
(require 'flymake)
(require 'flymake-cursor)
;; Pyflakes using Flymake?
(when (load "flymake" t)
(defun flymake-pyflakes-init ()
(let* ((temp-file (flymake-init-create-temp-buffer-copy
'flymake-create-temp-inplace))
(local-file (file-relative-name
temp-file
(file-name-directory buffer-file-name))))
(list "pyflakes" (list local-file))))
(add-to-list 'flymake-allowed-file-name-masks
'("\\.py\\'" flymake-pyflakes-init)))
(add-hook 'find-file-hook 'flymake-find-file-hook)
(define-derived-mode cheetah-mode html-mode "cheetah"
(make-face 'cheetah-variable-face)
(font-lock-add-keywords
nil
'(
("\\(#\\(from\\|else\\|include\\|extends\\|set\\|def\\|import\\|for\\|if\\|end\\|elif\\|call\\|block\\|attr\\|silent\\|echo\\|return\\)+\\)\\>" 1 font-lock-type-face)
("\\(#\\(from\\|for\\|end\\|else\\)\\).* \\<\\(for\\|import\\|def\\|if\\|in\\|block\\|call\\)\\>" 3 font-lock-type-face)
("\\(##.*\\)\n" 1 font-lock-comment-face)
("\\(\\$\\(?:\\sw\\|}\\|{\\|\\s_\\)+\\)" 1 font-lock-variable-name-face))
)
(font-lock-mode 1)
)
(define-derived-mode cheetah-css-mode css-mode "cheetah-css"
(make-face 'cheetah-css-variable-face)
(font-lock-add-keywords
nil
'(("\\(##.*\\)\n" font-lock-comment-face)) (font-lock-mode 1))
(modify-syntax-entry ?# "' 12b" cheetah-css-mode-syntax-table)
(modify-syntax-entry ?\n "> b" cheetah-css-mode-syntax-table))
(setq auto-mode-alist (cons '( "\\.tmpl\\'" . cheetah-mode ) auto-mode-alist ))
(setq auto-mode-alist (cons '( "\\.css.tmpl\\'" . cheetah-css-mode ) auto-mode-alist ))