In the fzf plugin you can define mappings for the fzf window to open the selected file in a vertical split, etc. How can I make fzf mapping to insert the path of the selected file as a string into the current buffer? I want to use this mapping inside the fzf-window opend by :FZF and similar commands.


You could always yank it and put it. I dont know how to create fzf mappings but the right hand side would basically be something like

normal! yaW<C-w>pp

Or in “pure” Ex commands, which work linewise:

yank | wincmd p | put

Depending on how much you want to yank.

  • You cannot (as far as I know) use normal mode command when selecting files in the fzf promt. I have tried to clarify my question. – Andreas Mar 20 at 10:32
  • @Andreas see edita – D. Ben Knoble Mar 20 at 12:35

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.