Skip to content

Commit

Permalink
Personal changes for Prelude
Browse files Browse the repository at this point in the history
  • Loading branch information
Caleb Epstein committed Jul 12, 2014
1 parent fcab23f commit 88ec0c8
Show file tree
Hide file tree
Showing 2 changed files with 74 additions and 0 deletions.
47 changes: 47 additions & 0 deletions personal/c-style.el
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
;; Change C headers to be treater as C++
(add-to-list 'auto-mode-alist '("\\.h\\'" . c++-mode))

;; Treat Slice files as IDL
(add-to-list 'auto-mode-alist '("\\.ice\\'" . idl-mode))

;; Style mode hook for C++
(c-add-style "snail-cpp-style"
'((c-tab-always-indent . t)
(indent-tabs-mode . nil)
(c-basic-offset . 4)
(c-comment-only-line-offset . 4)
(c-hanging-braces-alist . ((substatement-open after)
(brace-list-open)))
(c-hanging-colons-alist . ((member-init-intro before)
(inher-intro)
(case-label after)
(label after)
(access-label after)))
(c-cleanup-list . (scope-operator
empty-defun-braces
space-before-funcall
defun-close-semi))
(c-offsets-alist . ((arglist-close . c-lineup-arglist)
(substatement-open . 0)
(inmodule . 0)
(case-label . +)
(block-open . 0)
(innamespace . 0)
(inextern-lang . 0)
(comment-intro . 0)
(inline-open . 0)
(knr-argdecl-intro . -)))
))

(defun snail-style-c++-mode-hook ()
(c-set-style "snail-cpp-style")
;; (auto-fill-mode)
(c-toggle-auto-hungry-state 1)
(c-toggle-electric-state 1)
(c-toggle-auto-newline -1))

;; (add-hook 'c++-mode-hook 'snail-style-c++-mode-hook)
(add-hook 'prelude-c-mode-common-hook 'snail-style-c++-mode-hook)

;; Use C++ style for IDL files
(add-hook 'idl-mode-hook 'snail-style-c++-mode-hook)
27 changes: 27 additions & 0 deletions personal/caleb.el
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
(setq prelude-guru nil)
(setq sp-use-paredit-bindings nil)
(setq ibuffer-expert t)

(require 'diminish)

(eval-after-load "diminish"
'(progn
(eval-after-load "projectile"
'(diminish 'projectile-mode ""))))

(require 'undo-tree)
(global-undo-tree-mode 1)
(eval-after-load "diminish"
'(progn
(eval-after-load "undo-tree"
'(diminish 'undo-tree-mode ""))))

(eval-after-load "diminish"
'(progn
(eval-after-load "whitespace"
'(diminish 'global-whitespace-mode ""))
(eval-after-load "whitespace"
'(diminish 'whitespace-mode ""))))

(global-set-key [remap move-beginning-of-line]
'move-beginning-of-line)

0 comments on commit 88ec0c8

Please sign in to comment.