2012-03-26 84 views
10

如何控制光标当前所在行号的颜色?我可以通过:hi CursorLine通过:hi CursorLine控制线路本身,通过:hi LineNr可以控制整个线路号码,但是我在光标行号码中收到了一个丑陋的黄色(默认为黑色背景)。这是我目前有:vim LineNr和CursorLine颜色配置更改

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

编辑1:下面是截图: enter image description here

编辑2link 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 

回答

23

有新的颜色设置:

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

src/syntax.c

由于soup的意见建议,这条线可以被放置到~/.vimrc这比编辑配色方案,如果从vundle来更容易。当然,修补程序和修补程序的错误报告(可能)会被所述颜色主题的维护者所欣赏。

+1

您可以将此行放在'.vimrc'中,这可能比编辑颜色方案更容易(例如,如果通过'vundler'安装它)。 要查看当前设置的颜色列表,请运行':hi'。来自NonText的'guifg'值是用于其他行号的。 – Soup 2013-03-10 02:48:46

2

就是这样。

您可以控制行号列的颜色(前景和背景),并且可以控制光标行的颜色,但光标行当前所在的行号列没有特定的高亮显示组。

所以,你只需要与两个漂亮的混合物

+0

我添加了一个屏幕快照,显示“问题”,因为我不喜欢那个可怕的黄色。 – Sardathrion 2012-03-26 09:05:48

+0

@Sardathrion - 你可以发布一个链接到那个颜色方案吗? – Rook 2012-03-26 09:20:31

+0

我已将它添加到主要问题。 – Sardathrion 2012-03-26 09:24:27