emacs: refactor indent hooks
This commit is contained in:
parent
adb0b0e0ce
commit
66d309e407
1 changed files with 7 additions and 8 deletions
|
@ -65,23 +65,22 @@
|
|||
(defun indent-tab-hook ()
|
||||
(indent-common-hook)
|
||||
(setq-local indent-tabs-mode t))
|
||||
(defun indent-spc-hook ()
|
||||
(defun indent-spc-hook (&optional w)
|
||||
(or w (setq w 4))
|
||||
(indent-common-hook)
|
||||
(setq-local indent-tabs-mode nil))
|
||||
(setq-local indent-tabs-mode nil
|
||||
tab-width w))
|
||||
|
||||
(add-hook 'prog-mode-hook 'display-line-numbers-mode)
|
||||
(add-hook 'text-mode-hook 'hl-line-mode)
|
||||
|
||||
(add-hook 'prog-mode-hook 'indent-tab-hook)
|
||||
(add-hook 'sgml-mode-hook 'indent-spc-hook)
|
||||
(add-hook 'nix-mode-hook #'(lambda ()
|
||||
(indent-spc-hook)
|
||||
(setq-local tab-width 2)))
|
||||
(add-hook 'd-mode-hook 'indent-tab-hook)
|
||||
(add-hook 'nix-mode-hook #'(lambda () (indent-spc-hook 2)))
|
||||
|
||||
(defun lisp-hook ()
|
||||
(indent-spc-hook)
|
||||
(keymap-local-set "C-c l" 'common-lisp-hyperspec)
|
||||
(setq-local tab-width 2))
|
||||
(indent-spc-hook 2))
|
||||
(add-hook 'lisp-mode-hook 'lisp-hook)
|
||||
(add-hook 'lisp-data-mode-hook 'lisp-hook)
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue