如何更改所选代码的颜色(Vim 方案)? [英] How to change the color of the selected code (Vim scheme)?

查看:40
本文介绍了如何更改所选代码的颜色(Vim 方案)?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何在 Vim 中更改所选代码的颜色?

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

共有三种选择模式,Visual Line 模式或 Visual Block 模式,并用鼠标选择).

There are three selection modes, Visual Line mode or Visual Block mode, and selecting with the mouse).

  hi CursorLine guibg=#DDDDDD gui=none
  hi CursorColumn guibg=#EEEEEE gui=none
  hi MatchParen guifg=#f6f3e8 guibg=#857b6f gui=none
  hi Pmenu   guifg=#f6f3e8 guibg=#DDDDDD gui=none
  hi PmenuSel  guifg=#000000 guibg=#DDDDDD gui=none
endif

" General colors
hi Cursor   guifg=NONE    guibg=#656565 gui=none
hi Normal   guifg=#000000 guibg=#FFFFFF gui=none
hi NonText   guifg=#808080 guibg=#FFFFFF gui=none
hi LineNr   guifg=#857b6f guibg=#FFFFFF gui=none
hi StatusLine  guifg=#000000 guibg=#FFFFFF gui=none
hi StatusLineNC guifg=#857b6f guibg=#FFFFFF gui=none
hi VertSplit  guifg=#444444 guibg=#FFFFFF gui=none
hi Folded   guibg=#AAAAAA guifg=#FFFFFF gui=none
hi Title  guifg=#000000 guibg=NONE gui=none
hi Visual  guifg=#000000 guibg=#FFFFFF gui=none
hi SpecialKey guifg=#808080 guibg=#FFFFFF gui=none

我怎么知道它是哪一行?

How do I know which line it is?

推荐答案

gvim 的选择颜色由以下行设置:

Selection color for gvim is set by the following line:

hi Visual  guifg=#000000 guibg=#FFFFFF gui=none

您可以使用命名颜色值代替#nnnnnn RGB 代码.正如您所观察到的那样,您现有的线条设置为黑色前景和白色背景.

You can use named color values instead of the #nnnnnn RGB codes. Your existing line is set for black foreground and white background, just as you observed.

例如,如果您想要浅蓝色背景和白色前景:

For example, if you want a light blue background with white foreground:

hi Visual  guifg=White guibg=LightBlue gui=none

确保您正在编辑的颜色文件在 vim7x/colors 目录中,以便 vim 和 gvim 都可以找到它.它的确切位置可能会因您的操作系统平台而有所不同.

Be sure the color file you are editing is in the vim7x/colors directory so both vim and gvim can find it. Its exact location can vary a bit depending on your OS platform.

这篇关于如何更改所选代码的颜色(Vim 方案)?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