This repository has been archived by the owner on Dec 6, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathdot_emacs
216 lines (182 loc) · 7.54 KB
/
dot_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
(tool-bar-mode -1)
(show-paren-mode 1)
(setq confirm-nonexistent-file-or-buffer 1)
;;(setq ns-right-option-modifier 'super)
(defun set-frame-size-according-to-resolution ()
(interactive)
(if window-system
(progn
;; use 120 char wide window for largeish displays
;; and smaller 80 column windows for smaller displays
;; pick whatever numbers make sense for you
(if (> (x-display-pixel-width) 1280)
(add-to-list 'default-frame-alist (cons 'width 150))
(add-to-list 'default-frame-alist (cons 'width 80)))
(if (> (x-display-pixel-width) 1280)
(add-to-list 'default-frame-alist (cons 'left 500))
(add-to-list 'default-frame-alist (cons 'left 100)))
(add-to-list 'default-frame-alist (cons 'top 50))
;; for the height, subtract a couple hundred pixels
;; from the screen height (for panels, menubars and
;; whatnot), then divide by the height of a char to
;; get the height we want
(add-to-list 'default-frame-alist
(cons 'height (/ (- (x-display-pixel-height) 250) (frame-char-height)))))))
(add-to-list 'load-path "~/src/emacs")
(add-to-list 'load-path "~/src/emacs/color-theme")
(add-to-list 'load-path "~/src/emacs/expand-region.el")
(add-to-list 'load-path "~/src/emacs/icicles")
(require 'icicles)
(require 'fuzzy-match)
(icy-mode 1)
(require 'handlebars-mode)
(require 'multi-term)
(require 'ace-jump-mode)
(define-key global-map (kbd "C-c SPC") 'ace-jump-mode)
(require 'expand-region)
(global-set-key (kbd "C-=") 'er/expand-region)
(if window-system
(setq multi-term-program "/bin/zsh")
(setq multi-term-program "/bin/bash")
)
(if window-system
(progn
(custom-set-variables
'(term-default-bg-color "#002b36")
'(term-default-fg-color "#839496"))
)
)
(if window-system
(progn
(require 'color-theme)
(eval-after-load "color-theme"
'(progn
(color-theme-initialize)
;; (color-theme-solarized 'light)
;; (color-theme-jsc-light2)
(color-theme-emacs-21)
)
)
)
)
(defadvice zap-to-char (after my-zap-to-char-advice (arg char) activate)
"Kill up to the ARG'th occurence of CHAR, and leave CHAR.
The CHAR is replaced and the point is put before CHAR."
(insert char)
(forward-char -1))
(set-frame-size-according-to-resolution)
(custom-set-variables
;; custom-set-variables was added by Custom.
;; If you edit it by hand, you could mess it up, so be careful.
;; Your init file should contain only one such instance.
;; If there is more than one, they won't work right.
'(ecb-options-version "2.40")
'(edts-man-root "~/.emacs.d/edts/doc/R16B")
'(initial-buffer-choice t)
'(safe-local-variable-values (quote ((allout-layout . t) (erlang-indent-level . 4))))
'(term-default-bg-color "#002b36")
'(term-default-fg-color "#839496"))
(custom-set-faces
;; custom-set-faces was added by Custom.
;; If you edit it by hand, you could mess it up, so be careful.
;; Your init file should contain only one such instance.
;; If there is more than one, they won't work right.
'(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 130 :width normal :foundry "apple" :family "Source_Code_Pro")))))
;; Erlang
(setq load-path (cons "~/src/emacs/erlang"
load-path))
(setq erlang-root-dir "/usr/local/lib/erlang")
(setq exec-path (cons "/usr/local/lib/erlang/bin" exec-path))
(require 'erlang-start)
(setq auto-mode-alist (append auto-mode-alist
'(("\\.rel$" . erlang-mode)
("\\.app$" . erlang-mode)
("\\.appSrc$" . erlang-mode)
("\\.app.src$" . erlang-mode)
("\\.hrl$" . erlang-mode)
("\\.erl$" . erlang-mode)
("\\.yrl$" . erlang-mode))))
;; Wrangler
;;(add-to-list 'load-path "/usr/local/share/wrangler/elisp")
;;(require 'wrangler)
;; Install mode-compile to give friendlier compiling support!
;;(add-to-list 'load-path "~/elisp")
;;(autoload 'mode-compile "mode-compile" "Command to compile current buffer file based on the major mode" t)
;;(global-set-key (kbd "C-c c") 'mode-compile)
;;(autoload 'mode-compile-kill "mode-compile" "Command to kill a compilation launched by `mode-compile'" t)
;;(global-set-key (kbd "C-c k") 'mode-compile-kill)
;; This is needed for Distel setup
;;(add-to-list 'load-path "/Users/steve/src/distel/elisp")
;;(require 'distel)
;;(distel-setup)
;; prevent annoying hang-on-compile
;;(defvar inferior-erlang-prompt-timeout t)
;; default node name to emacs@localhost
;;(setq inferior-erlang-machine-options '("-sname" "emacs"))
;; tell distel to default to that node
;;(setq erl-nodename-cache
;; (make-symbol
;; (concat
;; "emacs@"
;; ;; Mac OS X uses "name.local" instead of "name", this should work
;; ;; pretty much anywhere without having to muck with NetInfo
;; ;; ... but I only tested it on Mac OS X.
;; (car (split-string (shell-command-to-string "hostname"))))))
;; Some Erlang customizations
;;(add-hook 'erlang-mode-hook
;; (lambda ()
;; ;; when starting an Erlang shell in Emacs, default in the node name
;; (setq inferior-erlang-machine-options '("-sname" "emacs"))
;; ;; add Erlang functions to an imenu menu
;; (imenu-add-to-menubar "imenu")))
;; A number of the erlang-extended-mode key bindings are useful in the shell too
(defconst distel-shell-keys
'(
("\C-\M-i" erl-complete)
("\M-?" erl-complete)
("\M-." erl-find-source-under-point)
("\M-," erl-find-source-unwind)
("\M-*" erl-find-source-unwind)
)
"Additional keys to bind when in Erlang shell.")
;;(add-hook 'erlang-shell-mode-hook
;; (lambda ()
;; ;; add some Distel bindings to the Erlang shell
;; (dolist (spec distel-shell-keys)
;; (define-key erlang-shell-mode-map (car spec) (cadr spec)))))
;; Electric Ruby
(add-hook 'ruby-mode-hook
(lambda()
(add-hook 'local-write-file-hooks
'(lambda()
(save-excursion
(untabify (point-min) (point-max))
(delete-trailing-whitespace)
)))
(set (make-local-variable 'indent-tabs-mode) 'nil)
(set (make-local-variable 'tab-width) 2)
(imenu-add-to-menubar "IMENU")
(define-key ruby-mode-map "C-m" 'newline-and-indent) ;Not sure if this line is 100% right but it works!
(require 'ruby-electric)
(ruby-electric-mode t)
))
;; Key modifiers for Mac OS X Emacs.app in spanish MBP keyboard
(global-set-key (kbd "M-1") "|")
(global-set-key (kbd "M-2") "@")
(global-set-key (kbd "M-3") "#")
(global-set-key (kbd "M-º") "\\")
(global-set-key (kbd "M-ç") "}")
(global-set-key (kbd "M-+") "]")
(global-set-key (kbd "M-ñ") "~")
;; Anything
;; (add-to-list 'load-path "~/src/anything-config")
;;(require 'anything-config)
;;(require 'revbufs)
(setq make-backup-files nil)
;; Flash
(add-to-list 'auto-mode-alist '("\\.as\\'" . js-mode))
(when (require 'browse-kill-ring nil 'noerror)
(browse-kill-ring-default-keybindings))
(add-to-list 'load-path "~/src/edts")
(require 'edts-start)
(setq-default indent-tabs-mode nil)