Skip to content

Commit

Permalink
Retire Vlad stylie
Browse files Browse the repository at this point in the history
  • Loading branch information
Caleb Epstein committed May 22, 2018
1 parent f7b7153 commit a8979bb
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 4 deletions.
8 changes: 5 additions & 3 deletions personal/c-style.el
Original file line number Diff line number Diff line change
Expand Up @@ -40,12 +40,14 @@
(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)
;; (add-hook 'prelude-c-mode-common-hook 'snail-style-c++-mode-hook)
(add-hook 'prelude-c-mode-common-hook 'ggtags-mode)

;; Use C++ style for IDL files
(add-hook 'idl-mode-hook 'snail-style-c++-mode-hook)
;; (add-hook 'idl-mode-hook 'snail-style-c++-mode-hook)

(add-hook 'prelude-c-mode-common-hook 'google-set-c-style)
(add-hook 'idl-mode-hook 'google-set-c-style)

;; (sp-local-pair 'c-mode "(" nil :pre-handlers '(:rem " "))
;; (sp-local-pair 'c++-mode "(" nil :pre-handlers '(:rem " "))
19 changes: 18 additions & 1 deletion personal/caleb.el
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@
;; (global-ede-mode 1) ;; CEDET holdover
;; (add-hook 'c-mode-common-hook 'fci-mode)
(add-hook 'c-mode-common-hook 'company-mode)
(add-hook 'c-mode-common-hook 'linum-mode)
(add-hook 'prelude-prog-mode-hook 'linum-mode t)
;; (add-hook 'c-mode-common-hook 'hs-minor-mode)
;; (add-hook 'c-mode-common-hook 'hideshowvis-minor-mode)

Expand All @@ -92,5 +92,22 @@
;; I use underscore to mean underscore in my org-mode files
(setq org-export-with-sub-superscripts nil)

;; Jesus christ, company + shell scripts is a mess
(setq company-global-modes '(not shell-script-mode))

;; From https://eklitzke.org/smarter-emacs-clang-format. Enable
;; clang-format if the Projectile root has a .clang-format
(require 'f)
(defun clang-format-buffer-smart ()
"Reformat buffer if .clang-format exists in the projectile root."
(when (f-exists? (expand-file-name ".clang-format" (projectile-project-root)))
(clang-format-buffer)))

(defun clang-format-buffer-smart-on-save ()
"Add auto-save hook for clang-format-buffer-smart."
(add-hook 'before-save-hook 'clang-format-buffer-smart nil t))

(add-hook 'c-mode-common-hook 'clang-format-buffer-smart-on-save t)

;; Start the server
(server-start)

0 comments on commit a8979bb

Please sign in to comment.