Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Clearing the quickfix list in vim

Tags:

vim

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.

like image 672
Sideshowcoder Avatar asked Dec 09 '14 18:12

Sideshowcoder


1 Answers

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 []
like image 136
Sideshowcoder Avatar answered Sep 24 '22 09:09

Sideshowcoder