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 set in the modeline?
modelines allow you to set variables specific to a file. By default, the first and last five lines are read by vim for variable settings. For example, if you put the following in the last line of a C program, you would get a textwidth of 60 chars when editing that file: /* vim: tw=60 ts=2: */
vim` colorscheme file to the colors folder. Go to vim/mvim and use `colorscheme scheme_name` to use the corresponding colorscheme. To apply the corresponding colorscheme everytime vim/mvim runs, add the `colorscheme scheme_name` to your ~/. vimrc or ~/.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With