How do I change the background and foreground colors used by Vim?

Vim uses the “Normal” highlight group for the background and foreground colors. To change the foreground/background colors, you have to modify the “Normal” highlight group. For example, to set the background color to blue and foreground color to white, you can use

    :highlight Normal ctermbg=blue ctermfg=white guibg=blue guifg=white

If you are using the Motif or the Athena version of the GUI Vim, then you can modify the foreground and background resource names in the .Xdefaults files to change the colors:

    Vim.foreground:     Black

    Vim.background:     Wheat

You can also use the “-foreground” and “-background” command-line arguments to specify the foreground and background colors. These arguments are supported only in the Motif or Athena versions:

    $ gvim -foreground Black -background Wheat

Read free Software Algorithms and Computer Science Books by CodeAhoy Learn.

Introduction to Recursion and Backtracking

Sorting Algorithms

Introduction to C Programming Language

And More...

Speak Your Mind