Closed skarfacegc closed 11 years ago
I'm not sure about that, the point of user made aliases is that they are so simple they need little to no documentation at all.
One solution for this issue would be using the alias system provided by git (git config alias.
) and the zsh ability to provide some documentation during the completion.
Here is what I get with zsh default completion for git <tab>
:
-- alias --
br -- alias for 'branch'
ci -- alias for 'commit -v'
cia -- alias for 'commit --amend -v'
ciaa -- alias for 'commit -a --amend -v'
co -- alias for 'checkout'
df -- alias for 'diff'
fap -- alias for 'fetch --all -p'
git -- alias for '!git'
lg -- alias for 'log -p'
log-all -- alias for '!git log --graph --decorate --pretty=oneline --abbrev-commit --all $(git fsck --no-reflogs | gre
log-merge -- alias for '!git log $(git merge-base --octopus $(git log -1 --merges --pretty=format:%P $1))..$1 --graph --
lol -- alias for '!git --no-pager loll'
lola -- alias for '!git --no-pager lolal'
lolal -- alias for 'log --graph --decorate --pretty=oneline --abbrev-commit --all'
loll -- alias for 'log --graph --decorate --pretty=oneline --abbrev-commit'
ls -- alias for 'ls-files'
man -- alias for 'help'
remove -- alias for 'rm'
st -- alias for 'status --short'
stasshow -- alias for 'stash list -p'
stat -- alias for 'status'
stree -- alias for '!stree'
unstash -- alias for 'stash pop'
x -- alias for '!gitx'
-- main porcelain command --
add -- add file contents to index
am -- apply patches from a mailbox
...
My initial use case was for the 100+ aliases provided by the git plugin, but I was actually thinking somewhat more general for aliases provided in prezto. The documentation is really solid in terms of what's in the README files, was just trying to think how to leverage that from the shell.
Perhaps #276 is a good solution for those who do not want to read README files. Man pages are searchable.
When I was using omz I had an alias 'gitcmd' that would list all of the currently defined git aliases. I was playing around with adding that, and realized that the currently provided aliases are pretty well documented in the README files. Seems like there should be some way to leverage that.
If it's called findalias
would look for all aliases that contain the alias filter (for git would return all of the g* aliases) pull the docs for each of those, then list all of the docs that contain the second string.
Thoughts? I find myself constantly doing alias |grep to see what interesting stuff is provided.
something like