Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

vim LineNr and CursorLine colour configuration change

Tags:

vim

colors

How do I control the colour of the line number that the cursor is currently on? I can control the line itself via :hi CursorLine and the whole line numbers via :hi LineNr but I am getting an ugly Yellow (the default in dark background) for the cursor line number. This is what I currently have:

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

Edit 1: Here is a screenshot: enter image description here

Edit 2: link to the colour scheme.

Edit 3: Vim version 7.3.480.

Edit 4: All the version information:

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  
like image 464
Sardathrion - against SE abuse Avatar asked Mar 26 '12 08:03

Sardathrion - against SE abuse


2 Answers

There is a new colour setting:

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

See src/syntax.c.

As soup suggested in the comments, this line can be placed into the ~/.vimrc which would be easier than editing a colour scheme if it came from vundle. Of course, a bug report with patch and a fix would (probably) be appreciate by the maintainers of said colour theme.

like image 103
Sardathrion - against SE abuse Avatar answered Oct 18 '22 18:10

Sardathrion - against SE abuse


That's it.

You can control the color (fore and background) of the line number columns, and you can control the color of the cursorline, but there is no specific highlighting group for the line number column the cursor line is currently on.

So, you'll just have to do with the nice mixture of the two.

like image 25
Rook Avatar answered Oct 18 '22 20:10

Rook