From f48c0f115aa52089a82dce18c6bcde7d9b948aa5 Mon Sep 17 00:00:00 2001 From: Jannik ZANDER Date: Mon, 9 Jul 2018 19:02:25 +0200 Subject: [PATCH] Fix completion in debian --- .config/bash/aliases.sh => .bash_aliases | 0 .bash_completion | 10 ++++++++++ .bashrc | 10 ++++------ .config/bash/completion.sh | 12 ------------ .profile | 5 ----- 5 files changed, 14 insertions(+), 23 deletions(-) rename .config/bash/aliases.sh => .bash_aliases (100%) create mode 100644 .bash_completion delete mode 100644 .config/bash/completion.sh diff --git a/.config/bash/aliases.sh b/.bash_aliases similarity index 100% rename from .config/bash/aliases.sh rename to .bash_aliases diff --git a/.bash_completion b/.bash_completion new file mode 100644 index 0000000..fb39c4e --- /dev/null +++ b/.bash_completion @@ -0,0 +1,10 @@ +# Add tab completion for `dit` by marking it as an alias for `git` +_completion_loader git +if type _git &>/dev/null; then + complete -o "default" -o "nospace" -F _git dit; +fi; + +# Add tab completion for SSH hostnames based on ~/.ssh/config, ignoring wildcards +if [ -e ~/.ssh/config ]; then + complete -o "default" -o "nospace" -W "$(grep "^Host" ~/.ssh/config | grep -v "[?*]" | cut -d " " -f2 | tr ' ' '\n')" scp sftp ssh; +fi; diff --git a/.bashrc b/.bashrc index 8cb3282..813e386 100644 --- a/.bashrc +++ b/.bashrc @@ -70,10 +70,8 @@ elif [[ -f /usr/share/source-highlight/src-hilite-lesspipe.sh ]]; then fi export LESS=" -R " -# Load aliases, functions, etc -for file in ${HOME}/.config/bash/*.sh; do - [ -f "$file" ] && . "$file"; -done; - -# last line for local things +# Load completion, aliases, and local +[ -f /etc/bash_completion ] && . /etc/bash_completion +#[ -f ~/.bash_completion ] && . ~/.bash_completion; +[ -f ~/.bash_aliases ] && . ~/.bash_aliases; [ -f ~/.bashrc.local ] && . ~/.bashrc.local diff --git a/.config/bash/completion.sh b/.config/bash/completion.sh deleted file mode 100644 index 938c3af..0000000 --- a/.config/bash/completion.sh +++ /dev/null @@ -1,12 +0,0 @@ -# Add tab completion for many Bash commands -[ -f /etc/bash_completion ] && . /etc/bash_completion - -# Enable tab completion for `dit` by marking it as an alias for `git` -if type _git &> /dev/null; then - complete -o default -o nospace -F _git dit; -fi; - -# Add tab completion for SSH hostnames based on ~/.ssh/config, ignoring wildcards -if [ -e "$HOME/.ssh/config" ]; then - complete -o "default" -o "nospace" -W "$(grep "^Host" ~/.ssh/config | grep -v "[?*]" | cut -d " " -f2 | tr ' ' '\n')" scp sftp ssh; -fi; diff --git a/.profile b/.profile index 13555ca..9d47161 100644 --- a/.profile +++ b/.profile @@ -20,8 +20,3 @@ fi #export XDG_DATA_HOME=$HOME/.local/share/ #export XDG_DATA_DIRS=/usr/local/share/:/usr/share/ -################################# DEBIAN LOCAL SETTINGS ##### TO BE MOVED #### - -export QT_STYLE_OVERRIDE=adwaita-dark -#export JAVA_HOME='/usr/lib/jvm/java-8-openjdk-amd64' - -- 2.43.0