supercheval
supercheval

Reputation: 357

Quickfix windows doesn't open

I am running vanilla Vim without any plugin or anything in my vimrc however the quickfix windows doesn't open when I run :grep foo %

I am following the tutorial here: https://seesparkbox.com/foundry/demystifying_multi_file_searches_in_vim_and_the_command_line

VIM - Vi IMproved 8.0 (2016 Sep 12, compiled May 11 2018 15:17:01)

Is it a normal behavior?

Upvotes: 0

Views: 399

Answers (1)

B.G.
B.G.

Reputation: 6016

:grep only runs an external grep command defined in grepprg (have a look at yours with :set grepprg?). So yes, it does not change the state of the quickfix window per default.

However you could write your own grep command:

command! -nargs=+ NewGrep execute 'silent grep! <args>' | copen

Or you could use an Autocommand, to trigger the copen after a grep. Have a look here: vimgrep pattern and immediately open quickfix in split mode

Upvotes: 2

Related Questions