Limiting a match in vim to certain filetypes?

前端 未结 2 944
孤城傲影
孤城傲影 2021-01-17 22:20

I have the following in my .vimrc to highlight lines longer than 80 chars:

highlight OverLength ctermbg=red ctermfg=white guibg=#592929
match OverLength /\\%         


        
2条回答
  •  Happy的楠姐
    2021-01-17 22:25

    Sounds like you might want something like:

    autocmd FileType html,xml highlight OverLength ctermbg=red ctermfg=white guibg=#592929
    autocmd FileType html,xml match OverLength /\%81v.*/
    

    Seems to work for me anyway :-)

提交回复
热议问题