emacs: set hook variables to be buffer-local
This commit is contained in:
parent
f6f9d1d7b3
commit
aaa1298bf5
1 changed files with 7 additions and 7 deletions
|
@ -57,17 +57,17 @@ One will be created if none exist."
|
||||||
;; hooks
|
;; hooks
|
||||||
(defun indent-common-hook ()
|
(defun indent-common-hook ()
|
||||||
;; set indent width to 4 spaces
|
;; set indent width to 4 spaces
|
||||||
(setq tab-width 4
|
(setq-local tab-width 4
|
||||||
c-basic-offset 4
|
c-basic-offset 4
|
||||||
c-syntactic-indentation nil
|
c-syntactic-indentation nil
|
||||||
c-ts-mode-indent-offset 4
|
c-ts-mode-indent-offset 4
|
||||||
lua-indent-level 4))
|
lua-indent-level 4))
|
||||||
(defun indent-tab-hook ()
|
(defun indent-tab-hook ()
|
||||||
(indent-common-hook)
|
(indent-common-hook)
|
||||||
(setq indent-tabs-mode t))
|
(setq-local indent-tabs-mode t))
|
||||||
(defun indent-spc-hook ()
|
(defun indent-spc-hook ()
|
||||||
(indent-common-hook)
|
(indent-common-hook)
|
||||||
(setq indent-tabs-mode nil))
|
(setq-local indent-tabs-mode nil))
|
||||||
|
|
||||||
(add-hook 'prog-mode-hook 'display-line-numbers-mode)
|
(add-hook 'prog-mode-hook 'display-line-numbers-mode)
|
||||||
(add-hook 'text-mode-hook 'hl-line-mode)
|
(add-hook 'text-mode-hook 'hl-line-mode)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue