vim LineNr 和 CursorLine 颜色配置更改

标签 vim colors

如何控制光标当前所在行号的颜色?我可以通过 :hi CursorLine 控制行本身,并通过 :hi LineNr 控制行本身,但我的光标出现了丑陋的黄色(深色背景中的默认值)电话号码。这是我目前拥有的:

hi CursorLine     guibg=#222222 gui=none
hi LineNr         ctermfg=DarkMagenta guifg=#2b506e guibg=#000000 

编辑 1:这是屏幕截图: enter image description here

编辑 2:link to the colour scheme .

编辑 3:Vim 版本 7.3.480。

编辑4:所有版本信息:

VIM - Vi IMproved 7.3 (2010 Aug 15, compiled Mar 26 2012 08:41:12)
Included patches: 1-480
Compiled by XXX
Normal version with GTK2 GUI.  Features included (+) or not (-):
-arabic +autocmd +balloon_eval +browse +builtin_terms +byte_offset +cindent
+clientserver +clipboard +cmdline_compl +cmdline_hist +cmdline_info +comments
-conceal +cryptv -cscope +cursorbind +cursorshape +dialog_con_gui +diff +digraphs
+dnd -ebcdic -emacs_tags +eval +ex_extra +extra_search -farsi +file_in_path
+find_in_path +float +folding -footer +fork() +gettext -hangul_input +iconv
+insert_expand +jumplist -keymap -langmap +libcall +linebreak +lispindent
+listcmds +localmap -lua +menu +mksession +modify_fname +mouse +mouseshape
-mouse_dec +mouse_gpm -mouse_jsbterm -mouse_netterm -mouse_sysmouse +mouse_xterm
-mouse_urxvt +multi_byte +multi_lang -mzscheme +netbeans_intg +path_extra -perl
+persistent_undo +postscript +printer -profile +python -python3 +quickfix +reltime
 -rightleft -ruby +scrollbind +signs +smartindent -sniff +startuptime +statusline
-sun_workshop +syntax +tag_binary +tag_old_static -tag_any_white -tcl +terminfo
+termresponse +textobjects +title +toolbar +user_commands +vertsplit +virtualedit
+visual +visualextra +viminfo +vreplace +wildignore +wildmenu +windows
+writebackup +X11 -xfontset +xim +xsmp_interact +xterm_clipboard -xterm_save
   system vimrc file: "$VIM/vimrc"
     user vimrc file: "$HOME/.vimrc"
      user exrc file: "$HOME/.exrc"
  system gvimrc file: "$VIM/gvimrc"
    user gvimrc file: "$HOME/.gvimrc"
    system menu file: "$VIMRUNTIME/menu.vim"
  fall-back for $VIM: "/home/XXX/share/vim"
Compilation: gcc -c -I. -Iproto -DHAVE_CONFIG_H -DFEAT_GUI_GTK  -pthread -I/usr/inc
lude/gtk-2.0 -I/usr/lib64/gtk-2.0/include -I/usr/include/atk-1.0 -I/usr/include/cai
ro -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/pango-1.0 -I/usr/include/glib-2.0 -
I/usr/lib64/glib-2.0/include -I/usr/include/pixman-1 -I/usr/include/freetype2 -I/us
r/include/libpng12   -I/usr/local/include  -g -O2 -U_FORTIFY_SOURCE -D_FORTIFY_SOUR
CE=1
Linking: gcc   -L/usr/local/lib -Wl,--as-needed -o vim   -pthread -lgtk-x11-2.0 -lg
dk-x11-2.0 -latk-1.0 -lgio-2.0 -lpangoft2-1.0 -lpangocairo-1.0 -lgdk_pixbuf-2.0 -lc
airo -lpango-1.0 -lfreetype -lfontconfig -lgobject-2.0 -lgmodule-2.0 -lgthread-2.0
-lrt -lglib-2.0   -lSM -lICE -lXpm -lXt -lX11 -lXdmcp -lSM -lICE -lm -ltinfo -lnsl
 -lselinux  -lacl -lattr -lgpm -ldl     -L/usr/lib64/python2.7/config -lpython2.7 -
lpthread -ldl -lutil -lm -Xlinker -export-dynamic  

最佳答案

有一个新的颜色设置:

hi CursorLineNr   term=bold ctermfg=Yellow gui=bold guifg=Yellow

参见src/syntax.c

soup评论中建议,可以将此行放入 ~/.vimrc 中,如果它来自 vundle,这比编辑配色方案更容易。当然,带有补丁和修复的错误报告(可能)会受到所述颜色主题的维护者的赞赏。

关于vim LineNr 和 CursorLine 颜色配置更改,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9869057/

相关文章:

functional-programming - Vim脚本中的 "reduce"函数

Vim 搜索所有现有缓冲区

python - 我如何确定 vim 缓冲区是否已从 vim 的 python api 中列出或未列出?

windows - 使用 AutoHotKey (AHK) 创建类似 Vim 的功能

python - 找到两种颜色之间的交线

r - 具有 ggplot2 较低级别图的多种颜色缩放

vim - Vimscript检查当前缓冲区是否有未保存的更改

python - HTML : text colour in automatic generated email with python

java - 反转相反的颜色

java - 如何在android中为应用程序的背景着色