author | Luke Hoersten <Luke@Hoersten.org> |
Thu, 03 Sep 2009 18:57:10 -0500 | |
changeset 10 | eb4d42b61a62 |
parent 9 | c72d0d9f61cb |
child 13 | 7dc464c4e2d3 |
permissions | -rw-r--r-- |
4
0fda818a8b6a
Added doxymacs and provides for requires.
Luke Hoersten <Luke@Hoersten.org>
parents:
1
diff
changeset
|
1 |
;; ~/.emacs.d/hoersten-c-style.el |
0fda818a8b6a
Added doxymacs and provides for requires.
Luke Hoersten <Luke@Hoersten.org>
parents:
1
diff
changeset
|
2 |
;; Luke Hoersten <[email protected]> |
0 | 3 |
|
4 |
;; hoersten c++-style |
|
5 |
(c-add-style "hoersten" |
|
1 | 6 |
'(;; indentation |
7
de2d02049ed6
Added fix for multiline function signature indentation.
Luke Hoersten <Luke@Hoersten.org>
parents:
6
diff
changeset
|
7 |
(indent-tabs-mode . t) |
de2d02049ed6
Added fix for multiline function signature indentation.
Luke Hoersten <Luke@Hoersten.org>
parents:
6
diff
changeset
|
8 |
(tab-width . 3) |
de2d02049ed6
Added fix for multiline function signature indentation.
Luke Hoersten <Luke@Hoersten.org>
parents:
6
diff
changeset
|
9 |
(c-basic-offset . 3) |
0 | 10 |
|
1 | 11 |
;; brace cleanups |
12 |
(c-cleanup-list |
|
13 |
brace-else-brace |
|
14 |
brace-elseif-brace |
|
15 |
brace-catch-brace |
|
16 |
empty-defun-braces |
|
17 |
defun-close-semi |
|
18 |
list-close-comma |
|
19 |
scope-operator) |
|
0 | 20 |
|
1 | 21 |
;; syntactic symbols |
22 |
(c-offsets-alist |
|
7
de2d02049ed6
Added fix for multiline function signature indentation.
Luke Hoersten <Luke@Hoersten.org>
parents:
6
diff
changeset
|
23 |
(substatement-open . 0) |
de2d02049ed6
Added fix for multiline function signature indentation.
Luke Hoersten <Luke@Hoersten.org>
parents:
6
diff
changeset
|
24 |
(inline-open . 0) |
de2d02049ed6
Added fix for multiline function signature indentation.
Luke Hoersten <Luke@Hoersten.org>
parents:
6
diff
changeset
|
25 |
(case-label . +) |
de2d02049ed6
Added fix for multiline function signature indentation.
Luke Hoersten <Luke@Hoersten.org>
parents:
6
diff
changeset
|
26 |
(innamespace . 0) |
de2d02049ed6
Added fix for multiline function signature indentation.
Luke Hoersten <Luke@Hoersten.org>
parents:
6
diff
changeset
|
27 |
(arglist-cont-nonempty . +) |
de2d02049ed6
Added fix for multiline function signature indentation.
Luke Hoersten <Luke@Hoersten.org>
parents:
6
diff
changeset
|
28 |
(cpp-macro . -)))) |
0 | 29 |
|
30 |
;; c-like language settings (c, c++, java, etc.) |
|
6
5f0680e88468
Added recompile key and removed doxymacs dep because of bug in Ubuntu package.
Luke Hoersten <Luke@Hoersten.org>
parents:
5
diff
changeset
|
31 |
;;(require 'doxymacs) |
0 | 32 |
(setq-default c-hungry-delete-key t) ; enable hungry delete |
33 |
(setq-default c-default-style "hoersten") ; load c-style |
|
34 |
(add-hook 'c-mode-common-hook |
|
4
0fda818a8b6a
Added doxymacs and provides for requires.
Luke Hoersten <Luke@Hoersten.org>
parents:
1
diff
changeset
|
35 |
(lambda () |
1 | 36 |
;; indentation |
37 |
(setq tab-width 3) |
|
38 |
(setq c-basic-offset 3) |
|
39 |
(setq indent-tabs-mode t) |
|
4
0fda818a8b6a
Added doxymacs and provides for requires.
Luke Hoersten <Luke@Hoersten.org>
parents:
1
diff
changeset
|
40 |
(setq standard-indent 3) |
10
eb4d42b61a62
Tweaking whitespace handling
Luke Hoersten <Luke@Hoersten.org>
parents:
9
diff
changeset
|
41 |
(setq whitespace-line-column 120) |
0 | 42 |
|
1 | 43 |
(c-toggle-auto-newline t) ; auto newline |
4
0fda818a8b6a
Added doxymacs and provides for requires.
Luke Hoersten <Luke@Hoersten.org>
parents:
1
diff
changeset
|
44 |
(c-subword-mode t) |
6
5f0680e88468
Added recompile key and removed doxymacs dep because of bug in Ubuntu package.
Luke Hoersten <Luke@Hoersten.org>
parents:
5
diff
changeset
|
45 |
;;(doxymacs-mode t) |
5f0680e88468
Added recompile key and removed doxymacs dep because of bug in Ubuntu package.
Luke Hoersten <Luke@Hoersten.org>
parents:
5
diff
changeset
|
46 |
;;(doxymacs-font-lock) |
0 | 47 |
|
1 | 48 |
;; custom keys |
49 |
(local-set-key (kbd "C-c f") 'ff-find-other-file) ; toggle header/source file |
|
50 |
(local-set-key (kbd "C-c C-c") 'comment-or-uncomment-region) |
|
0 | 51 |
|
1 | 52 |
;; code folding |
53 |
(local-set-key (kbd "C-c v") 'hs-toggle-hiding) |
|
54 |
(local-set-key (kbd "<f1>") 'hs-hide-all) |
|
55 |
(local-set-key (kbd "<f2>") 'hs-show-all) |
|
56 |
(hs-minor-mode t) ; enable hide-show mode |
|
5
59b1838be594
Added electric braces and minor tweaks.
Luke Hoersten <Luke@Hoersten.org>
parents:
4
diff
changeset
|
57 |
|
59b1838be594
Added electric braces and minor tweaks.
Luke Hoersten <Luke@Hoersten.org>
parents:
4
diff
changeset
|
58 |
;; auto-close bracing |
6
5f0680e88468
Added recompile key and removed doxymacs dep because of bug in Ubuntu package.
Luke Hoersten <Luke@Hoersten.org>
parents:
5
diff
changeset
|
59 |
(dolist (key '("(" "[")) (define-key (current-local-map) key 'insert-pair)) |
4
0fda818a8b6a
Added doxymacs and provides for requires.
Luke Hoersten <Luke@Hoersten.org>
parents:
1
diff
changeset
|
60 |
)) |
1 | 61 |
|
4
0fda818a8b6a
Added doxymacs and provides for requires.
Luke Hoersten <Luke@Hoersten.org>
parents:
1
diff
changeset
|
62 |
(provide 'hoersten-c-style) |