Skip to content

Commit

Permalink
c-add-style vmware
Browse files Browse the repository at this point in the history
  • Loading branch information
dougm committed Jan 22, 2013
1 parent 36f9241 commit 99083cd
Showing 1 changed file with 32 additions and 6 deletions.
38 changes: 32 additions & 6 deletions dougm/init.el
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
(load-theme 'solarized-dark t)

(setq-default indent-tabs-mode nil)
(setq c-default-style "bsd")
(setq whitespace-style '(face trailing lines-tail))
(setq-default whitespace-line-column 80)
(setq-default show-trailing-whitespace t)
Expand All @@ -21,11 +20,38 @@
(add-hook 'coding-hook 'linum-on)
(add-hook 'coding-hook 'whitespace-mode)

(add-hook 'c-mode-common-hook
(lambda ()
(setq c-basic-offset 4)
(setq indent-tabs-mode nil)))

(c-add-style "dougm"
'("bsd"
(c-basic-offset . 4)
(fill-column . 80)
(indent-tabs-mode . nil)))

(setq c-default-style "dougm")

(c-add-style "vmware"
'("bsd"
(c-basic-offset . 3)
(fill-column . 80)
(indent-tabs-mode . nil)
(c-comment-only-line-offset . 0)
(c-hanging-braces-alist . ((substatement-open before after)))
(c-offsets-alist . ((topmost-intro . 0)
(topmost-intro-cont . 0)
(substatement . +)
(substatement-open . 0)
(statement-case-open . +)
(statement-cont . +)
(access-label . -)
(inclass . +)
(inline-open . 0)
(innamespace . 0)))))

(defun maybe-vmware-style ()
(when (and buffer-file-name
(string-match "bora" buffer-file-name))
(c-set-style "vmware")))

(add-hook 'c-mode-common-hook 'maybe-vmware-style)
(add-hook 'c-mode-common-hook 'run-coding-hook)

(require 'xcscope)
Expand Down

0 comments on commit 99083cd

Please sign in to comment.