Javascript indentation in VIM

前端 未结 7 1000
遇见更好的自我
遇见更好的自我 2021-02-02 15:46

I\'m trying to get VIM to indent Javascript with the \'=\' and related commands. When I try to auto indent the following, for example:

   new function($) {
              


        
7条回答
  •  醉梦人生
    2021-02-02 16:25

    I was having problems the other day with MacVim 7.2 and a Lua file that wouldn't indent correctly -- even after using set syntax, set filetype and filetype indent on, it wasn't indenting the file correctly.

    I discovered adding:

    filetype plugin indent on
    

    to my .gvimrc file solved the issue, at least for me. YMMV.

提交回复
热议问题