gdritter repos dotfiles / ca8126f
Add the accumulated C++ config Getty Ritter 1 year, 2 months ago
1 changed file(s) with 24 addition(s) and 3 deletion(s). Collapse all Expand all
33 (setq initial-scratch-message "")
44 (setq inhibit-startup-message t)
55 (setq inhibit-startup-screen t)
6 (setq-default c-basic-offset 2)
76 (menu-bar-mode 0)
87 (setq column-number-mode t)
9 (setq default-tab-width 2)
8 (setq default-tab-width 4)
109 (setq-default indent-tabs-mode nil)
1110
12 (setq c-default-style "linux")
11 (setq c-default-style "stroustrup")
1312 (c-set-offset 'substatement-open 0)
1413 (add-to-list 'auto-mode-alist '("\\.edl\\'" . c-mode))
1514
104103
105104
106105
107106
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
108128
129
109130 ;; misc. package setup