-
Notifications
You must be signed in to change notification settings - Fork 0
/
my-modes.el
95 lines (75 loc) · 2.75 KB
/
my-modes.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
;;; package --- Summary:
;;; Commentary:
;;; Code:
(require 'flycheck-google-cpplint)
(defun ej-python-mode ()
(interactive)
(python-mode) ; Enabled key bindings here:
(subword-mode)
(setq tab-width 4)
(which-function-mode 1)
(setq indent-tabs-mode nil)
(setq whitespace-line-column 100)
(whitespace-mode 1)
(projectile-global-mode)
;; Autocomplete
(require 'jedi)
(add-hook 'python-mode-hook 'jedi:setup)
(setq jedi:setup-keys t)
(setq jedi:complete-on-dot t)
)
(defun ej-groovy-mode ()
(global-font-lock-mode 1)
(groovy-mode)
(groovy-electric)
(subword-mode)
(setq tab-width 4)
(setq c-basic-offset 4)
(setq indent-tabs-mode nil)
)
(defun ej-c++-mode ()
(interactive)
(c++-mode)
(subword-mode)
(setq tab-width 4)
(setq c-basic-offset 4)
(setq compile-command "make -j24 -C ~/fmvot/build zeusrunner")
(which-function-mode 1)
(setq indent-tabs-mode nil)
(whitespace-mode 1)
(projectile-global-mode)
(flycheck-mode)
)
;;; Set the modes as default for the appropriate files
(add-to-list 'auto-mode-alist '("\\.py\\'" . ej-python-mode))
(add-to-list 'interpreter-mode-alist '("python" . ej-python-mode))
(add-to-list 'auto-mode-alist '("\.groovy$" . ej-groovy-mode))
(add-to-list 'interpreter-mode-alist '("groovy" . groovy-mode))
(add-to-list 'auto-mode-alist '("\\.cc\\'" . ej-c++-mode))
(add-to-list 'auto-mode-alist '("\\.cpp\\'" . ej-c++-mode))
(add-to-list 'auto-mode-alist '("\\.h\\'" . ej-c++-mode))
(setq whitespace-style (quote (face tabs trailing space-before-tab tab-mark lines)))
(setq windmove-wrap-around t)
(add-hook 'c++-mode-common-hook '(lambda ()
;; ac-omni-completion-sources is made buffer local so
;; you need to add it to a mode hook to activate on
;; whatever buffer you want to use it with. This
;; example uses C mode (as you probably surmised).
;; auto-complete.el expects ac-omni-completion-sources to be
;; a list of cons cells where each cell's car is a regex
;; that describes the syntactical bits you want AutoComplete
;; to be aware of. The cdr of each cell is the source that will
;; supply the completion data. The following tells autocomplete
;; to begin completion when you type in a . or a ->
(add-to-list 'ac-omni-completion-sources
(cons "\\." '(ac-source-semantic)))
(add-to-list 'ac-omni-completion-sources
(cons "->" '(ac-source-semantic)))
;; ac-sources was also made buffer local in new versions of
;; autocomplete. In my case, I want AutoComplete to use
;; semantic and yasnippet (order matters, if reversed snippets
;; will appear before semantic tag completions).
(setq ac-sources '(ac-source-semantic ac-source-yasnippet))
))
(provide 'my-modes)
;;; my-modes.el ends here