Over a million developers have joined DZone.
{{announcement.body}}
{{announcement.title}}

Fixing vim Editor for Dark Backgrounds so Comments Are Not Dark Blue

DZone's Guide to

Fixing vim Editor for Dark Backgrounds so Comments Are Not Dark Blue

Most developers know the pain that is opening up vim with the default settings, especially when it comes to viewing comments. Check out a quick fix that can help alleviate that pain.

· Web Dev Zone ·
Free Resource

Deploying code to production can be filled with uncertainty. Reduce the risks, and deploy earlier and more often. Download this free guide to learn more. Brought to you in partnership with Rollbar.

Here is a simple command that can fix your vim editor for dark backgrounds so that your comments are not showing up in dark blue (unreadable).

Example screenshot:

vim-example










The temporary fix is to run the following command in the vim editor:

:set background=dark

Instead of:

:set background=light

The permanent fix for this is to add the command inside $HOME/.vimrc file:

:set background=dark

Please note that when you’re adding the property into the .vimrc file, you do not need to prefix it with “:”

Cheers!

Deploying code to production can be filled with uncertainty. Reduce the risks, and deploy earlier and more often. Download this free guide to learn more. Brought to you in partnership with Rollbar.

Topics:
vim ,editor ,vimrc ,comments ,color

Published at DZone with permission of

Opinions expressed by DZone contributors are their own.

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}