-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy path.emacs
183 lines (161 loc) · 6.75 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
;; -----------------------------------------------------------------------------
;; Aerial Emacs
;; Author: Nicolas P. Rougier
;; Licence: GNU GPL v3
;; -----------------------------------------------------------------------------
;; ----------------------------------------------------------------------------
;; Initialization
;; ----------------------------------------------------------------------------
(setq inhibit-startup-message t) ;; No startup page
(setq initial-scratch-message nil) ;; No *scratch* buffer message
(menu-bar-mode 0) ;; No menubar
(tool-bar-mode 0) ;; No toolbar
(tooltip-mode 0) ;; No tooltip
(scroll-bar-mode 0) ;; Noe scrollbar
(blink-cursor-mode 0) ;; No blinking cursor
(setq pop-up-windows nil) ;; No popup windows
;; ----------------------------------------------------------------------------
;; Geometry
;; ----------------------------------------------------------------------------
;; Fringe on left and right: 8 pixels
(fringe-mode '(8 . 8))
;; Internal border: 32 pixels
(modify-frame-parameters (selected-frame)
'((internal-border-width . 32)))
;; Default frame size and border
(setq default-frame-alist (append (list
'(width . 88) '(height . 42)
'(top . 50) '(left . 250)
'(internal-border-width . 32))
default-frame-alist))
(setq-default frame-title-format "%b")
(setq frame-title-format "%b")
;; ----------------------------------------------------------------------------
;; Linum & hlinum
;; ----------------------------------------------------------------------------
(defun fullpath-relative-to-current-file (file-relative-path)
(concat (file-name-directory
(or load-file-name buffer-file-name))
file-relative-path))
(add-to-list 'load-path (fullpath-relative-to-current-file "."))
(require 'linum) ;; Line number
(require 'hlinum) ;; Highlight current line in linum
(setq linum-format " %3d ") ;; Lium format
(dolist (hook (list 'emacs-lisp-mode-hook
'python-mode-hook
'tex-mode-hook
'latex-mode-hook
'c-mode-hook
'text-mode-hook
'rst-mode-hook
'c++-mode-hook))
(add-hook hook 'linum-mode))
;; ----------------------------------------------------------------------------
;; Headerline
;; ----------------------------------------------------------------------------
(defun mode-line-fill (face reserve)
"Return empty space using FACE and leaving RESERVE space on the right."
(unless reserve
(setq reserve 20))
(when (and window-system (eq 'right (get-scroll-bar-mode)))
(setq reserve (- reserve 3)))
(propertize " "
'display `((space :align-to (- (+ right right-fringe right-margin) ,reserve)))
'face face))
(setq-default header-line-format (list
" "
'mode-line-mule-info
'mode-line-modified
" "
'mode-line-buffer-identification
'mode-line-modes
" -- "
`(vc-mode vc-mode)
;; File read-only
'(:eval (if buffer-read-only
(list (mode-line-fill 'nil 13)
(propertize " [read-only] " 'face 'header-line-grey))))
;; File modified
'(:eval (if (buffer-modified-p)
(list (mode-line-fill 'nil 12)
(propertize " [modified] " 'face 'header-line-red))
(list (mode-line-fill 'nil 9)
(propertize "%4l:%3c " 'face 'header-line))))
))
(setq-default mode-line-format "")
;; ----------------------------------------------------------------------------
;; Font
;; ----------------------------------------------------------------------------
(set-frame-font "Source Code Pro Light 14")
(add-to-list 'default-frame-alist
'(font . "Source Code Pro Light 14"))
;; ----------------------------------------------------------------------------
;; Colors
;; -----------------------------------------------------------------------------
(setq frame-background-mode 'light)
(set-foreground-color "#000000")
(set-background-color "#ffffff")
(set-face-attribute 'bold nil
:weight 'regular)
(make-face 'header-line-grey)
(set-face-attribute 'header-line-grey nil
:weight 'medium
:foreground "#ffffff"
:background "#999999"
:box '(:line-width 1 :color "#999999"))
(make-face 'header-line-red)
(set-face-attribute 'header-line-red nil
:weight 'medium
:foreground "white"
:background "#dd7777"
:box '(:line-width 1 :color "#dd7777"))
(set-face-attribute 'mode-line nil
:height 10
:background "#999"
:box nil)
(set-face-attribute 'mode-line-inactive nil
:height 10
:background "#999"
:box nil)
(set-face-attribute 'header-line nil
:inherit nil
:foreground "white"
:background "#000000"
:box '(:line-width 3 :color "#000000"))
(set-face-attribute 'fringe nil
:inherit nil
:background "#ffffff")
(set-face-attribute 'show-paren-match nil
:bold t
:background "#dddddd")
(set-face-attribute 'linum nil
:foreground "#cccccc"
:background "#f9f9f9")
(set-face-attribute 'linum-highlight-face nil
:weight 'medium
:foreground "#555555"
:background "#f0f0f0")
(set-face-attribute 'highlight nil
:background "#f5f5ff")
(set-face-attribute 'font-lock-comment-face nil
:foreground "#8c878f")
(set-face-attribute 'font-lock-constant-face nil
:foreground "#3b5bb5")
(set-face-attribute 'font-lock-string-face nil
:foreground "#0078ff")
(set-face-attribute 'font-lock-function-name-face nil
:foreground "#3b5bb5")
(set-face-attribute 'font-lock-variable-name-face nil
:foreground "black")
(set-face-attribute 'font-lock-type-face nil
:foreground "#3b5bb5")
(set-face-attribute 'font-lock-keyword-face nil
:foreground "#ff7800")
(set-face-attribute 'region nil
:stipple nil
:background "#ffffcc")
(set-face-attribute 'isearch nil
:foreground "#000000"
:background "#ffff00")
(set-face-attribute 'lazy-highlight nil
:background "paleturquoise")