Tab completion for dotfiles

This commit is contained in:
2021-09-12 09:11:15 +02:00
parent 0af0672f3e
commit 8aad68fd7c

View File

@@ -22,6 +22,15 @@ alias dvim="GIT_WORK_TREE='/home/kuba' GIT_DIR='/home/kuba/.dotfiles.git/' vim"
alias ls='ls --color=auto'
# Make tab-completion work for dotfiles exactly as for git
# First we need to load the completion for git (this is done the first time
# one types `git <TAB>` in the console).
_completion_loader git
# Running `complete -p git` yields the following
# complete -o bashdefault -o default -o nospace -F __git_wrap__git_main git
# So we do
complete -o bashdefault -o default -o nospace -F __git_wrap__git_main dotfiles
# Define a OS X-like open command
open() { command xdg-open "$@" > /dev/null 2>&1 & }