format fix

This commit is contained in:
vonProteus 2025-06-11 06:09:30 +02:00
parent fd1cb0cb86
commit e9bb0d3221
Signed by untrusted user who does not match committer: vonProteus
GPG Key ID: 65472F126055FF23
5 changed files with 65 additions and 65 deletions

View File

@ -30,9 +30,9 @@ bindkey "\e[F" end-of-line
# Tab completion
expand-or-complete-with-indicator() {
print -Pn "%{%F{red}...%f%}"
zle expand-or-complete
zle redisplay
print -Pn "%{%F{red}...%f%}"
zle expand-or-complete
zle redisplay
}
zle -N expand-or-complete-with-indicator
bindkey "^I" expand-or-complete-with-indicator
@ -44,15 +44,15 @@ bindkey "\e[Z" reverse-menu-complete # shift-tab to reverse menu
# I want shared history for ^R, but I don't want another shell's activity to
# mess with up/down. This does that.
down-line-or-local-history() {
zle set-local-history 1
zle down-line-or-history
zle set-local-history 0
zle set-local-history 1
zle down-line-or-history
zle set-local-history 0
}
zle -N down-line-or-local-history
up-line-or-local-history() {
zle set-local-history 1
zle up-line-or-history
zle set-local-history 0
zle set-local-history 1
zle up-line-or-history
zle set-local-history 0
}
zle -N up-line-or-local-history

View File

@ -1,15 +1,15 @@
# vim: ft=zsh
function br {
local cmd cmd_file code
cmd_file=$(mktemp)
if broot --outcmd "$cmd_file" "$@"; then
cmd=$(<"$cmd_file")
command rm -f "$cmd_file"
eval "$cmd"
else
code=$?
command rm -f "$cmd_file"
return "$code"
fi
local cmd cmd_file code
cmd_file=$(mktemp)
if broot --outcmd "$cmd_file" "$@"; then
cmd=$(<"$cmd_file")
command rm -f "$cmd_file"
eval "$cmd"
else
code=$?
command rm -f "$cmd_file"
return "$code"
fi
}

View File

@ -1,13 +1,13 @@
# vim: ft=zsh
if command-exists "kubectl"; then
source <(kubectl completion zsh)
source <(kubectl completion zsh)
fi
if command-exists "k3s"; then
source <(k3s completion zsh)
source <(k3s completion zsh)
fi
if command-exists "minikube"; then
source <(minikube completion zsh)
source <(minikube completion zsh)
fi

View File

@ -1,13 +1,13 @@
# vim: ft=zsh
if command-exists dircolors; then
eval "$(dircolors -b)"
eval "$(dircolors -b)"
fi
if command-exists eza; then
alias ls='eza --git --long --all --time-style long-iso'
alias ls='eza --git --long --all --time-style long-iso'
elif command-exists exa; then
alias ls='exa --git --long --all --time-style long-iso'
alias ls='exa --git --long --all --time-style long-iso'
else
LSOPTS="-lAvF --color=auto" # long mode, show all, natural sort, type squiggles, friendly sizes
alias ls="ls $LSOPTS"
LSOPTS="-lAvF --color=auto" # long mode, show all, natural sort, type squiggles, friendly sizes
alias ls="ls $LSOPTS"
fi

View File

@ -1,53 +1,53 @@
# vim: ft=zsh
function title {
# param: title to use
# param: title to use
local prefix=''
local prefix=''
# If I'm in a screen, all the windows are probably on the same machine, so
# I don't really need to title every single one with the machine name.
# On the other hand, if I'm not logged in as me (but, e.g., root), I'd
# certainly like to know that!
if [[ $USER != "$DEFAULT_USER" ]]; then
prefix="[$USER] "
fi
# Set screen window title
if [[ $TERM == "screen"* ]]; then
print -n "\ek$prefix$1\e\\"
fi
# If I'm in a screen, all the windows are probably on the same machine, so
# I don't really need to title every single one with the machine name.
# On the other hand, if I'm not logged in as me (but, e.g., root), I'd
# certainly like to know that!
if [[ $USER != "$DEFAULT_USER" ]]; then
prefix="[$USER] "
fi
# Set screen window title
if [[ $TERM == "screen"* ]]; then
print -n "\ek$prefix$1\e\\"
fi
# Prefix the xterm title with the current machine name, but only if I'm not
# on a local machine. This is tricky, because screen won't reliably know
# whether I'm using SSH right now! So just assume I'm local iff I'm not
# running over SSH *and* not using screen. Local screens are fairly rare.
prefix=$HOST
if [[ $SSH_CONNECTION == '' && $TERM != "screen"* ]]; then
prefix=''
fi
# If we're showing host and not default user prepend it
if [[ $prefix != '' && $USER != "$DEFAULT_USER" ]]; then
prefix="$USER@$prefix"
fi
# Wrap it in brackets
if [[ $prefix != '' ]]; then
prefix="[$prefix] "
fi
# Prefix the xterm title with the current machine name, but only if I'm not
# on a local machine. This is tricky, because screen won't reliably know
# whether I'm using SSH right now! So just assume I'm local iff I'm not
# running over SSH *and* not using screen. Local screens are fairly rare.
prefix=$HOST
if [[ $SSH_CONNECTION == '' && $TERM != "screen"* ]]; then
prefix=''
fi
# If we're showing host and not default user prepend it
if [[ $prefix != '' && $USER != "$DEFAULT_USER" ]]; then
prefix="$USER@$prefix"
fi
# Wrap it in brackets
if [[ $prefix != '' ]]; then
prefix="[$prefix] "
fi
# Set xterm window title
if [[ $TERM == "xterm"* || $TERM == "screen"* ]]; then
print -n "\e]2;$prefix$1\a"
fi
# Set xterm window title
if [[ $TERM == "xterm"* || $TERM == "screen"* ]]; then
print -n "\e]2;$prefix$1\a"
fi
}
function title_precmd {
# Shorten homedir back to '~'
local shortpwd=${PWD/$HOME/\~}
title "zsh $shortpwd"
# Shorten homedir back to '~'
local shortpwd=${PWD/$HOME/\~}
title "zsh $shortpwd"
}
function title_preexec {
title $*
title $*
}
add-zsh-hook preexec title_preexec