diff options
| author | Luke Hoersten <[email protected]> | 2009-01-01 10:51:38 -0600 |
|---|---|---|
| committer | Luke Hoersten <[email protected]> | 2009-01-01 10:51:38 -0600 |
| commit | 66f6f22935de450a3b0dd0a522d19e2304d2c6b5 (patch) | |
| tree | a18b7555b02a55fdd5734630ff2679509860e8cb /hoersten-c-style.el | |
Initial commit.
Diffstat (limited to 'hoersten-c-style.el')
| -rw-r--r-- | hoersten-c-style.el | 50 |
1 files changed, 50 insertions, 0 deletions
diff --git a/hoersten-c-style.el b/hoersten-c-style.el new file mode 100644 index 0000000..ae986d3 --- /dev/null +++ b/hoersten-c-style.el @@ -0,0 +1,50 @@ +;; ~/.emacs.d/hoersten-c-style.el - Luke Hoersten - v1.0 + +;; hoersten c++-style +(c-add-style "hoersten" + '(;; indentation + (indent-tabs-mode . t) + (tab-width . 3) + (c-basic-offset . 3) + + ;; brace cleanups + (c-cleanup-list + brace-else-brace + brace-elseif-brace + brace-catch-brace + empty-defun-braces + defun-close-semi + list-close-comma + scope-operator) + + ;; syntactic symbols + (c-offsets-alist + (substatement-open . 0) + (inline-open . 0) + (case-label . +) + (innamespace . 0) + (cpp-macro . -)))) + +;; c-like language settings (c, c++, java, etc.) +(setq-default c-hungry-delete-key t) ; enable hungry delete +(setq-default c-default-style "hoersten") ; load c-style +(add-hook 'c-mode-common-hook + (lambda() + (c-toggle-auto-newline t) ; auto newline + (auto-fill-mode t) ; word wrap + + ;; custom keys + (local-set-key (kbd "C-c f") 'ff-find-other-file) ; toggle header/source file + (local-set-key (kbd "C-c C-c") 'comment-or-uncomment-region) + + ;; code folding + (local-set-key (kbd "C-c v") 'hs-toggle-hiding) + (local-set-key (kbd "<f1>") 'hs-hide-all) + (local-set-key (kbd "<f2>") 'hs-show-all) + (hs-minor-mode t) ; enable hide-show mode + (hs-hide-all) ; hide all blocks by default + + ;; highlight todos + (font-lock-add-keywords + nil + '(("\\([@]\\(TODO\\|todo\\|warning\\)\\)" 1 font-lock-warning-face t))))) |
