diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 00000000..3da474a5 --- /dev/null +++ b/.gitmodules @@ -0,0 +1,6 @@ +[submodule "bash-completion"] + path = bash-completion + url = https://github.com/GArik/bash-completion.git +[submodule "tmux-bash-completion"] + path = tmux-bash-completion + url = https://github.com/imomaliev/tmux-bash-completion.git diff --git a/bash-completion b/bash-completion new file mode 160000 index 00000000..afe39fd1 --- /dev/null +++ b/bash-completion @@ -0,0 +1 @@ +Subproject commit afe39fd1e171d0ea3d4fb8ec0d8c8c14fa120ed8 diff --git a/etc/bash_completion.d/byobu b/etc/bash_completion.d/byobu new file mode 100644 index 00000000..7e59569b --- /dev/null +++ b/etc/bash_completion.d/byobu @@ -0,0 +1,17 @@ +#!/bin/bash + +_byobu() { + source <(sed 's/^/local /' "${HOME}/.byobu/backend") + + if [ "${BYOBU_BACKEND}" == tmux ] ; then + _tmux "$@" + elif [ "${BYOBU_BACKEND}" == screen ] ; then + _screen "$@" + else + return 1 + fi +} + +complete -F _byobu byobu +complete -F _tmux byobu-tmux +complete -F _screen byobu-screen diff --git a/etc/bash_completion.d/screen b/etc/bash_completion.d/screen new file mode 120000 index 00000000..766b3a7e --- /dev/null +++ b/etc/bash_completion.d/screen @@ -0,0 +1 @@ +bash-completion/completions/screen \ No newline at end of file diff --git a/etc/bash_completion.d/tmux b/etc/bash_completion.d/tmux new file mode 120000 index 00000000..8d8dc336 --- /dev/null +++ b/etc/bash_completion.d/tmux @@ -0,0 +1 @@ +tmux-bash-completion/completions/tmux \ No newline at end of file diff --git a/tmux-bash-completion b/tmux-bash-completion new file mode 160000 index 00000000..847eda60 --- /dev/null +++ b/tmux-bash-completion @@ -0,0 +1 @@ +Subproject commit 847eda60c4664bfca833a086a3e2167957c26be0