How in vim to set a vertical line through 80 characters from the beginning of characters?

2 answers 2

Write the following line in your .vimrc :

 set colorcolumn=80 

You can set the color of the line by writing the following line before the above command (play around with the color and find the one you need):

 highlight ColorColumn ctermbg=gray 

PS Just in case - if you do not have a .vimrc file, simply create it in your favorite editor in the horse directory of your user (for example: nano ~/.vimrc or vim ~/.vimrc )

    Use : h 'colorcolumn'

    Moreover, you can set this column for a specific file :: h modeline