this works better if there are a lot of files

This commit is contained in:
Felix Van der Jeugt 2017-10-20 10:01:25 +02:00
parent dc9dfc0a5d
commit 21759ab1dd
No known key found for this signature in database
GPG Key ID: 58B209295023754D

4
bashrc
View File

@ -41,7 +41,7 @@ _comp_git() {
COMPREPLY+=( $(git remote | grep "^$2") ) COMPREPLY+=( $(git remote | grep "^$2") )
# files # files
COMPREPLY+=( $(git ls-files -co --exclude-standard | grep "^$2") ) COMPREPLY+=( $(git ls-files -co --exclude-standard "$2*" | sed "s?\($2[^/]*\).*?\1?") )
# subcommands # subcommands
if [ "$3" = "git" ]; then if [ "$3" = "git" ]; then
@ -53,7 +53,7 @@ complete -c man
complete -cf sudo complete -cf sudo
complete -cf exec complete -cf exec
complete -cf run complete -cf run
complete -F _comp_git git complete -o filenames -F _comp_git git
# history # history
export HISTCONTROL=ignorespace:erasedups export HISTCONTROL=ignorespace:erasedups