A single colorcolumn can be set like this:
:set colorcolumn=80
How can I set multiple colorcolumns (e.g., at columns 40 and 80)?
If you are not happy with the color of the colorcolumn , it can be changed easily by setting the color of the ColorColumn highlighting group. To see the list of colors that can be used for the guibg argument, type :help guibg in GVim. A detailed chart of Vim color names can be seen here.
You can display a ruler at a specific line using the :set colorcolumn ( :set cc for short) option which is only available in Vim 7.3 or later. set colorcolumn=80. This will set the background color of that column to red, giving you a visual ruler to work from.
Use commas as delimiters to specify multiple columns, e.g.,
:set colorcolumn=40,80
-or-
:set cc=40,80
will set two colorcolumns, one at column 40 and one at column 80.
Also, +=
and -=
can be used to add/remove columns:
:set cc+=60
:set cc-=80
will add column 60 and remove column 80, so the columns will now be 40 and 60.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With