From 88ec0c8a5986346c7dc33a9f14c008ea180fadd6 Mon Sep 17 00:00:00 2001 From: Caleb Epstein Date: Sat, 12 Jul 2014 10:51:14 -0400 Subject: [PATCH] Personal changes for Prelude --- personal/c-style.el | 47 +++++++++++++++++++++++++++++++++++++++++++++ personal/caleb.el | 27 ++++++++++++++++++++++++++ 2 files changed, 74 insertions(+) create mode 100644 personal/c-style.el create mode 100644 personal/caleb.el diff --git a/personal/c-style.el b/personal/c-style.el new file mode 100644 index 0000000000..bc8c9e80b3 --- /dev/null +++ b/personal/c-style.el @@ -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) diff --git a/personal/caleb.el b/personal/caleb.el new file mode 100644 index 0000000000..7d9db5bf76 --- /dev/null +++ b/personal/caleb.el @@ -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)