-
Notifications
You must be signed in to change notification settings - Fork 1
/
.emacs
227 lines (187 loc) · 9.35 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
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
;;;;;;;;;;
; Header ;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; ben.abernathy's .emacs ;
; ;
; My living, breathing .emacs ;
; Perfection is an elusive, mythical creature that I have yet to catch. ;
; ;
; A word on formatting. Each section has a short description of what kind of ;
; information is contained therein. By convention a line of comments should ;
; not exceed col 79. ;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;
; License ;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; Copyright 2021 Benjamin Abernathy ;
; ;
; Licensed under the Apache License, Version 2.0 (the "License"); ;
; you may not use this file except in compliance with the License. ;
; You may obtain a copy of the License at ;
; ;
; http://www.apache.org/licenses/LICENSE-2.0 ;
; ;
; Unless required by applicable law or agreed to in writing, software ;
; distributed under the License is distributed on an "AS IS" BASIS, ;
; WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. ;
; See the License for the specific language governing permissions and ;
; limitations under the License. ;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;
; Change Log ;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; ;
; Mon, Jul 19 2021 21:25 ;
; Long awaited update to support Emacs 26+ ;
; Removed table.el, color-theme, svn, and git. Most were replaced ;
; with either built-ins or equivalent features. Markdown is broken. ;
; ;
; ---------------------------------------------------------------------------- ;
; ;
; Fri, Nov 15 2013 13:11 ;
; Cleanup, added nav and enabled semantic. ;
; ;
; ---------------------------------------------------------------------------- ;
; ;
; Mon, Jun 17 2013 20:46 ;
; Added markdown-mode, migrated fuctions to myfuncs.el ;
; ;
; ---------------------------------------------------------------------------- ;
; ;
; Mon, Jun 17 2013 16:36 ;
; Major clean up and implementation of some new fcns. Start of change log. ;
; ;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;
; Basic Settings ;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; This section contains basic settings controlling emacs. They typically do ;
; not have any dependencies on 3rd party lisp functions, etc. ;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; Load personal functions
(load "~/.elisp/myfuncs.el")
; Set text-mode as the default major mode
(setq-default major-mode 'text-mode)
; Add extension types
(setq auto-mode-alist (cons '(".wsdl" . nxml-mode) auto-mode-alist))
(setq auto-mode-alist (cons '(".xsd" . nxml-mode) auto-mode-alist))
; Replaces the audible bell with a visual flash
(setq visible-bell 1)
; Set the default directory (this may need to be changed based b/c of os)
(setq default-directory
(if (getenv "HOME") (getenv "HOME") "/Users/ben.abernathy"))
; Highlights the current line
(global-hl-line-mode 1)
; Forces no blinking cursor
(blink-cursor-mode 0)
; Forces the block cursor
(setq bar-cursor nil)
; Turn off the toolbar
(tool-bar-mode 0)
; Force the font lock mode to true, this will enable syntax highlighting
(global-font-lock-mode 1)
(setq font-lock-maximum-decoration t)
; Format the title bar and the icons
(setq frame-title-format '("%f [mode: %m]" ) ; "filename [mode]" in title bar
icon-title-format '("emacs: %b")) ; "emacs: buffername" in icon
; Display the time in the mode line
(display-time-mode 1)
; Force the line and column numbers in the bar
(line-number-mode 1)
(column-number-mode 1)
; Removes the ugly splash screen
(setq inhibit-splash-screen t)
; Indentation and tab handling
(setq-default indent-tabs-mode nil)
(setq-default tab-width 4)
; Highlight matching parenthesis
(show-paren-mode 1)
; Backup file handling
(setq make-backup-files nil) ; do not create backup files
; Let your yes be yes and your no be no
(fset 'yes-or-no-p 'y-or-n-p)
(define-key query-replace-map [return] 'act)
(define-key query-replace-map [?\C-m] 'act)
; Don't word wrap
(toggle-truncate-lines t)
; This handles loaded buffers with the same name
; The reverse means that the name is first followed by the directory.
; For example, tmp/Mod.java and temp/Mod.java would be presented as:
; Mod.java\tmp and Mod.java\temp. This is nice because it doesn't
; mess with the buffer switching autocomplete.
(require 'uniquify)
(setq uniquify-buffer-name-style 'reverse)
;;;;;;;;;;;;;;;;;;;;;;;;;
; Third Party Functions ;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; Adds functionality provided by third party packages. ;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; Add the script directory
(add-to-list 'load-path "~/.elisp")
; Set color theme
(add-to-list 'custom-theme-load-path
(file-name-as-directory "~/.elisp/color-themes"))
(load-theme 'calm-forest t t)
(enable-theme 'calm-forest)
; Loads the linum code (displays line numbers in the gutter)
; You must load this after you initialize the theme else the gutter numbers
; will be funky colors.
(require 'linum)
(global-linum-mode 1)
; A cool template capability
(load "~/.elisp/defaultcontent/defaultcontent.el")
(require 'defaultcontent)
(setq dc-auto-insert-directory "~/.elisp/defaultcontent/templates/")
(setq dc-fast-variable-handling t)
; Add templates here
(add-to-list 'dc-auto-insert-alist '("\\.cs$" . "template.cs"))
(add-to-list 'dc-auto-insert-alist '("\\.xsd$" . "template.xsd"))
(add-to-list 'dc-auto-insert-alist '("\\.java$" . "template.java"))
(add-to-list 'dc-auto-insert-alist '("\\.wsdl$" . "template.wsdl"))
; For auto completion within a buffer.
(require 'auto-complete-config)
(add-to-list 'ac-dictionary-directories "~/.elisp/ac-dict")
(ac-config-default)
; Org mode!!!
(setq load-path (cons "~/.elisp/org-7.8.03/lisp" load-path))
(require 'org-install)
(add-to-list 'auto-mode-alist '("\\.org\\'" . org-mode))
(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)
; Mark it down, way down.
;(require 'markdown-mode)
;autoload 'markdown-mode "markdown-mode"
; "Major mode for editing Markdown files" t)
;(add-to-list 'auto-mode-alist '("\\.markdown\\'" . markdown-mode))
;(add-to-list 'auto-mode-alist '("\\.md\\'" . markdown-mode))
; Saves the previous layout
(desktop-save-mode 1)
; Starts with a new junk buffer
(add-hook 'after-init-hook
'(lambda ()
(switch-to-buffer
(get-buffer-create "*junk*"))))
; Semantic setup for IDE-like behavior
(add-to-list 'semantic-default-submodes 'global-semantic-mru-bookmark-mode)
(add-to-list 'semantic-default-submodes 'global-semanticdb-minor-mode)
(add-to-list 'semantic-default-submodes 'global-semantic-idle-scheduler-mode)
(add-to-list 'semantic-default-submodes 'global-semantic-stickyfunc-mode)
(add-to-list 'semantic-default-submodes 'global-cedet-m3-minor-mode)
(add-to-list 'semantic-default-submodes 'global-semantic-highlight-func-mode)
(add-to-list 'semantic-default-submodes 'global-semanticdb-minor-mode)
(semantic-mode 1)
(require 'semantic/analyze)
(provide 'semantic-analyze)
(provide 'semantic-ctxt)
(provide 'semanticdb)
(provide 'semanticdb-find)
(provide 'semanticdb-mode)
(provide 'semantic-load)
; A simple directory/source navigation tool
(add-to-list 'load-path "~/.elisp/emacs-nav-49")
(require 'nav)
(nav-disable-overeager-window-splitting)
;; Optional: set up a quick key to toggle nav
(global-set-key [f8] 'nav-toggle)