Compare commits

..

6 Commits

Author SHA1 Message Date
Xavier Logerais
84ffaf33d2 feat: Ajout alias pour taskwarrior-tui 2024-06-28 09:00:56 +00:00
Xavier Logerais
ce15f00b6f feat: Ajout automatique de la compltetion pour les aliases si _complete_alias est disponible 2024-06-28 08:32:11 +00:00
Xavier Logerais
cb323ec6c0 feat: Utilise nullglob pour éviter les erreurs de répertoires vides 2024-06-28 08:31:10 +00:00
Xavier Logerais
0c749a5fd0 feat: Définit des aliases plus génériques pour cd 2024-06-28 08:29:40 +00:00
Xavier Logerais
1338369be7 feat: Ajout completion pour kind 2024-06-24 09:24:49 +00:00
Xavier Logerais
9535c409e7 feat: Ajout completion pour podman 2024-06-24 09:24:32 +00:00
7 changed files with 38 additions and 6 deletions

View File

@ -1,6 +1,5 @@
alias cdrepo='cd ~/repositories/' alias cdrepo='cd ~/Repositories/'
alias cddns='cd ~/repositories/dns && git pull' alias cdgitlab='cd ~/Repositories/Gitlab'
alias cdfai='cd ~/repositories/fai && git pull' alias cdgithub='cd ~/Repositories/Github'
alias cdpuppet='cd ~/repositories/puppet && git pull' alias cdgl=cdgitlab
alias cdhiera='cd ~/repositories/hiera && git pull' alias cdgh=cdgithub
alias cdshinken='cd ~/repositories/shinken && git pull'

View File

@ -8,9 +8,16 @@ if (command -v kubectl &>/dev/null); then
alias kd="kubectl describe" alias kd="kubectl describe"
alias ks="kubectl --namespace kube-system" alias ks="kubectl --namespace kube-system"
alias kga="kubectl get --all-namespaces" alias kga="kubectl get --all-namespaces"
alias kuc="kubectl config unset current-context"
alias kgworkers="kubectl get nodes --selector '!node-role.kubernetes.io/control-plane' --label-columns heat,topology.kubernetes.io/zone,topology.kubernetes.io/region --sort-by metadata.labels.heat"
# add completion for the alias as well # add completion for the alias as well
complete -o default -F __start_kubectl k complete -o default -F __start_kubectl k
complete -o default -F __start_kubectl ks complete -o default -F __start_kubectl ks
# Experimental
complete -o default -F _complete_alias kg
complete -o default -F _complete_alias kd
complete -o default -F _complete_alias kga
fi fi

View File

@ -9,3 +9,8 @@ then
alias td='task done' alias td='task done'
alias ts='task sync' alias ts='task sync'
fi fi
if (command -v taskwarrior-tui &> /dev/null)
then
alias tu='taskwarrior-tui'
fi

View File

@ -1,5 +1,7 @@
#!/bin/bash #!/bin/bash
source $HOME/.nix-profile/etc/profile.d/hm-session-vars.sh
if [ -f "$HOME"/.bash/profile ]; then source "$HOME"/.bash/profile; fi if [ -f "$HOME"/.bash/profile ]; then source "$HOME"/.bash/profile; fi
if [ -d "$HOME"/.bash/profile ]; then for file in "$HOME"/.bash/profile/*; do source "$file"; done; fi if [ -d "$HOME"/.bash/profile ]; then for file in "$HOME"/.bash/profile/*; do source "$file"; done; fi
if [ -d "$HOME"/.bash/profile.d ]; then for file in "$HOME"/.bash/profile.d/*; do source "$file"; done; fi if [ -d "$HOME"/.bash/profile.d ]; then for file in "$HOME"/.bash/profile.d/*; do source "$file"; done; fi

9
bashrc
View File

@ -11,6 +11,9 @@ if [[ $- != *i* ]]; then
return return
fi fi
# Safe loops for empty dirs
shopt -s nullglob
# Source custom libs # Source custom libs
if [ -d "$HOME"/.bash/libs ]; then for lib in "$HOME"/.bash/libs/*.bash; do source "$lib"; done; fi if [ -d "$HOME"/.bash/libs ]; then for lib in "$HOME"/.bash/libs/*.bash; do source "$lib"; done; fi
@ -25,6 +28,9 @@ if [ -f "$HOME"/.bash_aliases ]; then source "$HOME"/.bash_aliases; fi
if [ -f "$HOME"/.bash/aliases ]; then source "$HOME"/.bash/aliases; fi if [ -f "$HOME"/.bash/aliases ]; then source "$HOME"/.bash/aliases; fi
if [ -d "$HOME"/.bash/aliases ]; then for file in "$HOME"/.bash/aliases/*; do source "$file"; done; fi if [ -d "$HOME"/.bash/aliases ]; then for file in "$HOME"/.bash/aliases/*; do source "$file"; done; fi
if [ -d "$HOME"/.bash/aliases.d ]; then for file in "$HOME"/.bash/aliases.d/*; do source "$file"; done; fi if [ -d "$HOME"/.bash/aliases.d ]; then for file in "$HOME"/.bash/aliases.d/*; do source "$file"; done; fi
if (command -v _complete_alias &>/dev/null); then
for alias in $(alias -p | awk '{print $2}' | awk -F= '{print $1}'); do complete -o default -F _complete_alias "$alias"; done
fi
# Source bash completion definitions # Source bash completion definitions
for file in /etc/bash*completion /etc/profile.d/bash*completion*; do source "$file"; done for file in /etc/bash*completion /etc/profile.d/bash*completion*; do source "$file"; done
@ -36,3 +42,6 @@ if [ -d "$HOME"/.bash/completion.d ]; then for file in "$HOME"/.bash/completion.
# Late customization # Late customization
if [ -d "$HOME"/.bash/rc.after.d ]; then for file in "$HOME"/.bash/rc.after.d/*; do source "$file"; done; fi if [ -d "$HOME"/.bash/rc.after.d ]; then for file in "$HOME"/.bash/rc.after.d/*; do source "$file"; done; fi
# Restore option nullglob to normal
shopt -u nullglob

5
completion.d/kind Normal file
View File

@ -0,0 +1,5 @@
#!/bin/bash
if (command -v kind &>/dev/null); then
source <(kind completion bash)
fi

5
completion.d/podman Normal file
View File

@ -0,0 +1,5 @@
#!/bin/bash
if (command -v podman &>/dev/null); then
source <(podman completion bash)
fi