1 Commits

Author SHA1 Message Date
svxf
c643f0b719 fix: use zsh idioms and quote variables in shell config
- Use [[ ]] instead of [ ] for conditionals (zsh idiom)
- Quote variable expansions in ZINIT_HOME checks and dirname call
- Quote dollar-1 in mkcd function
- Remove extra blank line in .vimrc

Nightshift-Task: lint-fix
Nightshift-Ref: https://github.com/marcus/nightshift
2026-03-03 22:05:32 +00:00
3 changed files with 26 additions and 52 deletions

View File

@@ -9,12 +9,9 @@ set -s set-clipboard on
set -g allow-passthrough on
# utf8 / colors
set -g default-terminal "tmux-256color"
set -as terminal-overrides ",*:Tc"
set -as terminal-overrides ',*:Smulx=\E[4::%p1%dm'
set -as terminal-overrides ',*:Setulc=\E[58::2::%p1%{65536}%/%d::%p1%{256}%/%{255}%&%d::%p1%{255}%&%d%;m'
set -g extended-keys on
set -as terminal-features 'xterm*:extkeys'
set -g default-terminal "screen-256color"
set -q -g status-utf8 on
setw -q -g utf8 on
# panes retain path
bind '"' split-window -v -c "#{pane_current_path}"
@@ -24,16 +21,6 @@ bind % split-window -h -c "#{pane_current_path}"
bind -n S-Left if-shell "[ #{window_index} -ne $(tmux list-windows -F '##{window_index}' | head -1) ]" "previous-window"
bind -n S-Right if-shell "[ #{window_index} -ne $(tmux list-windows -F '##{window_index}' | tail -1) ]" "next-window"
# alt+arrow pane switching
bind -n M-Left select-pane -L
bind -n M-Right select-pane -R
bind -n M-Up select-pane -U
bind -n M-Down select-pane -D
# alt+[ / alt+] pane switching (prev/next)
bind -n M-[ select-pane -t :.-
bind -n M-] select-pane -t :.+
# swap windows left/right with PgUp/PgDn (no wrap)
bind-key -n PgUp if-shell "[ #{window_index} -ne $(tmux list-windows -F '##{window_index}' | head -1) ]" "swap-window -t -1\; select-window -t -1"
bind-key -n PgDn if-shell "[ #{window_index} -ne $(tmux list-windows -F '##{window_index}' | tail -1) ]" "swap-window -t +1\; select-window -t +1"
@@ -43,7 +30,6 @@ set -s escape-time 10
set -g base-index 1
setw -g pane-base-index 1
set -g renumber-windows on
set -g detach-on-destroy off
# Auto-rename windows: directory/process
set -g automatic-rename on
@@ -52,24 +38,21 @@ set -g automatic-rename-format '#{pane_current_command}@#{b:pane_current_path}#{
# Rename window (prefix + R)
bind R command-prompt -I "#{window_name}" "rename-window '%%'"
# Move window to session (prefix + M), creates session if needed
bind M run-shell 'tmux display-popup -E "tmux-move-to-session #{window_id}"'
# Fuzzy window switcher (prefix + f)
bind f display-popup -h 80% -E "tmux list-windows -F '#{window_index}: #{window_name}' | fzf --reverse --height=100% | cut -d: -f1 | xargs tmux select-window -t"
bind f display-popup -E "tmux list-windows -F '#{window_index}: #{window_name}' | fzf --reverse | cut -d: -f1 | xargs tmux select-window -t"
# status bar
set -g status-style "bg=#262626,fg=#a8a8a8"
set -g status-left "#[fg=#080808,bg=#00af00,bold]#S#[fg=#00af00,bg=#262626,nobold]"
set -g status-style "bg=colour235,fg=colour248"
set -g status-left "#[fg=colour232,bg=colour34,bold]#S#[fg=colour34,bg=colour235,nobold]"
set -g status-left-length 30
set -g status-right ""
set -g status-right-length 40
# window tabs
setw -g window-status-format "#{?#{m:*[13579],#{window_index}},#[fg=#262626]#[bg=#282828]#[fg=#848484] #I #W #[fg=#282828]#[bg=#262626],#[fg=#262626]#[bg=#1e1e1e]#[fg=#747474] #I #W #[fg=#1e1e1e]#[bg=#262626]}"
setw -g window-status-current-format "#[fg=#262626,bg=#00af00]#[fg=#080808,bg=#00af00,bold] #I #W #[fg=#00af00,bg=#262626]"
setw -g window-status-format "#{?#{m:*[13579],#{window_index}},#[fg=colour235]#[bg=colour236]#[fg=colour250] #I #W #[fg=colour236]#[bg=colour235],#[fg=colour235]#[bg=colour233]#[fg=colour244] #I #W #[fg=colour233]#[bg=colour235]}"
setw -g window-status-current-format "#[fg=colour235,bg=colour34]#[fg=colour232,bg=colour34,bold] #I #W #[fg=colour34,bg=colour235]"
setw -g window-status-separator ""
# pane borders
set -g pane-border-style "fg=#444444"
set -g pane-active-border-style "fg=#00af00"
set -g pane-border-style "fg=colour238"
set -g pane-active-border-style "fg=colour34"

