A Fish shell-like abbr command for Zsh with extended cursor placement functionality.
-
Clone the repository into the Oh My Zsh custom plugins folder:
git clone https://github.com/IlanCosman/zsh-abbr $ZSH_CUSTOM/plugins/zsh-abbr
-
Add
zsh-abbr
to the plugins array in your zshrc:plugins=(... zsh-abbr)
abbr syu "sudo pacman -Syu"
Space
will expand syu
into sudo pacman -Syu
. Enter
will expand and then run the command.
abbr gca "git commit -am '^'"
Use a ^
to determine where the cursor will be placed after expansion.
abbr s "sudo ^"
Note: Using a ^
will cause Enter
to only expand the command, not run it.