Skip to content

Commit

Permalink
emacs: Add a kernel section
Browse files Browse the repository at this point in the history
  • Loading branch information
Valentin Schneider committed Jan 11, 2019
1 parent 0ba14c1 commit 4773e6a
Showing 1 changed file with 23 additions and 2 deletions.
25 changes: 23 additions & 2 deletions files/emacs
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,6 @@
:ensure t
:config (load-theme 'zenburn t))

;; C tab style
(setq c-default-style "linux")

;; ===== Modes =====

Expand Down Expand Up @@ -96,6 +94,27 @@
magit-log-cutoff-length 50
magit-revision-insert-related-refs nil))

;; ----- Kernel -----

(setq c-default-style "linux")

(defun locate-buffer-dominating-file (file)
(and (buffer-file-name)
(locate-dominating-file (buffer-file-name) file)))

(add-hook 'c-mode-hook 'ggtags-mode)

(use-package flycheck-checkpatch
:load-path "~/.emacs.d/packages/flycheck-checkpatch/"
:ensure t
:config
(eval-after-load 'flycheck
'(flycheck-checkpatch-setup)))
;; (add-hook 'flycheck-mode-hook
;; (lambda ()
;; (add-to-list 'flycheck-gcc-include-path
;; (concat (locate-buffer-dominating-file "include") "include")))))
;; (flycheck-add-next-checker 'c/c++-gcc 'checkpatch))
;; ----- YAML -----
(add-to-list 'load-path "~/.emacs.d/packages/yaml-mode/")
(use-package yaml-mode
Expand Down Expand Up @@ -144,6 +163,7 @@
;; Let language major mode take over for indents
(setq org-src-fontify-natively t
org-src-tab-acts-natively t
org-src-preserve-indentation t
org-edit-src-content-indentation 0)

;; Say no to safety
Expand All @@ -162,6 +182,7 @@
'org-babel-load-languages
(append org-babel-load-languages
'((python . t)
(sh . t)
(C . t)
(plantuml . t))))

Expand Down

0 comments on commit 4773e6a

Please sign in to comment.