1

I am using spacemacs. When writing .html file, it shows that it is in web-mode. I want to indent, press TAB, but nothing happened. So I can only use SPC to indent.

I added

(setq web-mode-markup-indent-offset 4)
(setq web-mode-css-indent-offset 4)
(setq web-mode-code-indent-offset 4)
(setq web-mode-indent-style 4)

to .spacemacs file, but it did not work. I also tried

(defun my-web-mode-hook ()
  "Hooks for Web mode."
  (setq web-mode-markup-indent-offset 4)
  (setq web-mode-css-indent-offset 4)
  (setq web-mode-code-indent-offset 4)
  (setq web-mode-indent-style 4)
  )
(add-hook 'web-mode-hook  'my-web-mode-hook)

But it did not work either.

So what I should do to make it indent using TAB?

From C-h k tab:

<tab> runs the command spacemacs/emmet-expand, which is an interactive Lisp
function in ‘../../../html/funcs.el’.

It is bound to <tab>, TAB, <hybrid-state> <tab>, <hybrid-state> TAB,
<emacs-state> <tab>, <emacs-state> TAB, <insert-state> <tab>, <insert-state>
TAB.

(spacemacs/emmet-expand)
  • Check to see what the tab key actually does: hit C-h k tab and report back. – Dan Jan 29 '17 at 22:32
  • You should probably add the rest of the docstring for spacemacs/emmet-expand in case anyone knows what it does. My best guess, though, is that the tab key does not indent because that's not what the command does. – Dan Jan 30 '17 at 23:32
  • @Dan Thank you for your suggestions. – Zimou Zhang Jan 31 '17 at 4:51

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.