Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [colorcolumn]

A comma separated list of screen columns that are highlighted with [`hl-ColorColumn`](http://vimdoc.sourceforge.net/htmldoc/syntax.html#hl-ColorColumn). See [`:h 'colorcolumn'`](http://vimdoc.sourceforge.net/htmldoc/options.html#%27colorcolumn%27).

0
votes
1answer
45 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). ...
1
vote
1answer
145 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 ...
0
votes
2answers
121 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 ...
4
votes
2answers
283 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 ...
2
votes
1answer
516 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 ...
1
vote
1answer
347 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 ....
0
votes
0answers
429 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 ...
4
votes
1answer
2k 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 ...
46
votes
3answers
23k 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 ...