Change indentation setup to two spaces
Alan Pearce alan@alanpearce.uk
Mon, 31 Oct 2016 10:49:40 +0100
1 files changed, 33 insertions(+), 27 deletions(-)
jump to
M tag-emacs/emacs.d/init.org → tag-emacs/emacs.d/init.org
@@ -621,11 +621,12 @@ * Indentation Ah, a complicated topic. One day we’ll all be using elastic -tabstops. Until then, I want 4-wide tabs, and make them real tabs! +tabstops. I’ve recently switched to using two spaces, since elastic +tabstops is probably never going to happen. #+BEGIN_SRC emacs-lisp - (setq-default tab-width 4 - indent-tabs-mode t) + (setq-default tab-width 2 + indent-tabs-mode nil) #+END_SRC ** auto-indent-mode @@ -639,7 +640,7 @@ :config (progn (setq auto-indent-key-for-end-of-line-then-newline "<C-return>" auto-indent-key-for-end-of-line-insert-char-then-newline "<C-S-return>" auto-indent-blank-lines-on-move nil - auto-indent-assign-indent-level 4 + auto-indent-assign-indent-level 2 auto-indent-backward-delete-char-behavior nil auto-indent-delete-trailing-whitespace-on-save-file t auto-indent-mode-untabify-on-yank-or-paste nil @@ -665,7 +666,7 @@ #+BEGIN_SRC emacs-lisp (use-package smart-tabs-mode :defer 1 :config (progn - (smart-tabs-insinuate 'c 'cperl 'javascript 'python) + (smart-tabs-insinuate 'c 'cperl 'python) (add-hook 'php-mode-hook (lambda () (smart-tabs-mode indent-tabs-mode))) (with-eval-after-load "align.el" @@ -1307,10 +1308,7 @@ (use-package dockerfile-mode :mode (("Dockerfile\\'" . dockerfile-mode))) (use-package nix-mode - :mode (("\\.nix\\'" . nix-mode)) - :config (progn - (add-hook 'nix-mode-hook (lambda () - (setq-local indent-tabs-mode nil))))) + :mode (("\\.nix\\'" . nix-mode))) (define-derived-mode xmonad-mode haskell-mode "XM") (add-to-list 'auto-mode-alist '("xmobarrc\\'" . xmonad-mode)) @@ -1319,9 +1317,7 @@ (use-package nginx-mode :defer t :mode (("/nginx/servers/" . nginx-mode) - ("/nginx/.*\\.d/" . nginx-mode)) - :config (progn - (setq nginx-indent-tabs-mode t))) + ("/nginx/.*\\.d/" . nginx-mode))) (use-package lua-mode :defer t) @@ -1368,9 +1364,6 @@ (projectile-persp-switch-project "~/Sync") (find-file (expand-file-name "ledger/my.ledger" (projectile-project-root))) (ledger-report "Budget (Cumulative)" nil))) :config (progn - (defun setup-ledger-mode () - (setq-local indent-tabs-mode nil)) - (add-hook 'ledger-mode-hook #'setup-ledger-mode) (setq ledger-use-iso-dates t ledger-post-use-completion-engine :built-in ledger-reconcile-default-commodity "€" @@ -1563,6 +1556,20 @@ org-icalendar-use-deadline '(event-if-todo event-if-not-todo todo-due) org-icalendar-alarm-time 60))) #+END_SRC +**** org-page + +I would like to convert my website from using hugo to something else +that I can work with nicely from inside Emacs. I wonder if org-page +will do the trick. + +#+BEGIN_SRC emacs-lisp + (use-package org-page + :config (progn + (setq op/site-domain "https://alanpearce.uk/" + op/repository-directory "~/projects/alanpearce/" + op/personal-github-link "https://github.com/alanpearce"))) +#+END_SRC + * Music Emacs actually supports playing music via mpd. @@ -1636,8 +1643,7 @@ *** All Lisp modes don’t seem to have a common ancestor. So I made a custom -hook which I trigger in every lispy-mode. Of course, no tabs in -lisps. Even I understand that. +hook which I trigger in every lispy-mode. #+BEGIN_SRC emacs-lisp (defcustom lisp-mode-common-hook nil @@ -1646,8 +1652,7 @@ :type 'hook :group 'lisp) (defun ap/lisp-setup () - (run-hooks 'lisp-mode-common-hook) - (setq indent-tabs-mode nil)) + (run-hooks 'lisp-mode-common-hook)) #+END_SRC **** Redshank @@ -1946,9 +1951,9 @@ ("\\.html\\'" . web-mode) ("/templates/.*\\.php\\'" . web-mode) ("\\.ejs\\'" . web-mode)) :config (progn - (setq web-mode-code-indent-offset 4 - web-mode-css-indent-offset 4 - web-mode-markup-indent-offset 4 + (setq web-mode-code-indent-offset 2 + web-mode-css-indent-offset 2 + web-mode-markup-indent-offset 2 web-mode-style-padding 0 web-mode-script-padding 0 web-mode-comment-style 2 @@ -1979,12 +1984,13 @@ Make a shell-script buffer executable after saving it, if it has a shebang. #+BEGIN_SRC emacs-lisp -(add-hook 'after-save-hook - #'executable-make-buffer-file-executable-if-script-p) + (add-hook 'after-save-hook + #'executable-make-buffer-file-executable-if-script-p) -(use-package sh-script - :mode (("\\.zsh\\'" . shell-script-mode)) - :config (setq sh-shell-file "/usr/bin/env zsh")) + (use-package sh-script + :mode (("\\.zsh\\'" . shell-script-mode)) + :config (setq sh-shell-file "/usr/bin/env zsh" + sh-indentation 2)) #+END_SRC #+BEGIN_SRC emacs-lisp