2
set cc=10 

The simple command for vim version greater than 7.3 can create a red line from top till bottom on the 10th column.
I want to get more info about "set cc=number" such as 'can make the line to be green'?
What file or function or code blocks are called when to input set cc=10 in ex mode?

1

To get info on just set cc try :help 'cc'

There is a lot to talk about on the subject of highlighting.. The reason that I say this is because I am the author of a highlighting plugin and I went through the ringer trying to understand and master the art of highlighting.

My plugin is called vim-poi and has been rewritten once from the original implementation (I'm still torn on which solution I like better but for the purposes of learning highlighting it should be enough to get started)

'cc' can do some cool thing. Taking a look at :help 'cc' as Carpetsmoker mentioned we can see that this is just highlighting under the covers

'colorcolumn' 'cc' string (default "")

      local to window             {not in Vi}             {not available when compiled

without the |+syntax| feature}

'colorcolumn' is a comma separated list of screen columns that are highlighted with ColorColumn |hl-ColorColumn|. Useful to align text. Will make screen redrawing slower. The screen column can be an absolute number, or a number preceded with '+' or '-', which is added to or subtracted from 'textwidth'. >

  :set cc=+1  " highlight column after 'textwidth'        :set cc=+1,+2,+3 

" highlight three columns after 'textwidth' :hi ColorColumn ctermbg=lightgrey guibg=lightgrey

The TLDR of all this is to learn highlighting (:help hi). I'd definitely play around with some more complex ccs and get used to navigating :hi (list of all active highlights) and understanding where they all come from (colorschemes, plugins, etc.)

If you want to read about more of my struggles with more advanced highlighting read here (match/2match vs matchadd struggles)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.