-
Notifications
You must be signed in to change notification settings - Fork 0
/
.emacs
103 lines (86 loc) · 3.65 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
; hide toolbar and menu
(tool-bar-mode -1)
(menu-bar-mode -1)
; do not show splash screen
(setq inhibit-splash-screen 1)
; highlight matching parenteses
(show-paren-mode 1)
; show line and column number
(global-linum-mode 1)
(column-number-mode 1)
;; ---------------------------------------------------------------------------------
;; list the packages to install
(setq package-list '(color-theme highlight-indentation evil evil-numbers dtrt-indent))
;; ---------------------------------------------------------------------------------
; list the repositories containing them
(require 'package)
(setq package-archives '(("marmalade" . "http://marmalade-repo.org/packages/")
("melpa" . "http://melpa.milkbox.net/packages/")
("gnu" . "http://elpa.gnu.org/packages/")))
; activate all the packages (in particular autoloads)
(package-initialize)
; fetch the list of packages available
(unless package-archive-contents
(package-refresh-contents))
; install the missing packages
(dolist (package package-list)
(unless (package-installed-p package)
(package-install package)))
; theme
(require 'color-theme)
(color-theme-initialize)
(color-theme-tty-dark)
(eval-after-load "color-theme" '(color-theme-tty-dark))
;; -----------------------------------------------------------------------------------
;; customizations
; evil mode
(require 'evil)
(evil-mode 1)
(eval-after-load "evil"
'(progn
(define-key evil-normal-state-map (kbd "C-w <left>") 'evil-window-left)
(define-key evil-normal-state-map (kbd "C-w <down>") 'evil-window-down)
(define-key evil-normal-state-map (kbd "C-w <up>") 'evil-window-up)
(define-key evil-normal-state-map (kbd "C-w <right>") 'evil-window-right)
(define-key evil-normal-state-map (kbd "C-w t") 'elscreen-create) ;creat tab
(define-key evil-normal-state-map (kbd "C-w x") 'elscreen-kill) ;kill tab
(define-key evil-normal-state-map "gT" 'elscreen-previous) ;previous tab
(define-key evil-normal-state-map "gt" 'elscreen-next) ;next tab
))
; use spaces instead of tabs
(setq-default indent-tabs-mode nil)
(setq tab-width 4)
; show whitespaces
(global-whitespace-mode 1)
(setq whitespace-style (quote (face tabs tab-mark trailing lines-tail)))
(setq whitespace-display-mappings
;; all numbers are Unicode codepoint in decimal. try (insert-char 182 ) to see it
'(
(space-mark 32 [183] [46]) ; 32 SPACE, 183 MIDDLE DOT 「·」, 46 FULL STOP 「.」
(newline-mark 10 [182 10]) ; 10 LINE FEED
(tab-mark 9 [9655 9] [92 9]) ; 9 TAB, 9655 WHITE RIGHT-POINTING TRIANGLE 「▷」
))
(set-face-attribute 'whitespace-space nil :background "black" :foreground "gray15")
(setq whitespace-line-column 120)
; vim style indentation
(require 'dtrt-indent)
(dtrt-indent-mode 1)
(define-key global-map (kbd "RET") 'newline-and-indent)
; indentation highlight
(require 'highlight-indentation)
(add-hook 'prog-mode-hook 'highlight-indentation-mode)
;; ---------------------------------------------------------------------------------------
(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.
'(custom-safe-themes
(quote
("1c50040ec3b3480b1fec3a0e912cac1eb011c27dd16d087d61e72054685de345" "0aca3a26459bbb43a77f34bc22851c05c0a5d70d3230cbcdbda4fec20fef77e6" default))))
(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.
)