Skip to main content
12 votes
Accepted

Change Cursorline Style

The style of these two settings is defined by the CursorLine and CursorColumn highlight groups. If I query these two on my Vim, I get: :hi CursorColumn CursorColumn xxx term=reverse ctermbg=242 ...
filbranden's user avatar
  • 29k
9 votes
Accepted

How to highlight cursor line number without cursor line?

You need these three lines: hi CursorLineNr guifg=#af00af set cursorline set cursorlineopt=number The last line removes the highlighting of the cursor line even if cursorline is set and only ...
Jürgen Krämer's user avatar
8 votes
Accepted

SpecialKey foreground color w/ cursorline set

I've been struggling with that behavior for a long time. Basically, the foreground color of SpecialKey on the current line is changed to the foreground color of Normal if: the cursorline option is ...
romainl's user avatar
  • 41.2k
5 votes
Accepted

Automatically disable cursorline when in diff mode?

One would expect, that the OptionSet autocommand is triggered when entering diff mode. Unfortunately that is currently not the case. So I created a patch that will enable this behavior. Once it is ...
Christian Brabandt's user avatar
5 votes

How to change the cursor line higlighting only for one window (namely the quickfix one)?

Patch 8.0.0641 introduced a separate highlight group for the quickfix line, called QuickFixLine. With patch 8.0.0653 this group is linked to the Search highlight by default, because for some color ...
Jürgen Krämer's user avatar
3 votes
Accepted

no longer can underline current cursor

As you can see from the output of :verbose :hi CursorLine, your CursorLine setting is reset by the colorscheme you are using. There are a couple of approaches you can use to change that. Simply ...
Christian Brabandt's user avatar
3 votes

Vim does not redraw screen and cursorlines remain drawn

One dumb solution I find is to type :!clear in vim, but this is just a temporary solution. I am yet to find a better solution. Are you able to fix your issue?
Danyang Su's user avatar
2 votes
Accepted

Enable cursorline and cursorcolumn after Quickfix window is opened

Create the file in ~/.vim/ftplugin/qf.vim (or $HOME/vimfiles/ftplugin/qf.vim if you are on Windows) with the following contents: " Only do this when not done yet for this buffer if exists("b:...
mMontu's user avatar
  • 6,670
2 votes

SpecialKey foreground color w/ cursorline set

What worked for me was the following lines in my .vimrc (based on Igor Mikushkin's answer). autocmd BufNewFile,BufRead * call matchadd('SpecialKey', '\s\+') autocmd BufNewFile,BufRead * call matchadd(...
Nizar Khalife Iglesias's user avatar
2 votes
Accepted

Isolate a matched virtual column ruler to the cursorline only?

Try the following two commands: " Match when cursor before column matchadd('ColorColumn', '\%#.*\zs\%81v', 100) " Match when cursor after column matchadd('ColorColumn', '\%81v\ze.*\%#', 100) It ...
Rich's user avatar
  • 32.2k
2 votes

Cursorline/Columnline slowdown

As @Christian Brabandt pointed out in the comment this is a known issue and there might not be a lot of solutions, for now, to make cursorline work properly. However, you can use different ...
statox's user avatar
  • 50.1k
2 votes
Accepted

Enable cursorline only in preview window?

:h BufWinEnter is the event: :autocmd! BufWinEnter * if &previewwindow | setlocal cursorline | endif I guess the discrepancy is because WinEnter is triggered before 'previewwindow' is set. ...
idbrii's user avatar
  • 661
2 votes

How to set CursorLine highlight color for the gruvbox colorscheme

What works for me, in your .vimrc first set your colorscheme, then your desired highlight: colorscheme gruvbox highlight Cursorline whatever_you_like That way your colorscheme won't clobber your ...
PeterVP's user avatar
  • 161
2 votes
Accepted

How to set cursor position in a popup buffer?

Your example is trying to mimic popup menu by popup window, it's complicate, I changed it to use arrow keys to scroll popup window in normal mode, it's only purpose is to show you how to change cursor ...
dedowsdi's user avatar
  • 6,288
1 vote
Accepted

Change the color of CursorLine underline

The answer depends whether you use the graphical user interface or the terminal user interface. For either UI, the underdotted attributes may not be available as descibed in :help attr-list or :help ...
Friedrich's user avatar
  • 2,239
1 vote

How can I still see underscores with cursorline?

I actually went with coloring the background of the line number. This way you're not interfering with syntax colors or underscores. So basically I have this (for light background terminal) highlight ...
xicod's user avatar
  • 21
1 vote

How do I use `set cursorline` but keep background color highlights e.g. in quickfix window

The CursorLine highlighting group defines how the current line will be highlighted, once :set cursorline is enabled. As you have noticed, it contains an option for setting the background color. If ...
Christian Brabandt's user avatar
1 vote
Accepted

How to set CursorLine highlight color for the gruvbox colorscheme

Appearently this line set termguicolors overrides the highlight color. removing it let me configure the CursorLine highlight color again.
stimulate's user avatar
  • 171
1 vote

Is there anyway to let cursorline take care of the visual tabs generated by 'breakindent'?

This is not possible as of today. The reason most likely is, that the non-highlighted indented part is actually only a representation and does not really exist in the file. I am not sure it makes ...
Christian Brabandt's user avatar
1 vote

How to change the cursor line higlighting only for one window (namely the quickfix one)?

currently I solved it this way (though I would be very grateful if someone suggested a better way). I created a syntax highlihgt file for the qf syntax ~/.vim/after/syntax/qf.vim. There I defined: ...
d.k's user avatar
  • 696
1 vote

SpecialKey foreground color w/ cursorline set

Following lines in .vimrc fixed the problem for me. au VimEnter * call matchadd('SpecialKey', '^\s\+', -1) au VimEnter * call matchadd('SpecialKey', '\s\+$', -1) It overrides other styles ...
Igor Mikushkin's user avatar

Only top scored, non community-wiki answers of a minimum length are eligible