How to show vertical line to wrap the line in Vim?

前端 未结 5 1878
醉话见心
醉话见心 2021-01-29 22:26

I\'m interested in finding a way to show a vertical line at column 80 in Vim (not GVim).

I\'ve used set wrap, but I just want to show a vertical line so I c

5条回答
  •  长发绾君心
    2021-01-29 22:57

    New in Vim 7.3:

    'colorcolumn' is a comma separated list of screen columns that are highlighted with 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'.

    Example from the docs:

    :set colorcolumn=+1        " highlight column after 'textwidth'
    :set colorcolumn=+1,+2,+3  " highlight three columns after 'textwidth'
    :highlight ColorColumn ctermbg=lightgrey guibg=lightgrey
    

    You can use absolute numbers as well:

    :set colorcolumn=80
    

提交回复
热议问题