Add the accumulated C++ config
Getty Ritter
4 years ago
3 | 3 | (setq initial-scratch-message "") |
4 | 4 | (setq inhibit-startup-message t) |
5 | 5 | (setq inhibit-startup-screen t) |
6 | (setq-default c-basic-offset 2) | |
7 | 6 | (menu-bar-mode 0) |
8 | 7 | (setq column-number-mode t) |
9 |
(setq default-tab-width |
|
8 | (setq default-tab-width 4) | |
10 | 9 | (setq-default indent-tabs-mode nil) |
11 | 10 | |
12 |
(setq c-default-style " |
|
11 | (setq c-default-style "stroustrup") | |
13 | 12 | (c-set-offset 'substatement-open 0) |
14 | 13 | (add-to-list 'auto-mode-alist '("\\.edl\\'" . c-mode)) |
15 | 14 | |
104 | 103 | |
105 | 104 | |
106 | 105 | |
107 | 106 | |
107 | ;; some C/C__ setup | |
108 | ||
109 | (defun gdritter/line-width-hook() | |
110 | (if (member major-mode '(c-mode c++-mode)) | |
111 | (set-fill-column 120))) | |
112 | ||
113 | (add-hook 'after-change-major-mode-hook 'gdritter/line-width-hook) | |
114 | ||
115 | (use-package dumb-jump | |
116 | :bind (("M-g j" . dump-jump-go) | |
117 | ("M-g i" . dump-jump-go-prompt)) | |
118 | :config (setq dump-jump-selector 'helm) | |
119 | :ensure t) | |
120 | ||
121 | (defconst gdritter/cc-style | |
122 | '("cc-mode" (c-offsets-alist . ((innamespace . [0]))))) | |
123 | ||
124 | (c-add-style "gdritter/cc-style" gdritter/cc-style) | |
125 | (setq c-default-style "gdritter/cc-style" c-basic-offset 4) | |
126 | ||
127 | ||
108 | 128 | |
129 | ||
109 | 130 | ;; misc. package setup |