I'm using the following command quite frequently:
vim $(fzf)
It uses fuzzy find to search a list of files, and then open the highlighted one in vim.
I would like to alias vim $(fzf)
, but when I add alias v="vim $(fzf)"
to .zshrc
, fzf
is executed whenever I open a new shell.
How do I set zsh
to execute the $(command)
only when the aliased command is executed?
Simply replace
alias v="vim $(fzf)"
With
alias v='vim "$(fzf)"'
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With