Vim: gg=G aligns left, does not auto-indent

前端 未结 2 1256
不知归路
不知归路 2020-12-06 11:17

When I try to fix the indentation of an HTML file with gg=G, each line loses its indentation and becomes left-justified. Does anybody know what could be going o

相关标签:
2条回答
  • 2020-12-06 11:40

    maybe he does not recognize it is html. Can you see syntax highlight?. Could you show your file + filename?

    €: Please change the following: filetype plugin on -> filetype plugin indent on

    Hope this solves it. regards

    0 讨论(0)
  • 2020-12-06 11:42

    You need to enable loading of indentation files for specific filetypes. Change this line in your .vimrc...

    filetype plugin on
    

    ..to this:

    filetype plugin indent on
    

    ...then restart Vim and try again.

    See :help filetype-indent-on for more details.

    0 讨论(0)
提交回复
热议问题