| @@ -601,18 +601,62 @@ Desktop saving of session information handy to keep the same buffers between ses | |||||
| Common mode defaults I think are sensible. | Common mode defaults I think are sensible. | ||||
| TODO: fixme kthxbai | |||||
| #+BEGIN_SRC emacs-lisp :tangle no | |||||
| (interactive) | |||||
| (highlight-lines-matching-regexp ".\{81\}" 'hi-green-b) | |||||
| (hl-line-mode) | |||||
| ;;(auto-complete-mode) | |||||
| (whitespace-mode) | |||||
| ;;(smartparens-mode) | |||||
| (visual-line-mode) | |||||
| (customize-set-variable 'indent-tabs-mode nil) | |||||
| (customize-set-variable 'tab-width 2) | |||||
| #+BEGIN_SRC emacs-lisp | |||||
| (add-hook 'prog-mode-hook | |||||
| '(lambda () | |||||
| (interactive) | |||||
| (hl-line-mode) | |||||
| (auto-complete-mode) | |||||
| (whitespace-mode) | |||||
| (smartparens-mode) | |||||
| (visual-line-mode) | |||||
| (customize-set-variable 'indent-tabs-mode nil) | |||||
| (customize-set-variable 'tab-width 2) | |||||
| (flycheck-mode) | |||||
| ) | |||||
| ) | |||||
| #+END_SRC | |||||
| *** c | |||||
| #+BEGIN_SRC emacs-lisp | |||||
| (add-to-list 'auto-mode-alist '("\\.[chm]\\'" . c-mode)) | |||||
| (add-hook 'c-mode-common-hook | |||||
| '(lambda () | |||||
| (global-set-key "\C-x\C-m" 'compile) | |||||
| (setq flycheck-clang-language-standard "c11") | |||||
| (setq flycheck-idle-change-delay 2) | |||||
| (setq flycheck-highlighting-mode 'symbols) | |||||
| ;; later... | |||||
| ;; (add-hook 'before-save-hook 'clang-format-buffer nil t) | |||||
| (c-toggle-auto-state 1) | |||||
| (setq-default c-basic-offset 2 | |||||
| tab-width 2 | |||||
| indent-tabs-mode nil | |||||
| c-electric-flag t | |||||
| indent-level 2 | |||||
| c-default-style "bsd" | |||||
| backward-delete-function nil) | |||||
| )) | |||||
| #+END_SRC | #+END_SRC | ||||
| *** elisp | |||||
| #+BEGIN_SRC emacs-lisp | |||||
| (add-hook 'emacs-lisp-hook | |||||
| (lambda () | |||||
| (define-key emacs-lisp-map | |||||
| "\C-x\C-e" 'pp-eval-last-sexp) | |||||
| (define-key emacs-lisp-map | |||||
| "\r" 'reindent-then-newline-and-indent))) | |||||
| #+END_SRC | |||||
| *** python | |||||
| #+BEGIN_SRC emacs-lisp | |||||
| (add-hook 'python-mode-hook '(lambda () (flycheck-select-checker 'python-flake8))) | |||||
| #+END_SRC | |||||
| ** auto-insert-mode new file templates | ** auto-insert-mode new file templates | ||||
| Use auto-insert-mode to insert in templates for blank files. | Use auto-insert-mode to insert in templates for blank files. | ||||
| @@ -636,7 +680,7 @@ Create the *auto-insert-alist* so all the mode lists are the same | |||||
| (setq auto-insert-alist | (setq auto-insert-alist | ||||
| (append | (append | ||||
| '( | '( | ||||
| ((c-mode . "C") | |||||
| ((c-mode . "c") | |||||
| nil | nil | ||||
| "/*\n" | "/*\n" | ||||
| "File: " (file-name-nondirectory buffer-file-name) "\n" | "File: " (file-name-nondirectory buffer-file-name) "\n" | ||||
| @@ -654,12 +698,29 @@ Create the *auto-insert-alist* so all the mode lists are the same | |||||
| ) | ) | ||||
| #+END_SRC | #+END_SRC | ||||
| *** elisp | |||||
| #+BEGIN_SRC emacs-lisp | |||||
| (setq auto-insert-alist | |||||
| (append | |||||
| '( | |||||
| ((emacs-lisp-mode . "elisp") | |||||
| nil | |||||
| ";;-*-mode: emacs-lisp; coding: utf-8;-*-\n" | |||||
| ";; File: " (file-name-nondirectory buffer-file-name) "\n" | |||||
| ";; Copyright: " (substring (current-time-string) -4) " " auto-insert-copyright "\n" | |||||
| ";; Description: " _ "\n" | |||||
| ) | |||||
| ) | |||||
| auto-insert-alist) | |||||
| ) | |||||
| #+END_SRC | |||||
| *** python | *** python | ||||
| #+BEGIN_SRC emacs-lisp | #+BEGIN_SRC emacs-lisp | ||||
| (setq auto-insert-alist | (setq auto-insert-alist | ||||
| (append | (append | ||||
| '(((python-mode . "Python") | |||||
| '(((python-mode . "python") | |||||
| nil | nil | ||||
| "#!/usr/bin/env python\n" | "#!/usr/bin/env python\n" | ||||
| "# -*-mode: Python; coding: utf-8;-*-\n" | "# -*-mode: Python; coding: utf-8;-*-\n" | ||||