-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathmy-custom.el
101 lines (88 loc) · 2.44 KB
/
my-custom.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
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
;;; We define modes for c++, python, and java
;;; Code:
(load-library "google-c-style")
(defun jack-c++-mode ()
"C++ mode made to fit the way I like it."
(interactive)
(c++-mode)
(subword-mode)
(google-set-c-style)
(which-function-mode 1)
(setq indent-tabs-mode nil)
(whitespace-mode 1)
)
(defun jack-cuda-mode ()
"CUDA mode made to fit the way I like it."
(interactive)
(cuda-mode)
(subword-mode)
(google-set-c-style)
(which-function-mode 1)
(setq indent-tabs-mode nil)
(whitespace-mode 1)
)
(defun jack-c-mode ()
"C++ mode made to fit the way I like it."
(interactive)
(c-mode)
(subword-mode)
(google-set-c-style)
;; (setq tab-width 4)
;; (setq c-basic-offset 4)
;(setq compile-command "make install -j2 -k -C ~/jack/nao-man/ ")
(which-function-mode 1)
(setq indent-tabs-mode nil)
(whitespace-mode 1)
)
(defun jack-python-mode ()
(interactive)
(python-mode)
(subword-mode)
(setq tab-width 4)
(setq c-basic-offset 4)
(which-function-mode 1)
(setq indent-tabs-mode nil)
(whitespace-mode 1)
)
(defun jack-java-mode () ; For the TOOL
(interactive)
(java-mode)
(subword-mode) ; Uncomment to treat camelText words as separate
(setq tab-width 2)
(setq c-basic-offset 2)
(which-function-mode 1)
(setq indent-tabs-mode nil)
;(setq compile-command "ant compile")
(whitespace-mode 1)
)
;;; We set the jack modes as default for the appropraite files
;;;
;;; To make this apply only in jack directories add a path to the settings
;;; i.e. ("~/src/jack/.*\\.cpp$" . jack-c++-mode)
(setq auto-mode-alist (append '(("\\.cpp$" . jack-c++-mode)
("\\.cc$" . jack-c++-mode)
("\\.hpp$" . jack-c++-mode)
("\\.h$" . jack-c++-mode)
("\\.cuh$" . jack-cuda-mode)
("\\.cu$" . jack-cuda-mode)
("\\.py$" . jack-python-mode)
("\\.java$" . jack-java-mode)
) auto-mode-alist))
(setq auto-mode-alist (append '(("\\.c$" . jack-c-mode)) auto-mode-alist))
;; CUSTOM STYLES
(c-add-style "my-c-style"
'("BSD"
(c-offsets-alist .
((innamespace . 0))
)))
;; (add-hook 'c-mode-common-hook
;; '(c-set-style "my-c-style"))
;; (add-hook 'c++-mode-hook
;; '(c-set-style "my-c-style"))
(setq-default c-basic-offset 4)
;;(setq c-default-style "google-c-style")
(setq c-doc-comment-style 'javadoc)
(setq whitespace-style (quote (face tabs trailing space-before-tab tab-mark lines)))
(setq windmove-wrap-around t)
(provide 'my-custom)
;;; my-custom.el ends here