jamietanna / dotfiles-arch

Dotfiles for my Arch install
Other
6 stars 0 forks source link

Add autocomplete for modified Git files #25

Open jamietanna opened 8 years ago

jamietanna commented 8 years ago

It's often really useful, for instance when doing a rebase, to be able to tab complete through each file that has modifications.

For instance:

$ gited <TAB>
completing modified files
bspwm/home/.xinitrc     bootstrap.sh    vim/home/.vimrc
completing untracked files
TODO

This can be extracted from the outputs of git diff --name-only or git status --porcelain.

jamietanna commented 8 years ago

Functionality should be similar to that of git add:

$ git add <TAB>
completing modified file
bootstrap.sh  bspwm         dunst         sxhkd         terminal      vim         
completing untracked file
bspwm                                     diff            

Which can be found in /usr/share/zsh/functions/Completion/Unix/_git