Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I open files from Quickfix List in Vim when using EasyGrep?

Tags:

grep

vim

list

I'm relatively new to Vim. I've just installed EasyGrep but can't figure out how to open the files listed in the Quickfix List when I do a search. I can cycle through files containing a matching word using :cn or open a file by double-clicking with my mouse but when I press <Enter> nothing happens. I've also tried go and t but neither of these are working.

Can anyone help?!

Thanks in advance

like image 482
Alistair Colling Avatar asked Oct 14 '25 15:10

Alistair Colling


1 Answers

As already mentioned by @ryuichiro, and then quoted by @Alistair Colling, the quickfix documentation (:h quickfix and :hquickref) provides an answer for how to open files within a quickfix list:

You can use :.cc to jump to the error under the cursor. Hitting the <Enter> key or double-clicking the mouse on a line has the same effect. The file containing the error is opened in the window above the quickfix window.

Make sure that your <Enter> Key (<CR>) is not mapped so that it properly works. As already mentioned by @ryuichiro, this can be checked with

:verbose map <CR>

If you have a global mapping for <CR> (e.g. in my case a mapping from the NERDtree plugin), you can undefine it just for when you are within a quickfix list based on adding the following line to your ~/.vimrc as explained here:

autocmd BufReadPost quickfix nnoremap <buffer> <CR> <CR>
like image 172
Wolfson Avatar answered Oct 17 '25 09:10

Wolfson