Skip to content

Commit f15b072

Browse files
committed
Move completions to nix
1 parent afdc588 commit f15b072

21 files changed

+6
-439
lines changed

aliases/custom.aliases.bash

+1-1
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ if hash istioctl 2>/dev/null; then
7878
complete -F _complete_alias istio
7979
fi
8080
if hash terraform 2>/dev/null; then
81-
alias tf=terraform # completions for alias are on completions file for Terraform
81+
alias tf=terraform
8282
fi
8383
if hash pygmentize 2>/dev/null; then
8484
alias ccat='pygmentize -g -O style=vs -f console16m'

completions/000_completions.bash

+5-12
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,3 @@
1-
# enable programmable completion features (you don't need to enable
2-
# this, if it's already enabled in /etc/bash.bashrc and /etc/profile
3-
# sources /etc/bash.bashrc).
4-
if ! shopt -oq posix; then
5-
if [ -f /usr/share/bash-completion/bash_completion ]; then
6-
. /usr/share/bash-completion/bash_completion
7-
elif [ -f /etc/bash_completion ]; then
8-
. /etc/bash_completion
9-
fi
10-
fi
11-
121
function addCompletion {
132
if [ -f "$1" ]; then
143
# shellcheck source=/dev/null
@@ -17,7 +6,11 @@ function addCompletion {
176
}
187

198
updateCompletionsCommands=''
20-
export COMPLETIONS_DIR=$HOME/.completions
9+
if [ -v XDG_DATA_HOME ]; then
10+
export COMPLETIONS_DIR=$XDG_DATA_HOME/bash-completion/completions/
11+
else
12+
export COMPLETIONS_DIR=$HOME/.local/share/bash-completion/completions/
13+
fi
2114
function updateCompletions {
2215
echo Updating completions...
2316
mkdir -p "$COMPLETIONS_DIR"

completions/001_dotnet-suggest.bash

-2
This file was deleted.
File renamed without changes.

completions/002_dotnet.bash

-10
This file was deleted.
File renamed without changes.
File renamed without changes.

completions/003_helm.bash

-2
This file was deleted.

0 commit comments

Comments
 (0)