4

Say I would like to edit a file ./long/path/to/my/file/test.py with Vim, but I do not remember the path to the file.

In this case, I would run vim `fzf` to use fuzzy search to find and edit the file.

What gets stored in my ~/.zsh_history is vim `fzf`, which makes sense. I was wondering if it is possible to add an entry in the history that includes the expanded command, e.g., vim ./long/path/to/my/file/test.py. This would be useful not only for having a more accurate history but also in other programs like fasd and McFly.

1
  • Instead of running a command that calls fzf, bind a key to a widget that calls fzf and inserts the result. For example github.com/amaya382/zsh-fzf-widgets (no idea if it's good, it was just the top google hit for “zsh fzf widget”). Commented Nov 23, 2022 at 23:06

0

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.