zsh-auto-escape is a zle widget ("zsh plugin") that will automatically escapes around the argument of certain commands just like when we hit the tab key in command line shells. The motivation is that the remix framework recommends using file names with dollar signs, which was inconvenient, so I created it.
If the argument of the configured command contains a special charcter, it's converted to the argument with being escaped just before execution.
❯ code aa bb$bb cc # => code aa bb\$bb cc
❯ code aa bb\$bb cc # => do nothing
Download zsh-auto-escape.zsh
and source it from your ~/.zshrc file
. Then make sure that you add some prefixes:
source ~/somewhere/zsh-auto-escape.zsh
ZSH_AUTO_ESCAPE_PREFIXES=('vim' 'code')
zinit light banyan/zsh-auto-escape
MIT