diff --git a/.tmux.conf b/.tmux.conf index 26542d4..7525909 100644 --- a/.tmux.conf +++ b/.tmux.conf @@ -21,6 +21,12 @@ 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 + # 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" diff --git a/.vimrc b/.vimrc index 5bffd40..1ec65f3 100644 --- a/.vimrc +++ b/.vimrc @@ -24,7 +24,6 @@ set backupdir=~/.vim/backup// set nobackup set mouse=a " mouse support - noremap noremap noremap diff --git a/.zshrc b/.zshrc index daf6641..4833840 100644 --- a/.zshrc +++ b/.zshrc @@ -36,9 +36,10 @@ 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 @@ -149,16 +150,16 @@ fi alias .g='git --git-dir=$HOME/.dotgit/ --work-tree=$HOME' # aliases: tmux -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" +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 # yazi wrapper (cd to dir on exit) function y() { local tmp="$(mktemp -t "yazi-cwd.XXXXXX")" cwd command yazi "$@" --cwd-file="$tmp" IFS= read -r -d '' cwd < "$tmp" - [ "$cwd" != "$PWD" ] && [ -d "$cwd" ] && builtin cd -- "$cwd" + [[ "$cwd" != "$PWD" ]] && [[ -d "$cwd" ]] && builtin cd -- "$cwd" rm -f -- "$tmp" } @@ -179,7 +180,7 @@ function clip { function mkcd { : "${1:?where?}" [[ -e $1 ]] && { echo "file exists"; return 1 } - mkdir -p $1 && cd $1 + mkdir -p "$1" && cd "$1" } function cdtmp {