I'm trying to clear the Quickfix list in Vim since I want to get rid of highlighting and also if I accidently created a huge list I want to clean it up so vim becomes responsive again. Closing the window will not clear the list but the contents.
The only way I came up so far is
function ClearQuickfixList()
call setqflist([])
endfunction
command! ClearQuickfixList call ClearQuickfixList()
nmap <leader>cf :ClearQuickfixList<cr>
EDIT (Thanks to Peter Rincker):
A better command is using cexpr []
so the command is
command! ClearQuickfixList cexpr []
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