'Getting all the installed color schemes in Vim

I'm using vim to edit a php. I would like to get all the installed color schemes in Vim. I know that some members have asked this question, but the accepted solutions there did not help.

I tried:

:colorscheme then Space followed by TAB.

No colors shows up when I hit TAB. Should I install something to get the colorscheme work?



Solution 1:[1]

Color schemes are stored under your 'runtimepath' + /colors/*.vim. e.g. The default scheme is store at $VIMRUNTIME/colors/default.vim.

Two ways of getting a list of all colorschemes:

  • :echo globpath(&rtp, 'colors/*.vim')
  • :colorscheme followed by space then ctrl+d

If you are not getting a list of colors then you may want to check if to make sure you don't have a tiny version of vim. You can check this by running :version. You can also run :echo has('eval') to make sure you can run colorschemes.

For more information see:

:h 'runtimepath'
:h :colors
:h globpath(
:h cmdline-completion
:h c_CTRL-D

Solution 2:[2]

I believe you just need to turn the syntax on try: :syntax on

Solution 3:[3]

My system: Debian bullseye (11), vim :version states 8.1
Type this inside vim ..

:colorscheme + desert + Enter sets color scheme to "desert" (for this session/opened-file only)
:colo desert Is just shortcut to colorscheme, my favorite decent one and available on any linux I used so far. Default darkblue, or what it is has comment lines almost unreadably dark. IMHO bad choice of default one.

:colorscheme + Tab cycles through schemes a-z
:colorscheme + Shift-Tab cycles through schemes z-a
:colorscheme + Ctrl-d show all schemes

:colorscheme
blue       default    desert     evening    koehler    murphy     peachpuff  shine      torte
darkblue   delek      elflord    industry   morning    pablo      ron        slate      zellner

Alternatively see them as preinstalled files: $ ls –l /usr/share/vim/vim*/colors

To make it more permanent and do not need to set colorscheme in every opened document ('desert' is just selected colorscheme here):
echo "colorscheme desert" >> .vimrc

More color schemes can be found (with examples) on pages like https://vimcolorschemes.com/ and so on GitHub as .vim files. There might be specific installation options per your VIM version, Wiki of the package should help.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1
Solution 2 Leroy_Brown
Solution 3