Fix tabs in nix files
This commit is contained in:
parent
b05bcb1473
commit
e80b231881
12
init.el
12
init.el
|
@ -34,18 +34,14 @@
|
||||||
mouse-wheel-follow-mouse +1
|
mouse-wheel-follow-mouse +1
|
||||||
scroll-step 1) ;; C-n C-p scroll step
|
scroll-step 1) ;; C-n C-p scroll step
|
||||||
|
|
||||||
;; Tabs
|
|
||||||
(setq custom-tab-width 2)
|
|
||||||
|
|
||||||
;; Highlight matching parens faster
|
;; Highlight matching parens faster
|
||||||
(setq show-paren-delay 0)
|
(setq show-paren-delay 0)
|
||||||
|
|
||||||
|
(setq tab-width 2)
|
||||||
(defun disable-tabs ()
|
(defun disable-tabs ()
|
||||||
(indent-tabs-mode -1))
|
(indent-tabs-mode -1))
|
||||||
(defun enable-tabs ()
|
(defun enable-tabs ()
|
||||||
(local-set-key (kbd "TAB") 'tab-to-tab-stop)
|
(indent-tabs-mode +1))
|
||||||
(indent-tabs-mode +1)
|
|
||||||
(setq tab-width custom-tab-width))
|
|
||||||
|
|
||||||
(add-hook 'prog-mode-hook 'enable-tabs)
|
(add-hook 'prog-mode-hook 'enable-tabs)
|
||||||
(add-hook 'lisp-mode-hook 'disable-tabs)
|
(add-hook 'lisp-mode-hook 'disable-tabs)
|
||||||
|
@ -147,7 +143,9 @@
|
||||||
|
|
||||||
;; Nix support
|
;; Nix support
|
||||||
(use-package nix-mode
|
(use-package nix-mode
|
||||||
:mode "\\.nix\\'")
|
:mode "\\.nix\\'"
|
||||||
|
:config
|
||||||
|
(add-hook 'nix-mode-hook 'disable-tabs))
|
||||||
|
|
||||||
;; Treesitter based navigation
|
;; Treesitter based navigation
|
||||||
(use-package evil-textobj-tree-sitter
|
(use-package evil-textobj-tree-sitter
|
||||||
|
|
Loading…
Reference in a new issue