When I'm using the Vim plugin CtrlP I have a hard time seeing which file is being highlighted as the current file I might open. I want the highlight line to be bright and vivid.
I could change the color of my CursorLine setting but I don't want it to change everywhere. When I'm normally editing files I want my highlight cursor line to be a subtle background-ish color.
How can I change the color of only the highlight line in the CtrlP file selection buffer?
I got a lead on a fix in this GitHub issue asking a similar question.
CtrlP offers a setting called ctrlp_buffer_func
that lets you set a function to call every time CtrlP is loaded and when it exits. In my .vimrc file, I just set the highlight color to a bright and vivid color on CtrlP load, and then set it back to my default when I exit CtrlP.
let g:ctrlp_buffer_func = { 'enter': 'BrightHighlightOn', 'exit': 'BrightHighlightOff', }
function BrightHighlightOn()
hi CursorLine guibg=darkred
endfunction
function BrightHighlightOff()
hi CursorLine guibg=#191919
endfunction
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With