I use VIM with different types of files, so each time I need to set specific color schemes. Is it possible to pass them as parameters ?
Example: vim colorscheme=desert
Thanks.
You can change color schemes at anytime in vi by typing colorscheme followed by a space and the name of the color scheme. For more color schemes, you can browse this library on the vim website. You can enable or disable colors by simply typing "syntax on" or "syntax off" in vi.
How to Set Default Vim Color Scheme. Changes you have made to the color settings are not permanent. Once you close Vim, the color scheme returns to the default settings. To make the changes permanent, modify Vim's configuration file with the wanted color settings.
View preinstalled color schemes Some color schemes are already installed on your system. You can find those color schemes in the /usr/share/vim/vim*/colors directory as . vim extension.
You can set your preferred color scheme in gvim for MS Windows by editing the file _vimrc in C:\Program Files\Vim or the location where you installed Vim. Save the file and start gvim you will see your color scheme.
vim -c "colorscheme desert" $file
or equally
vim +"colorscheme desert" $file
Note: you can use any command, not only colorscheme
. For more information, see manpage.
Another way is to use autocomand
e.g. in your .vimrc
au BufEnter *.c :colorscheme wombat
au BufEnter *.js :colorscheme desert
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