1

I would like to set up vim-fzf to do git grep/rg/ag/whatever on the word my cursor is over. With vim-grepper I was able to do gsiw for this and it was fantastic. With fzf I can't seem to figure out how to set that up. (My colleague accomplishes the same task by entering <CTRL-R><CTRL-W> at the grep prompt, but I figure this could be done better.)

In general though, for the in word commands, how are they set up? (e.g. yiw, ciw, etc.)

If I had a function foo, how could I send the in word as an argument? i.e. how would I do:

noremap <leader>m :call foo(getreg(*in word*))<cr>

For my specific question, I bet I'll be remapping the call to fzf#vim#grep, but I thought I'd ask this because I don't even know how to properly refer to the in word stuff.

  • In case anyone else is curious about using fzf go do a git grep on the current word, I have the command here – Matt Mar 2 at 18:03
2

how could I send the in word as an argument?

expand('<cword>')

Also see :h expand() for a full list of specials.

| improve this answer | |
  • nice, I'll give this a try with fzf. Thanks! – Matt Feb 28 at 17:01

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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