Javascript indentation in VIM

前端 未结 7 1017
遇见更好的自我
遇见更好的自我 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:20

    For me it works (not very helpful statement, I know ;-) ). I suppose that the filetype is not detected correctly.

    What does

     :set filetype
    

    say? It should report "javascript".

    [EDIT] Hint: Please note that there is an option called 'filetype' and a command called :filetype. To get help for the option do :help 'filetype' for the command do :help :filetype.

提交回复
热议问题