Persistent :set syntax for a given filetype?

后端 未结 4 1087
失恋的感觉
失恋的感觉 2021-01-30 07:52

I\'m working on a Symfony2 project which uses Twig, and the filetypes are myfile.html.twig. Vim doesn\'t automatically detect the syntax highlighting and so applies

4条回答
  •  余生分开走
    2021-01-30 08:42

    You can use autocmd to accomplish that, i.e.:

    augroup twig_ft
      au!
      autocmd BufNewFile,BufRead *.html.twig   set syntax=html
    augroup END
    

    Should work.

提交回复
热议问题