While trying to answer my own question I tried some different things and it all worked out by experimenting.
1) I am guessing that "enabling CLICOLOR" means to set it to 1 (i.e. true) because once I set that variable to 1, the LSCOLOR started to work.
2) In this context, "Foreground" means the background highlighting that it will apply. For example, bc for the first pair, means it will color the chars for directories in red while the background/highlighting for it will be green. For example if your environment var is as: export LSCOLORS="bCfxcxdxbxegedabagacad"
then doing ls shows something like this:
Obviously, for this to work the ls command has to be aliased to ls -G (or just do ls -G everytime) and you have to have the following lines in your .bashrc or whatever shell rc file you use:
export CLICOLOR=1
export LSCOLORS="gxfxcxdxbxegedabagacad"
Now you can change the LSCOLORS however you want as specified by the man ls file.
There might be different ways of making this work, but this is how it worked for me on Unix in OS X mavericks on iTerm2.
There is a list of different termcaps global variables that are read by less
; the relevant ones are found in the code as:
tmodes("so", "se", &sc_s_in, &sc_s_out, "", "", &sp);
tmodes("us", "ue", &sc_u_in, &sc_u_out, sc_s_in, sc_s_out, &sp);
tmodes("md", "me", &sc_b_in, &sc_b_out, sc_s_in, sc_s_out, &sp);
tmodes("mb", "me", &sc_bl_in, &sc_bl_out, sc_s_in, sc_s_out, &sp);
The tmodes
function prefixes its first two arguments with LESS_TERMCAP_
and uses the value of the env variable with that name for, as described by user jimmij:
so
standout, se
exit standout,
us
underline, ue
exit underline,
md
bold, me
exit underline,
mb
blinking, me
exit blinking (and underline).
You can have your matches appearing in red using:
$ export LESS_TERMCAP_so=$(echo -e '\e[1;91m')
$ export LESS_TERMCAP_se=$(echo -e '\e[0m')
See this Wikipedia page for more on ANSI escape sequences (including background coloring, bold, ...).
It's worth noting that less
reads much more LESS_TERMCAP_*
variables than just these (for keys, for instance).
Best Answer
There are many color schemes which are usually distributed together with vim. You can select them with the
:color
command.You can see the available color schemes in vim's
colors
folder, for example in my case:I usually use
desert
. So I openvim
, then enter:color desert
and enter. To have the color scheme by default every time you openvim
, add:color desert
into your~/.vimrc
.(Michael, OP) This was good. The terminal looks like: