Syntax Highlighting In VIm

1
45

Syntax highlighting in vim can be super tricky, by default a lot of desktop environments seem to have white terminals, which is a bit dumb as it’s easier to read white on black than black on white, as such the default vim syntax highlighting is often unreadable if you have a black terminal, giving blue comments on a black background and the like.

The fix for this is to set your vim background to dark, e.g.


set background=dark

You can either set this on a per session basis, but as I always use black terminals I’ve set this in my .vimrc file in my home directory.

Learning the vi and Vim Editors

Learning the vi And Vim Editors is a great book thoroughly covering both editors and the incredible power they contain. There’s a reason it’s been one of the most popular editors in the world since 1979!

  • James Grant

    If you’re in a hurry you can just do set bg=dark too