Select only screen line in vim?

CursorLine backlighting is simple, but is there a way to highlight only the actual line of the screen when the real line is long enough to wrap at least once? When the line is a complete paragraph of prose, highlighting all of this has limited use.

+5
source share
2 answers

The g + move commands work on screen lines instead of real lines, so g 0 v g $ will move the cursor to the beginning of the screen line, turn on the visual select and select the end of the screen line.

0
source

There seems to be no way to do this. Instead, this is what I went. I added the following to the vimrc file:

autocmd FileType markdown set formatoptions=ant autocmd FileType markdown set textwidth=72 autocmd FileType text set formatoptions-=t 

Thus, with markdown and markdown only, each line of the screen is a true line, but they are automatically adjusted.

For the highlight itself, I found the following useful for Solarized dark colorscheme:

 hi CursorLine guifg=White guibg=#012228 ctermfg=White ctermbg=24 

Instead of a lighter background color for the cursor line, it gives a lighter foreground color. In other words, higher contrast, not lower. It is subtle but effective.

0
source

Source: https://habr.com/ru/post/1233003/


All Articles