Colorscheme change when filetype changes

大憨熊 提交于 2019-12-03 08:44:49

You should be able to achieve something close to what you want with the following autocommands:

colo <colourscheme1>  "default
autocmd! BufEnter,BufNewFile *.html,*.vim,*xml colo <colourscheme2>
autocmd! BufLeave *.html,*.vim,*xml colo <colourscheme1>

And of course you can modify the list of file extensions as you wish. The colourscheme will be <colourscheme1> by default, or <colourscheme2> if you open (or switch to) any of the specified types, and will revert to <colourscheme1> when you open (or switch to) any other type within a Vim session.

Hope this helps.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!