-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathinit-40-coding-gen.el
More file actions
137 lines (115 loc) · 3.24 KB
/
Copy pathinit-40-coding-gen.el
File metadata and controls
137 lines (115 loc) · 3.24 KB
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
;;; init-40-coding-gen.el --- Code for general programming
;; Copyright (C) 2016 Gregory J Stein
;; Author: Gregory J Stein <gregory.j.stein@gmail.com>
;; Maintainer: Gregory J Stein <gregory.j.stein@gmail.com>
;; Created: 20 Aug 2015
;; Keywords: configuration, company, magit, git, flycheck
;; Homepage: https://github.com/gjstein/emacs.d
;; License: GNU General Public License (see init.el for details)
;;; Commentary:
;; General tools for programming across languages. This consists of:
;; Company :: used for code completion
;; Projectile :: used for searching projects
;; Magit :: used for interfacing with git/github
;; Flycheck :: code syntax/convention checking
;;; Code:
;; === Code Completion ===
;; == company-mode ==
(use-package company
:ensure t
:defer t
:diminish company-mode
:init (add-hook 'after-init-hook 'global-company-mode)
:config
(use-package company-irony :ensure t :defer t)
(setq company-idle-delay nil
company-minimum-prefix-length 2
company-show-numbers t
company-tooltip-limit 20
company-dabbrev-downcase nil
)
:bind ("C-;" . company-complete-common)
)
;; === Tools ===
;; == YASnippet ==
(use-package yasnippet
:ensure t
:defer t
:config (yas-global-mode t)
)
;; == Projectile ==
(use-package projectile
:ensure t
:defer t
:init
(projectile-global-mode)
(setq projectile-completion-system 'helm)
(use-package helm-projectile
:ensure t
:init
(helm-projectile-on)
)
)
;; == ag ==
;; Note that 'ag' (the silver searcher) needs to be installed.
;; Ubuntu: sudo apt-get install ag
;; OSX: brew install ag
(use-package ag
:ensure t
)
(use-package helm-ag
:ensure t
)
;; == compile ==
;; https://emacs.stackexchange.com/questions/8135/why-does-compilation-buffer-show-control-characters
(use-package ansi-color
:ensure t
:config (progn
(defun my/ansi-colorize-buffer ()
(let ((buffer-read-only nil))
(ansi-color-apply-on-region (point-min) (point-max))))
(add-hook 'compilation-filter-hook 'my/ansi-colorize-buffer)))
;; == magit ==
(use-package magit
:ensure t
:defer t
:bind ("C-x g" . magit-status)
:init
(setq magit-diff-options (quote ("--word-diff")))
(setq magit-diff-refine-hunk 'all)
;; Use evil keybindings within magit
(use-package evil-magit
:ensure t
:config
;; Default commit editor opening in insert mode
(add-hook 'with-editor-mode-hook 'evil-insert-state)
(evil-define-key 'normal with-editor-mode-map
(kbd "RET") 'with-editor-finish
[escape] 'with-editor-cancel
)
(evil-define-key 'normal git-rebase-mode-map
"l" 'git-rebase-show-commit
)
)
)
;; == flycheck ==
(use-package flycheck
:ensure t
:defer t
:init
(add-hook 'after-init-hook #'global-flycheck-mode)
;; check OS type
(if (string-equal system-type "gnu/linux")
(progn
(custom-set-variables
'(flycheck-c/c++-clang-executable "clang-3.5")
)))
(add-hook 'c++-mode-hook (lambda () (setq flycheck-clang-language-standard "c++11")))
(setq-default flycheck-disabled-checkers '(c/c++-clang c/c++-gcc))
)
;; == OTHER LANGUAGES ==
(use-package swift-mode
:ensure t
:defer t
)
;;; init-40-coding-gen.el ends here