zsh-undollar
May 18, 2019 · View on GitHub
zsh-undollar strips the dollar sign from the beginning of the terminal command you just copied from StackOverflow when you were searching for what arguments to pass to tar (xzf? xvfJ? Or was it xvf? You never seem to remember).
Usage
After you've installed zsh-undollar, you can forget it exists. Next time you paste in a command prefixed with a dollar sign, undollar will quietly eat the dollar sign and run the rest of the command.
neo@computey:~$ $ tar xvfJ something.tar.xz
neo@computey:~$
neo@computey:~$ echo "It worked! Thanks undollar!"
It's as if that stray dollar sign was never there in the first place!
Wait what
People often put a "" for non-root users -- so the last thing before a command is a "$".
Often when copy-pasting terminal commands from the internet you'll inadvertently end up also having copied the dollar sign at the beginning (especially if you triple-click to select). Trying to execute the command you just pasted will result in some variant of "command not found" or "No such file or directory".
Installing zsh-undollar solves this problem, by registering .
Instalation
Using zpm
Add zpm load zpm-zsh/undollar into .zshrc
Using oh-my-zsh
Execute git clone https://github.com/zpm-zsh/undollar ~/.oh-my-zsh/custom/plugins/undollar. Add undollar into plugins array in .zshrc
Using antigen
Add antigen bundle zpm-zsh/undollar into .zshrc
Using zgen
Add zgen load zpm-zsh/undollar into .zshrc