]> git.rkrishnan.org Git - .emacs.d.git/blob - emacs/my-c-mode.el
bf0caaf6378b2f38814c84dcfca1e851473c1d58
[.emacs.d.git] / emacs / my-c-mode.el
1 (require 'cc-mode)
2
3 (defconst vu3rdd-c-style
4   '((c-basic-offset . 2)
5     (tab-width . 4)
6     (indent-tabs-mode . nil)
7     (c-comment-only-line-offset . 0)
8     (c-hanging-braces-alist . ((substatement-open before after)))
9     (c-offsets-alist . ((topmost-intro . 0)
10                         (substatement . +)
11                         (substatement-open . 0)
12                         (case-label . +)
13                         (access-label . -)
14                         (inclass . ++)
15                         (inline-open . 0)
16                         ))))
17
18
19 (c-add-style "vu3rddstyle" vu3rdd-c-style nil)
20
21 (defun vu3rdd-c-hook ()
22   (c-set-style "vu3rddstyle")
23   ;; parenthesis matching {}[]()
24   (global-set-key "%" 'match-paren))
25
26 (add-hook 'c-mode-common-hook 'vu3rdd-c-hook)
27
28 (add-hook 'c-mode-common-hook
29           (lambda () (which-function-mode t)))