3 ms·
Using a modern shell like fish and cli tools like fzf, sed, sort etc together to create abbreviations (not aliases in fish) give you 100x more features than thi
by lambda_dn 6y ago
Using a modern shell like fish and cli tools like fzf, sed, sort etc together to create abbreviations (not aliases in fish) give you 100x more features than this.
I type ck and get a fzf list of local and remote branches I can fuzzy search and select to checkout.
- qmmmur 6y agoCare to share?
- lambda_dn 6y agoSure! Using Fish shell run the code below. abbr creates and abbreviation (slightly different from an alias and imho much more useful), see https://fishshell.com/docs/current/cmds/abbr.html https://fishshell.com/docs/current/cmds/abbr.html My git checkout abbr requires git,fzf to be installed abbr --add ck 'git branch -a | string replace -a \'origin/\' \'\' | string replace -a \'remotes/\' \'\' | sort -u | fzf | read branch; git checkout $branch' To use just type ck and then you can narrow the branch list by typing some letters, then arrow keys to select the branch hit enter, boom.
- qmmmur 6y agoThis is awesome, thanks.