this works better if there are a lot of files
This commit is contained in:
parent
dc9dfc0a5d
commit
21759ab1dd
4
bashrc
4
bashrc
@ -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
|
||||||
|
Loading…
Reference in New Issue
Block a user