开发者

How to let a .myhtml file has colors as a html file in vim?

开发者 https://www.devze.com 2023-01-08 21:53 出处:网络
I have a html file, it has good colors in vim. But I want to define some custom file types, they have html content, 开发者_如何学Pythonbut with different suffix names. e.g. index.html -> index.myhtml

I have a html file, it has good colors in vim.

But I want to define some custom file types, they have html content, 开发者_如何学Pythonbut with different suffix names. e.g. index.html -> index.myhtml

But when I open "index.myhtml", it has no colors, only black and white.

How to let the vim treat the ".myhtml" as ".html"?

Thanks in advance!


  1. :set filetype=html

  2. write in .vimrc

    au BufNewFile,BufRead *.myhtml set filetype=html

0

精彩评论

暂无评论...
验证码 换一张
取 消