(use-package org-evil
:ensure t)
+
(use-package flycheck
:ensure t
:init (global-flycheck-mode))
(eval-after-load 'company
'(add-to-list 'company-backends 'company-jedi))
+
+(eval-after-load 'autoinsert
+ '(define-auto-insert '("\\.org\\'" . "Org header")
+ '(
+ "Hides all but one star and uncollapses everything."
+ "#+STARTUP: hidestars showall\n\n"
+ _)))
+
+(add-hook 'find-file-hook 'auto-insert)
+
+; Sane C formatting
+
+(defun c-lineup-arglist-tabs-only (ignored)
+ "Line up argument lists by tabs, not spaces."
+ (let* ((anchor (c-langelem-pos c-syntactic-element))
+ (column (c-langelem-2nd-pos c-syntactic-element))
+ (offset (- (1+ column) anchor))
+ (steps (floor offset c-basic-offset)))
+ (* (max steps 1)
+ c-basic-offset)))
+
+(add-hook 'c-mode-common-hook
+ (lambda ()
+ ;; Add kernel style
+ (c-add-style
+ "linux-tabs-only"
+ '("linux" (c-offsets-alist
+ (arglist-cont-nonempty
+ c-lineup-gcc-asm-reg
+ c-lineup-arglist-tabs-only))))))
+
+(add-hook 'c-mode-hook
+ (lambda ()
+ (let ((filename (buffer-file-name)))
+ ;; Enable kernel mode for the appropriate files
+ (setq indent-tabs-mode t)
+ (setq show-trailing-whitespace t)
+ (c-set-style "linux-tabs-only")))))