-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.emacs_custom
164 lines (129 loc) · 4.75 KB
/
.emacs_custom
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
;; Editing Settings
;; ================
(require 'cc-mode)
(custom-set-variables
'(load-home-init-file t t)
'(gutter-buffers-tab-visible-p nil)
'(font-lock-maximum-decoration t)
'(toolbar-visible-p nil)
'(modeline-3d-p t)
'(user-full-name "Thomas Kistler")
'(user-mail-address "[email protected]")
'(query-user-mail-address nil)
'(c-basic-offset 4)
'(cperl-indent-level 4)
'(ruby-indent-level 2)
'(font-lock-mode t nil (font-lock)))
(setq auto-mode-alist (cons (cons "\\.def$" 'c-mode) auto-mode-alist))
(setq auto-mode-alist (cons (cons "\\.bd$" 'c-mode) auto-mode-alist))
(setq-default fill-column 75)
;; (paren-set-mode 'sexp)
(c-set-offset 'substatement-open 0)
(setq indent-tabs-mode nil)
(setq default-tab-width 4)
(setq-default indent-tabs-mode nil)
(line-number-mode 1)
(column-number-mode 1)
(setq scroll-step 1)
(setq scroll-conservatively 5)
;; (tool-bar-mode 0)
;; (setq scroll-bar-mode-explicit t)
;; (setq scroll-bar-mode 0)
;; (toggle-scroll-bar -1)
(setq inhibit-splash-screen t)
(autoload 'ansi-color-for-comint-mode-on "ansi-color" nil t)
(add-hook 'shell-mode-hook 'ansi-color-for-comint-mode-on)
;; (custom-set-faces
;; '(default ((t (:stipple nil :background "gray85" :foreground "black" :inverse-video nil :box nil :strike-through nil :overline nil :underline nil :slant normal :weight normal :height 130 :width normal :foundry "b&h" :family "Courier"))))
;; '(font-lock-variable-name-face ((((class color) (background light)) (:foreground "blue3"))))
;; '(font-lock-keyword-face ((((class color) (background light)) (:foreground "orange"))))
;; '(font-lock-comment-face ((((class color) (background light)) (:foreground "red"))))
;; '(font-lock-function-name-face ((((class color) (background light)) (:foreground "blue3")))))
;; OS check
(cond
((string-equal system-type "gnu/linux")
(custom-set-faces
'(default ((t (:family "Meslo LG L DZ" :foundry "bitstream" :slant normal :weight normal :height 98 :width normal))))
)
)
((t)
(custom-set-faces
'(default ((t (:family "Menlo" :foundry "bitstream" :slant normal :weight normal :height 97 :width normal))))
)
)
)
(if (file-exists-p "~/env/emacs/flyspell.el")
(load-file "~/env/emacs/flyspell.el")
(add-hook 'c-mode-common-hook 'flyspell-prog-mode))
(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 80))
(add-to-list 'default-frame-alist (cons 'width 80)))
;; 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) 200)
(frame-char-height)))))))
(set-frame-size-according-to-resolution)
;; KEYBOARD BINDS
;; ==============
(global-set-key "\C-g" 'goto-line)
;; (global-set-key "\C-xb" 'bs-select-buffer)
(global-set-key [(control return)] 'dabbrev-expand)
(global-set-key "\C-u" 'undo)
(global-set-key "\C-s" 'isearch-forward)
(global-set-key "\M-s" 'query-replace)
(global-set-key [f3] 'find-tag)
(global-set-key [f4] 'tags-loop-continue)
(global-set-key "\C-xp" 'pop-tag-mark)
;; Custom Functions
;; ================
(setq load-path
(append load-path
(list (expand-file-name "~/env/emacs"))))
(load "cycle-buffer")
(global-set-key [f9] 'cycle-buffer-backward)
(global-set-key [f10] 'cycle-buffer)
;; (load "buffer-select")
;; (setq minibuffer-max-depth nil)
;; Ruby Rails
;; ==========
(setq load-path (cons "~/env/emacs/emacs-rails" load-path))
(require 'ruby-mode)
(require 'rails)
;; Go
;; ==
(setq load-path (cons "~/env/" load-path))
(require 'go-mode-load)
(require 'miso-mode-load)
(add-hook 'before-save-hook 'gofmt-before-save)
;; P4
;; ==
(setq load-path (cons "~/env/" load-path))
(require 'p4)
;; CMAKE
;; =====
; Add cmake listfile names to the mode list.
(setq auto-mode-alist
(append
'(("CMakeLists\\.txt\\'" . cmake-mode))
'(("\\.cmake\\'" . cmake-mode))
auto-mode-alist))
(autoload 'cmake-mode "cmake-mode.el" t)
;; PACKAGES
;; ========
(require 'package) ;; You might already have this line
(add-to-list 'package-archives
'("melpa" . "https://melpa.org/packages/"))
(when (< emacs-major-version 24)
;; For important compatibility libraries like cl-lib
(add-to-list 'package-archives '("gnu" . "http://elpa.gnu.org/packages/")))
(package-initialize) ;; You might already have this line