In the Linux world, vim
is one of the more popular editors, at least once people get past their initial encounter with it. Once you have got used to it, it becomes an incredibly powerful editor with a plethora of configuration options, extensions, plugins and more.
One of its features is syntax highlighting, showing the different elements of (usually) program source code in different colours. vim
ships with a number of colour schemes and, as is the way with Open Source in particular, there are hundreds (thousands?) more vim
colour schemes available that others have put together.
Sometimes choice is a bad thing. If there were only two colour schemes available, we’d all pick our favourite pretty quickly and just get on with editing. But there are lots to choose from, and we can customise them further if we want. Whether the hours spent fine-tuning a vim
colour configuration ever pay off is beyond the scope of this Linux Tip…
Making The Choice Easier
In the meantime, if you want to explore some of the colour schemes available, and even customise them using a GUI, take a look at the Vivify website. Here, you can select from literally hundreds of vim
colour schemes. You can preview them displaying code in various languages, including Python, Ruby, C++, Javascript, HMTL, bash and more. You can choose to change the saturation, hue or shade of any colour scheme, or click on an element to customise how that one will be displayed. Once it’s to your liking, you can download the file (typically to ~/.vim/colors
) and use it (the :colorscheme NAME
command in vim
).
Could This Linux Tip Be Improved?
Let us know in the comments below.
I use colorscheme but usually built in schemes such as koehler.
I found that having files in ~/.vim/colors only works either by naming the file SOME_NAME*.vim* (i.e. “:colorscheme my_scheme” doesn’t work unless the file has a .vim extension).
The other way (which still doesn’t allow you to use “:colorscheme my_scheme” if no extension is in use) is to symlink the file to ~/.vim/plugin/setcolors.vim in which case it will be loaded by default.