13
.zshenv
View File

@@ -1,13 +0,0 @@
# .zshenv — sourced for every zsh invocation (interactive, non-interactive, scripts).
# PATH lives here so cron, ssh host-command, and GUI-launched processes see it.
typeset -U path
path=(
/projects/bin
$HOME/.local/bin
$HOME/.cargo/bin
/usr/local/go/bin
$HOME/go/bin
/opt/homebrew/bin
$path
)

28
.zshrc
View File

@@ -36,10 +36,9 @@ zmodload zsh/stat
# plugin manager
ZINIT_HOME="${XDG_DATA_HOME:-${HOME}}/.zinit.git"
[ ! -d "$ZINIT_HOME" ] && mkdir -p "$(dirname $ZINIT_HOME)"
[ ! -d "$ZINIT_HOME/.git" ] && git clone https://github.com/zdharma-continuum/zinit.git "$ZINIT_HOME"
[[ ! -d "$ZINIT_HOME" ]] && mkdir -p "$(dirname "$ZINIT_HOME")"
[[ ! -d "$ZINIT_HOME/.git" ]] && git clone https://github.com/zdharma-continuum/zinit.git "$ZINIT_HOME"
source "${ZINIT_HOME}/zinit.zsh"
functions[@zinit-scheduler]="setopt localoptions; set +u; ${functions[@zinit-scheduler]}"
zinit light zsh-users/zsh-autosuggestions
zinit light zsh-users/zsh-syntax-highlighting
@@ -110,7 +109,17 @@ zinit light starship/starship
git --git-dir=$HOME/.dotgit/ --work-tree=$HOME pull --ff-only -q 2>/dev/null
} &!
# paths live in ~/.zshenv so non-interactive shells (cron, ssh cmd, GUI) see them
# paths
typeset -U path
path=(
/projects/bin
$HOME/.local/bin
$HOME/.cargo/bin
/usr/local/go/bin
$HOME/go/bin
/opt/homebrew/bin
$path
)
# fzf (if available)
if (( $+commands[fzf] )); then
@@ -140,10 +149,9 @@ fi
alias .g='git --git-dir=$HOME/.dotgit/ --work-tree=$HOME'
# aliases: tmux
alias t="tmux new-session -A -s auto"
alias tmuxr="tmux new-session -A -s auto" # attach-or-create "auto"
alias tmuxn="tmux new-session -A -s auto \; new-window" # same + new window
alias tmuxa="tmux new-session -A -s" # attach-or-create named
alias tmuxr="tmux new-session -A -s auto"
alias tmuxn="tmux new-session -A -s auto \; new-window"
alias tmuxa="tmux new-session -A -s"
# yazi wrapper (cd to dir on exit)
function y() {
@@ -188,13 +196,9 @@ alias dcu='docker compose up --force-recreate --detach'
alias dcd='docker compose down --remove-orphans'
alias dcl='docker compose logs -f'
# aliases: rsync with sane defaults
alias rsync2='rsync --info=PROGRESS2 --progress --recursive --compress --human-readable --update --times --no-whole-file --itemize-changes --stats --verbose --links --no-perms --chmod=ugo=rwX'
# aliases: misc
alias c="claude"
alias ,cd="IS_SANDBOX=1 claude --dangerously-skip-permissions"
alias wm="workmux"
alias zshreload="exec zsh"
alias -g LATEST='*(om[1])' # glob: most recently modified
alias FUNCTION_PRELUDE="setopt LOCAL_OPTIONS PIPE_FAIL XTRACE ERR_RETURN"