2012-03-26 188 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