0

I've configured my .vimrc file for GGrep:

command! -bang -nargs=* GGrep
  \ call fzf#vim#grep(
  \   ('git grep -i --line-number '.(isdirectory(expand(".git"))?'--untracked ':'--no-index ')).shellescape(<q-args>), 0,
  \   { 'dir': getcwd() }, <bang>0)

Note I've configured it to show the file path. However I don't want to search the file path. I just want to search the contents of the files. Does anyone know how to do this?

See below it's also filtering on the path.

enter image description here

1 Answer 1

1

I assume the arguments of grep are similar to fzf#run.

If that is the case you need to set:

{ 'dir': getcwd(), 'options': '-n 2'}

The -n tells the column that is relevant for the search. You can do man fzf for more details.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.