-
Notifications
You must be signed in to change notification settings - Fork 0
/
local.el
77 lines (68 loc) · 2.39 KB
/
local.el
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
;;------------- Use Windows Line Endings ---------------
;(setq default-buffer-file-coding-system 'dos)
;;---------------- Programming Styles ------------------
;; spaces, no tabs
(setq-default indent-tabs-mode nil)
;; nuke trailing whitespaces when writing to a file
(add-hook 'write-file-hooks 'delete-trailing-whitespace)
;; Javascript customizations ---------------------------
(add-hook 'js-mode-hook
(function (lambda ()
(setq js-indent-level 2)
(linum-mode))))
; Python customization ---------------------------------
(add-hook 'python-mode-hook
(function (lambda ()
(setq indent-tabs-mode nil
tab-width 4))))
;; C++ customization -----------------------------------
(add-hook 'c++-mode-hook
(function (lambda ()
(setq default-tab-width 4)
(setq tab-width 4)
(setq c-basic-offset tab-width)
(setq c-indent-level tab-width)
(setq indent-tabs-mode nil)
;; Indentation Style
(c-set-offset 'access-label '/)
(c-set-offset 'case-label '*)
(c-set-offset 'arglist-intro '++)
(c-set-offset 'substatement-open 0)
(c-set-offset 'arglist-cont-nonempty '+)
(c-set-offset 'arglist-intro '+)
(c-set-offset 'statement-case-intro '*)
(c-set-offset 'brace-list-open 0)
;; Switch to .h and .cpp files easily.
(local-set-key (kbd "C-c o") 'ff-find-other-file)
;; Show line numbers
(linum-mode t)
)
)
)
;; C customization -----------------------------------
(add-hook 'c-mode-hook
(function (lambda ()
;; Tabs and spaces
(setq default-tab-width 4)
(setq tab-width 4)
(setq c-basic-offset tab-width)
(setq c-indent-level tab-width)
(setq indent-tabs-mode nil)
;; Indentation Style
(c-set-offset 'access-label '/)
(c-set-offset 'case-label '*)
(c-set-offset 'arglist-intro '++)
(c-set-offset 'substatement-open 0)
(c-set-offset 'arglist-cont-nonempty '+)
(c-set-offset 'arglist-intro '+)
(c-set-offset 'statement-case-intro '*)
(c-set-offset 'brace-list-open 0)
;; Switch to .h and .cpp files easily.
(local-set-key (kbd "C-c o") 'ff-find-other-file)
;; Show line numbers
(linum-mode t)
)
)
)
;; Ruby customizations -----------------------------------
(setq ruby-indent-level 4)