Is there a way to get a list of all installed color schemes in Vim? That would make very easy to select one without looking at the .vim
directory.
相关问题
- how to split a list into a given number of sub-lis
- C#: How do i get 2 lists into one 2-tuple list in
- F#: Storing and mapping a list of functions
- Select first row from multiple dataframe and bind
- I get an exception when trying to swap elements in
Looking at my system's menu.vim (look for 'Color Scheme submenu') and @chappar's answer, I came up with the following function:
It does the following:
Then to use the function I do something like this:
Which means I prefer the 'solarized' and then the 'darkblue' schemes; if none of them is available, do nothing.
Try
in your
~/.vimrc
.The first two lines make possible matches appear as lists. You can use either or both.
The fourth line makes leader
,
instead of the default\
.The last line allows you to simply type
,c
to get a list and a prompt to change your colorscheme.The third line effectively allows for
Tab
s to appear in key maps.(Of course, all of these strategies I've learned from the internet, and mostly SO, very recently.)
Another simpler way is while you are editing a file -
tabe ~/.vim/colors/
ENTER Will open all the themes in a new tab within vim window.You may come back to the file you were editing using -
CTRL + W + W
ENTERNote: Above will work ONLY IF YOU HAVE a
.vim/colors
directory within your home directory for current$USER
(I have 70+ themes)If you are willing to install a plugin, I recommend https://github.com/vim-scripts/CycleColor.
to cycle through all installed colorschemes. Nice way to easily choose a colorscheme.
Just for convenient reference as I see that there are a lot of people searching for this topic and are too laz... sorry, busy, to check themselves (including me). Here a list of the default set of colour schemes for Vim 7.4:
Here is a small function I wrote to try all the colorschemes in $VIMRUNTIME/colors directory.
Add the below function to your vimrc, then open your source file and call the function from command.