3

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.

Matt
  • 161
  • 6
  • Instead of running a command that calls `fzf`, bind a key to a widget that calls `fzf` and inserts the result. For example https://github.com/amaya382/zsh-fzf-widgets (no idea if it's good, it was just the top google hit for “zsh fzf widget”). – Gilles 'SO- stop being evil' Nov 23 '22 at 23:06

0 Answers0