Home  >  Q&A  >  body text

Line breaks cannot be indented when editing HTML files in vim

When vim edits HTML files, line breaks cannot be automatically indented. This makes me have to manually indent every time I change a line. I searched online for a long time and couldn't find the answer. So I came to help you.
Already added in vimrc:

filetype plugin indent on
set autoindent
set smartindent

In other types of files (such as PHP and JS, automatic indentation and newline indentation are available), but it is invalid in HTML files. Has anyone encountered the same problem as me? Solve. . .

黄舟黄舟2734 days ago614

reply all(1)I'll reply

  • 曾经蜡笔没有小新

    曾经蜡笔没有小新2017-05-16 16:43:39

    filetypeHave you set it up?

    filetype plugin indent on
    

    reply
    0
  • Cancelreply