diff --git a/zsh.d/20_bindings.zsh b/zsh.d/20_bindings.zsh index 3a738cc..4515f98 100644 --- a/zsh.d/20_bindings.zsh +++ b/zsh.d/20_bindings.zsh @@ -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 diff --git a/zsh.d/50_broot.zsh b/zsh.d/50_broot.zsh index 182491a..ced9e93 100644 --- a/zsh.d/50_broot.zsh +++ b/zsh.d/50_broot.zsh @@ -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 } diff --git a/zsh.d/50_kubernetes.zsh b/zsh.d/50_kubernetes.zsh index 442b884..e6facb8 100644 --- a/zsh.d/50_kubernetes.zsh +++ b/zsh.d/50_kubernetes.zsh @@ -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 diff --git a/zsh.d/50_listings.zsh b/zsh.d/50_listings.zsh index c46da1a..635b133 100644 --- a/zsh.d/50_listings.zsh +++ b/zsh.d/50_listings.zsh @@ -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 diff --git a/zsh.d/50_screen.zsh b/zsh.d/50_screen.zsh index 8379f62..900f6c2 100644 --- a/zsh.d/50_screen.zsh +++ b/zsh.d/50_screen.zsh @@ -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