Skip to content

nmaggioni/wat

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Which Alias To...?

license standard-readme compliant

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...?

Demo Aliases



Install

Prerequisites

You need to have fzf installed on your system and in your PATH.

Shell integration

  1. Clone this repo somewhere memorable.
  2. Build the wat binary.
    • With Docker: make docker
    • With your local Go toolchain: make go
  3. 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

Usage

Documenting your aliases

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.

Searching for aliases

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.

Limitations

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

About

Which Alias To...?

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published