Вы можете использовать следующее:
" Filter the quickfix list
function! FilterQFList(type, action, pattern)
" get current quickfix list
let s:curList = getqflist()
let s:newList = []
for item in s:curList
if a:type == 0 " filter on file names
let s:cmpPat = bufname(item.bufnr)
elseif a:type == 1 " filter by line content
let s:cmpPat = item.text . item.pattern
endif
if item.valid
if a:action < 0
" Keep only nonmatching lines
if s:cmpPat !~ a:pattern
let s:newList += [item]
endif
else
" Keep only matching lines
if s:cmpPat =~ a:pattern
let s:newList += [item]
endif
endif
endif
endfor
call setqflist(s:newList)
endfunction
Затем определите четыре сопоставления (замените ø на то, что вам подходит, мое начните с ð, которое, я думаю, может быть недоступно на вашей клавиатуре), сопоставьте соответственно:
nnoremap ø :call FilterQFList(0, -1, inputdialog('Remove file names matching:', ''))<CR>
nnoremap ø :call FilterQFList(0, 1, inputdialog('Keep only file names matching:', ''))<CR>
nnoremap ø :call FilterQFList(1, -1, inputdialog('Remove all lines matching:', ''))<CR>
nnoremap ø :call FilterQFList(1, 1, inputdialog('Keep only lines matching:', ''))<CR>
Таким образом, вы можете отфильтровать список быстрых исправлений по любому шаблону (у вас есть сила vim reg.exps).Используйте :cnewer
и :colder
для просмотра предыдущих списков быстрых исправлений.