开发者

Set vim colorscheme in modeline

开发者 https://www.devze.com 2023-01-28 14:25 出处:网络
I\'m trying to set my colorscheme in the modeline.I tried it a few ways, but none of them works.I get an \"Unknown option: colorscheme\" error.

I'm trying to set my colorscheme in the modeline. I tried it a few ways, but none of them works. I get an "Unknown option: colorscheme" error.

# vim: colorscheme dark_foo:set ft=foo:

How can it be 开发者_如何学JAVAset in the modeline?


The modeline consists of option settings. There is no "colorscheme" option. colorscheme is just a command that essentially executes "runtime colors/foo".

You can get an approximation of what you're asking for by creating an autocmd that sets your colorscheme and is triggered by some option that is actually settable in your modeline.


detailing answer of Laurence, example: force js highlighting:

first line of file you want to get the intended highlighting: # vim: ft=javascript

If you want you can then deviate from the default colorscheme via .vimrc:

autocmd FileType javascript colorscheme badwolf

0

精彩评论

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

关注公众号