Skip to main content
Share Your Experience: Take the 2024 Developer Survey

Questions tagged [colorcolumn]

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

Filter by
Sorted by
Tagged with
1 vote
1 answer
94 views

Disable colorcolumn on BufLeave

I would like to disable the colorcolumn in a buffer when switching to a different buffer. I try to perform this with a autocommand using the BufLeave Event. In Neovim I use the following local ...
HeavyWrench's user avatar
1 vote
0 answers
541 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
  • 873
0 votes
1 answer
39 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
357 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
793 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
  • 1,041
1 vote
0 answers
238 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
652 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
230 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
564 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
  • 185
4 votes
2 answers
660 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
  • 227
3 votes
1 answer
1k 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
865 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,397
11 votes
1 answer
8k 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,140
84 votes
6 answers
81k 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