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 # Tab completion
expand-or-complete-with-indicator() { expand-or-complete-with-indicator() {
print -Pn "%{%F{red}...%f%}" print -Pn "%{%F{red}...%f%}"
zle expand-or-complete zle expand-or-complete
zle redisplay zle redisplay
} }
zle -N expand-or-complete-with-indicator zle -N expand-or-complete-with-indicator
bindkey "^I" 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 # I want shared history for ^R, but I don't want another shell's activity to
# mess with up/down. This does that. # mess with up/down. This does that.
down-line-or-local-history() { down-line-or-local-history() {
zle set-local-history 1 zle set-local-history 1
zle down-line-or-history zle down-line-or-history
zle set-local-history 0 zle set-local-history 0
} }
zle -N down-line-or-local-history zle -N down-line-or-local-history
up-line-or-local-history() { up-line-or-local-history() {
zle set-local-history 1 zle set-local-history 1
zle up-line-or-history zle up-line-or-history
zle set-local-history 0 zle set-local-history 0
} }
zle -N up-line-or-local-history zle -N up-line-or-local-history

View File

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

View File

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

View File

@ -1,13 +1,13 @@
# vim: ft=zsh # vim: ft=zsh
if command-exists dircolors; then if command-exists dircolors; then
eval "$(dircolors -b)" eval "$(dircolors -b)"
fi fi
if command-exists eza; then 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 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 else
LSOPTS="-lAvF --color=auto" # long mode, show all, natural sort, type squiggles, friendly sizes LSOPTS="-lAvF --color=auto" # long mode, show all, natural sort, type squiggles, friendly sizes
alias ls="ls $LSOPTS" alias ls="ls $LSOPTS"
fi fi

View File

@ -1,53 +1,53 @@
# vim: ft=zsh # vim: ft=zsh
function title { 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 # 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. # 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 # On the other hand, if I'm not logged in as me (but, e.g., root), I'd
# certainly like to know that! # certainly like to know that!
if [[ $USER != "$DEFAULT_USER" ]]; then if [[ $USER != "$DEFAULT_USER" ]]; then
prefix="[$USER] " prefix="[$USER] "
fi fi
# Set screen window title # Set screen window title
if [[ $TERM == "screen"* ]]; then if [[ $TERM == "screen"* ]]; then
print -n "\ek$prefix$1\e\\" print -n "\ek$prefix$1\e\\"
fi fi
# Prefix the xterm title with the current machine name, but only if I'm not # 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 # 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 # 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. # running over SSH *and* not using screen. Local screens are fairly rare.
prefix=$HOST prefix=$HOST
if [[ $SSH_CONNECTION == '' && $TERM != "screen"* ]]; then if [[ $SSH_CONNECTION == '' && $TERM != "screen"* ]]; then
prefix='' prefix=''
fi fi
# If we're showing host and not default user prepend it # If we're showing host and not default user prepend it
if [[ $prefix != '' && $USER != "$DEFAULT_USER" ]]; then if [[ $prefix != '' && $USER != "$DEFAULT_USER" ]]; then
prefix="$USER@$prefix" prefix="$USER@$prefix"
fi fi
# Wrap it in brackets # Wrap it in brackets
if [[ $prefix != '' ]]; then if [[ $prefix != '' ]]; then
prefix="[$prefix] " prefix="[$prefix] "
fi fi
# Set xterm window title # Set xterm window title
if [[ $TERM == "xterm"* || $TERM == "screen"* ]]; then if [[ $TERM == "xterm"* || $TERM == "screen"* ]]; then
print -n "\e]2;$prefix$1\a" print -n "\e]2;$prefix$1\a"
fi fi
} }
function title_precmd { function title_precmd {
# Shorten homedir back to '~' # Shorten homedir back to '~'
local shortpwd=${PWD/$HOME/\~} local shortpwd=${PWD/$HOME/\~}
title "zsh $shortpwd" title "zsh $shortpwd"
} }
function title_preexec { function title_preexec {
title $* title $*
} }
add-zsh-hook preexec title_preexec add-zsh-hook preexec title_preexec