-
Notifications
You must be signed in to change notification settings - Fork 15
/
emacs.el
129 lines (96 loc) · 3.88 KB
/
emacs.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
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
124
125
126
127
128
129
(put 'set-goal-column 'disabled nil)
(set-keyboard-coding-system 'mac-roman)
(setq mac-option-modifier 'meta)
(put 'downcase-region 'disabled nil)
(global-set-key (kbd "C-x C-n") 'other-window)
(global-set-key (kbd "C-x C-p") 'other-window-backward)
(global-set-key "\C-cl" 'org-store-link)
(global-set-key "\C-cc" 'org-capture)
(global-set-key "\C-ca" 'org-agenda)
(global-set-key "\C-cb" 'org-iswitchb)
(global-set-key (kbd "<f5>") 'lusty-file-explorer)
(global-set-key (kbd "<f6>") 'lusty-buffer-explorer)
(tabbar-mode 0)
(global-set-key (kbd "C-x C-b") 'ibuffer-list-buffers)
(global-set-key (kbd "<f8>") 'bookmark-jump)
(global-set-key (kbd "<f7>") 'bookmark-set)
(add-to-list 'load-path "~/.emacs.d/color-theme")
(require 'color-theme)
(color-theme-initialize)
;(color-theme-arjen)
;(color-theme-charcoal-black)
;(color-theme-billw)
(color-theme-clarity)
;(color-theme-calm-forest)
;(color-theme-lethe)
(setq org-mobile-directory "~/Dropbox/MobileOrg")
(setq org-directory "~/work/ppap/Notes,_Minutes,_Ideas,_Outlines/outlines")
(setq org-mobile-inbox-for-pull "~/Dropbox/MobileOrg")
(defun clean-code nil "Clean up code listings for XML embedation"
(interactive)
(query-replace "<" "lt;")
(query-replace ">" "gt;")
(query-replace "&" "&"))
(defun other-window-backward (&optional n)
"Select the previous window."
(interactive "P")
(other-window (- (prefix-numeric-value n))))
(defun word-count nil "Count words in buffer" (interactive)
(shell-command-on-region (point-min) (point-max) "wc -w"))
(defun wrap-tag-lines (b e tag)
"'tag' every line in the region with a tag"
(interactive "r\nMTag for line: ")
(save-restriction
(narrow-to-region b e)
(save-excursion
(goto-char (point-min))
(while (< (point) (point-max))
(beginning-of-line)
(insert (format "<%s>" tag))
(end-of-line)
(insert (format "</%s>" tag))
(forward-line 1)))))
(setenv "MITSCHEME_LIBRARY_PATH" "/Applications/mit-scheme.app/Contents/Resources")
(add-to-list 'load-path "~/.emacs.d/scala")
(require 'scala-mode-auto)
(autoload 'groovy-mode "groovy-mode" "Groovy editing mode." t)
(add-to-list 'auto-mode-alist '("\.groovy$" . groovy-mode))
(add-to-list 'interpreter-mode-alist '("groovy" . groovy-mode))
(defvar lib-dir "/Users/nford/bin/")
(setenv "GROOVY_HOME" (concat lib-dir "groovy-1.7.10"))
(setenv "PATH" (concat (getenv "PATH")
":" (getenv "GROOVY_HOME") "/bin"))
(setenv "PATH" (concat (getenv "PATH") ":" lib-dir "markdown/markdown"))
(autoload 'docbook-xml-mode "docbook-xml-mode" "Major mode for
Docbook" t)
(require 'flyspell)
(autoload 'flyspell-mode "flyspell" "On-the-fly spelling checker." t)
(setq-default flyspell-mode t)
;; auto-load for flyspell mode
(dolist (hook '(markdown-mode-hook))
(add-hook hook (lambda () (flyspell-mode 1))))
(autoload 'flyspell-mode "flyspell" "On-the-fly spelling checker." t)
(setq-default flyspell-mode t)
(dolist (hook '(markdown-mode-hook))
(add-hook hook (lambda () (flyspell-mode 1))))
;; killer flyspell-check-previous-highlighted-word keybinding
(global-set-key (kbd "C-c j") 'flyspell-check-previous-highlighted-word)
(require 'ido)
(ido-mode t)
(setq ido-enable-flex-matching t)
(require 'yasnippet) ;; not yasnippet-bundle
(yas/initialize)
(yas/load-directory "~/.emacs.d/plugins/yasnippet/snippets")
;; reset some keys to help recursive expansion
(define-key yas/keymap [tab] 'yas/expand)
(autoload 'word-count-mode "word-count"
"Minor mode to count words." t nil)
(global-set-key "\M-+" 'word-count-mode)
(require 'emacsd-tile)
(autoload 'markdown-mode "markdown-mode.el"
"Major mode for editing Markdown files" t)
(setq auto-mode-alist
(cons '("\\.md" . markdown-mode) auto-mode-alist))
(setq auto-mode-alist (cons '("\\.html?$" . html-mode) auto-mode-alist))
(add-to-list 'auto-mode-alist '("Rakefile$" . ruby-mode))
(add-to-list 'auto-mode-alist '("\\.rake$" . ruby-mode))