Questions tagged [colorcolumn]

A comma separated list of screen columns that are highlighted with hl-ColorColumn.

Filter by
Sorted by
Tagged with
1 vote
0 answers
111 views

Can you set multiple colorcolumns with different colors?

I use something like this to warn me when I'm getting to a line length of 90-ish: set textwidth=92 ░░░░ set colorcolumn=-0,-1,-2,-3 ░░░░ hi ...
Jacktose's user avatar
  • 823
0 votes
1 answer
35 views

How to check the color code of my line numbering?

I currently have the setting set colorcolumn enabled in my config file, and I have found out that I can change it using highlight ColorColumn guibg=#hexcode. I want the coloring of the column to match ...
OrientalMagician's user avatar
0 votes
1 answer
249 views

Setting `colorcolumn` to the value of `textwidth` has no effect?

I want to mark the textwidthth column using colorcolumn and have used the following (since I have slightly different textwidths for different files) au FileType py set textwidth=80 (say line 98) au ...
First User's user avatar
4 votes
1 answer
550 views

How do I stop the colorcolumn from breaking into multiple pieces when there are wrapped lines?

The colorcolumn works well when there are no wrapped lines. set colorcolumn=80: However, when there are long lines that are wrapped, the colorcolumn breaks into multiple pieces: Is there a way to ...
Flux's user avatar
  • 941
1 vote
0 answers
193 views

Highlight color columns on top of folds (not below)

I'm highlighting folds and color columns in colors different from the background and from each other. Here's an excerpt of my vimrc with all (potentially) relevant lines: " ~/.vimrc ... " Folding ...
flotzilla's user avatar
  • 333
1 vote
2 answers
498 views

Is it possible to use colorcolumn on specific lines only

I am using a vimscript to "highlight" columns of interest in some text. However, using colorcolumn "highlights" the entire column on every row in the file. Is there a good way to define start and end ...
Avi's user avatar
  • 11
0 votes
1 answer
222 views

Highlighting screen positions, or `:set colorcolumn` only for the 2 bottom and top lines visible on the screen

The option colorcolumn is really useful. I would like a similar result to what it yields but only for the two lines that are at the top and the bottom of the screen (not the document, but the screen). ...
Godoy's user avatar
  • 69
6 votes
1 answer
2k views

Function to toggle set colorcolumn

I like the set colorcolumn=80 option which highlights the column at 80 characters, however I find it annoying when working with multiple split windows. I'd like to have an option to enable or disable ...
Zoltan King's user avatar
0 votes
2 answers
473 views

How do I get a specific colorcolumn value?

I've discovered the wonder that is colorcolumn but I haven't yet mastered the black art of Vim scripting. If I have :set colorcolumn=80,132 in my .vimrc, how can I a) discover that I have more than ...
LiamF's user avatar
  • 173
4 votes
2 answers
612 views

How do I get consistent behavior with matchadd color column?

After watching Damian Conway's talk, I added the following two lines to my .vimrc. highlight ColorColumn ctermbg=magenta call matchadd('ColorColumn', '\%81v', 100) My objective is to get the 81st ...
merlin2011's user avatar
4 votes
1 answer
2k views

Insert character until column number

I'd like to define a vim command with the following functionality. 60<F7>= insert = at the end of the line until the line become 60 characters long. <F7>* insert * until the line becomes ...
SU3's user avatar
  • 209
2 votes
1 answer
929 views

Set colorcolumn to textwidth only when textwidth is set

I want colocolumn to be 80 by default for all buffers, but if textwidth is set (and not 0) for a buffer, then I want colorcolumn to be +0. I know this could be done by just setting tw to 80 in my ....
Patrick Ziegler's user avatar
1 vote
0 answers
782 views

How to color the column right after the line numbers and before the beginning of line?

Would be nice to color the single column just left of the beginning of the line, but I don't think it has a group name like CursorLine. Anyone have any ideas? Maybe some simple macro would do, using ...
Luke Davis's user avatar
  • 1,327
11 votes
1 answer
7k views

How to deactive colorcolumn quickly in different situation?

I have read the manual in vim with :h cc or h: 'cc', but I found nothing about how to remove the red lines. First use case I create the red line with this command: :set cc=1,5,9,13,17,21 With the ...
showkey's user avatar
  • 1,056
82 votes
6 answers
73k views

How can I set up a ruler at a specific column?

When coding in different languages, I tend to need to restrict my lines to a specific length (usually 79 or 80 characters). I've seen this done in other editors through the use of a ruler (solid line ...
Kevin Brown-Silva's user avatar