feat: j tab, podman->docker, kx->kctx, kn->kns

This commit is contained in:
AngeD 2023-03-15 12:33:28 +01:00
parent b6f60c0828
commit 90db24790e
5 changed files with 12 additions and 8 deletions

View File

@ -1,5 +1,5 @@
alias docker='podman' alias docker='sudo docker'
alias docker-compose='podman-compose' alias docker-compose='sudo docker-compose'
# docker # docker
alias dk='docker' alias dk='docker'

View File

@ -12,7 +12,7 @@
# See the License for the specific language governing permissions and # See the License for the specific language governing permissions and
# limitations under the License. # limitations under the License.
function kx() { function kctx() {
1="$(echo - "$1" | tr -c '[:alnum:]-_' '[ *]')" 1="$(echo - "$1" | tr -c '[:alnum:]-_' '[ *]')"
local ctx="$(echo - "$1" | awk '{print $1}')" local ctx="$(echo - "$1" | awk '{print $1}')"
local ns="${2-$(echo - "$1" | awk '{print $2}')}" local ns="${2-$(echo - "$1" | awk '{print $2}')}"
@ -20,9 +20,8 @@ function kx() {
kubectx ${ctx:l} kubectx ${ctx:l}
[ -n "$ns" ] && kubens "${ns:l}" [ -n "$ns" ] && kubens "${ns:l}"
} }
compdef -e _kubectx kx
alias kn='kubens' alias kns='kubens'
alias k='kubectl' alias k='kubectl'
alias ksys='kubectl --namespace=kube-system' alias ksys='kubectl --namespace=kube-system'
alias ka='kubectl apply --recursive -f' alias ka='kubectl apply --recursive -f'

View File

@ -4,10 +4,12 @@ zstyle ':omz:update' mode disabled
plugins=(vi-mode colored-man-pages git gitignore) plugins=(vi-mode colored-man-pages git gitignore)
# doesn't work in .zshenv
fpath=("$ZDOTDIR/completions" $fpath)
. "$ZSH"/oh-my-zsh.sh . "$ZSH"/oh-my-zsh.sh
. "$ZDOTDIR"/.docker_aliases . "$ZDOTDIR"/.docker_aliases
. "$ZDOTDIR"/.kubectl_aliases . "$ZDOTDIR"/.kubectl_aliases
. "$ZDOTDIR"/.zsh_aliases . "$ZDOTDIR"/.zsh_aliases
! [ -f "$ZDOTDIR/.p10k.zsh" ] || . "$ZDOTDIR/.p10k.zsh" . "$ZDOTDIR/.p10k.zsh"

View File

@ -0,0 +1,3 @@
#compdef j
_arguments "1: :(**/"$1")"

View File

@ -1,5 +1,3 @@
path=("$HOME/bin" "$HOME/.local/bin" $path)
export XDG_CACHE_HOME="$HOME/.cache" export XDG_CACHE_HOME="$HOME/.cache"
export XDG_CONFIG_HOME="$HOME/.config" export XDG_CONFIG_HOME="$HOME/.config"
export XDG_DATA_HOME="$HOME/.local/share" export XDG_DATA_HOME="$HOME/.local/share"
@ -16,6 +14,8 @@ export ZSH_COMPDUMP="$XDG_CACHE_HOME/.zcompdump-$ZSH_VERSION"
export LESSHISTFILE='-' export LESSHISTFILE='-'
path=("$HOME/bin" "$HOME/.local/bin" $path)
export EDITOR='nvim' export EDITOR='nvim'
export XDG_CURRENT_DESKTOP=Unity export XDG_CURRENT_DESKTOP=Unity