banyan / zsh-auto-escape

automatically escape arguments like when we hit the tab key in command line shells

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

zsh-auto-escape

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.

Demo

How it works

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

If the argument is already escaped, it just leaves as it is.

❯ code aa bb\$bb cc # => do nothing

Installation

Manually

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

License

MIT

About

automatically escape arguments like when we hit the tab key in command line shells

License:MIT License


Languages

Language:Shell 100.0%