3

I have the following customizations in my .spacemacs file

(defun dotspacemacs/layers ()
   dotspacemacs-additional-packages '(smart-tabs-mode))

(defun dotspacemacs/user-config ()

  (setq-default font-latex-fontify-script nil)

  (add-hook 'LaTeX-mode-hook
            (lambda ()
              (setq indent-tabs-mode t
                    indent-line-function 'indent-relative)
              (smart-tabs-mode-enable)
              (smart-tabs-advice indent-relative tab-width)
              (electric-indent-mode -1)
              )))
  )

I use indent-relative since Latex-mode does not use tabs at all apparently (see How can I configure AUCTeX to use tab characters for leading indentation?).

If, in LaTeX-mode, I indent a line with an indentation that starts with a tab and is followed by spaces, and then hit Enter + Tab, smart-tabs-mode takes care that the next line will be indented exactly the same way, i.e. the combination of tabs and spaces ist preserved.

However, if I use newline-and-indent to get a newline (or leave electric-indent-mode on), the indentation is spaces only. Is that a limitation of smart-tabs-mode or am I missing something?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.