How to change the color of the selected code (Vim scheme)?

后端 未结 5 817
遇见更好的自我
遇见更好的自我 2021-02-03 22:42

How do I change the color of the selected code in Vim?

There are three selection modes, Visual Line mode or Visual Block mode, and selecting wi

5条回答
  •  轻奢々
    轻奢々 (楼主)
    2021-02-03 23:41

    I just change my color scheme file (~/.vim/colors/solarized.vim), and set 'Visual' to the same value as 'CursorLine'.

    I like the style of CursorLine as it is transparent and keep the selected elements's syntax highlight color.

    Replace the line that contains exe "hi! Visual" with the following line:

    exe "hi! Visual"     .s:fmt_uopt   .s:fg_none   .s:bg_base02  .s:sp_base1
    

    or:

    :highlight Visual cterm=NONE ctermbg=0 ctermfg=NONE guibg=Grey40
    

    Like so:

提交回复
热议问题