How much time did you spend crafting and perfecting that nifty alias that you thought you would use often enough to remember its name, but that in fact you can't quite pinpoint when you most need it?
Inspired by and relying on fzf, enter wat
: Which Alias To...?
You need to have fzf
installed on your system and in your PATH.
- Clone this repo somewhere memorable.
- Build the
wat
binary.- With Docker:
make docker
- With your local Go toolchain:
make go
- With Docker:
- Source the hooks script in your
~/.zshrc
:(cat << EOF # Source alias search hooks # https://github.com/nmaggioni/wat source $(readlink -f .)/wat.zsh EOF ) | tee -a ~/.zshrc
Document your aliases directly in your ~/.zshrc
using #d:
to prefix descriptions and #t:
to prefix comma-delimited tags.
alias zshconfig="vim ~/.zshrc && exec zsh" #d: edit and reload the shell config #t: edit,vim,zsh,rc,config
Only the tags field is mandatory, and spaces after #d:
and #t:
are optional.
Hit CTRL+A in your terminal to trigger an alias search.
Type to search by name, description or tag. Use the arrow keys to move, and hit ENTER to insert the selected alias in place.
Aliases are only loaded from your main shell configuration file.
The shell config file is read in its entirety every time a search is started.
Alias names must not contain colons (:
).
ZSH is the only currently supported shell.
Shell | Supported | Notes |
---|---|---|
ZSH | Yes | |
Bash | No | TBD |
Fish | No | TBD |