The default highlight effect of the vim highlight cursor line is the bottom horizontal line. How to change to background highlight

  question, vim

图片描述

Just like this, the bottom edge hides the symbol and makes writing code uncomfortable. How to set the line background to highlight

Solution

Add the following setup code~/.vimrcThat’s fine. Test the specific color yourself.

Set cursorcolumn "or set cuc sets the column where the cursor is located
 Set cursor line "or setculture sets the line where the cursor is located
 "cterm means that the native vim sets CCTV, and setting to NONE means that the settings can be customized
 "red, white, black, green, yellow, blue, purple,
 "gray, brown, tan, syan
 "for more highlight color settings, you can: h highlight view manual
 "highlight CursorLine   cterm=NONE ctermbg=blue ctermfg=NONE guibg=NONE guifg=NONE
 "highlight CursorColumn cterm=NONE ctermbg=blue ctermfg=NONE guibg=NONE guifg=NONE

Matters needing attention

If you have theme styles, as follows, most theme styles are underlined..vimrcThe style of,The back will cover the front.Therefore, you need to put the highlighted background style behind the theme.

" /usr/sare/vim/vim80/colors
 "colorscheme elflord
 "colorscheme koehler
 "colorscheme pablo
 "colorscheme delek
 "colorscheme evening
 "colorscheme slate
 "colorscheme darkblue
 "colorscheme desert
 "colorscheme industry
 colorscheme murphy
 "colorscheme ron
 "colorscheme torte
 "colorscheme molokai