Vim: select the highlighted quick selection line with a color other than "Search",

What is the highlighted group for the currently selected row in the quick delete window?

The selected line in the quickfix window uses Search to highlight. I would like to continue to use yellow to highlight Search , but use blue for the highlighted line for quick deletion.

+4
source share
2 answers

The currently selected quick fix item is hardcoded to Search . You will need to modify the Vim source code and recompile to change this.

I see only limited ways to get around this with Vimscript. You can try to override the selection of the current line with :match / matchadd() (has a higher priority), but it will cover only the length of the text, and not the entire line of the original highlight. In addition, I think that the current selected item cannot be easily requested from Vim, so you will need to connect to the local fastfix-local <CR> mapping and stop using it :cnext , etc. To go to different mistakes.

 :highlight BlueLine guibg=Blue :autocmd BufReadPost quickfix match BlueLine /\%1l/ :autocmd BufReadPost quickfix nnoremap <buffer> <CR> :execute 'match BlueLine /\%' . line('.') . 'l/'<CR><CR> 
+4
source

Answer Ingo Karkat is right. It is really hardcoded in vim code. I created a patch - QuickFixCurrentLine.patch for vim8.

The patch is long enough to fit here. In addition, it has a combination of tabs and spaces. So, providing only the response link.

EDIT: The patch appeared in the latest vim code.
The highlight name has been changed to quickfixline instead of quickfixcurrentline.

+2
source

Source: https://habr.com/ru/post/1443962/


All Articles