From ec1fe76304c5cc4834bdedde269638cd660658c3 Mon Sep 17 00:00:00 2001 From: Jeremy Dormitzer Date: Fri, 31 Jan 2020 11:19:04 -0500 Subject: [PATCH] Disable tabs in python and js mode --- emacs/init.org | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/emacs/init.org b/emacs/init.org index 4d37434..8d9125b 100755 --- a/emacs/init.org +++ b/emacs/init.org @@ -2036,6 +2036,13 @@ Syntax checking etc.: ((normal motion visual) flycheck-mode-map "ze" 'hydra-flycheck/body)) #+END_SRC +* Tabs +#+BEGIN_SRC emacs-lisp + (defun disable-tab-insert () + (interactive) + (setq indent-tabs-mode nil)) +#+END_SRC + * JSON #+BEGIN_SRC emacs-lisp (use-package json-mode @@ -2080,7 +2087,8 @@ Some formatting stuff: (web-mode-set-content-type "jsx")) (when (or (equal web-mode-content-type "javascript") (equal web-mode-content-type "jsx")) - (lsp))))) + (lsp)))) + (add-hook 'web-mode-hook #'disable-tab-insert)) #+END_SRC Use nvm to manage node versions: @@ -2210,6 +2218,7 @@ Emacs support for the Language Server Protocol #+BEGIN_SRC emacs-lisp ;; (leader-def-key "sp" #'elpy-shell-switch-to-shell) (leader-def-key "sp" #'run-python) + (add-hook 'python-mode-hook #'disable-tab-insert) #+END_SRC Elpy is a python IDE package: