3 Commits

Author SHA1 Message Date
svxf
6612cb02f1 alias t for tmuxr 2026-03-05 08:52:38 +01:00
svxf
d6e67828ea tmux alt+arrow pane nav, zshrc quoting/zinit fixes 2026-03-04 20:35:54 +01:00
396c36f5a9 tmux clipbiard 2026-02-16 08:29:14 +01:00
3 changed files with 21 additions and 8 deletions

View File

@@ -5,6 +5,8 @@ set -g history-limit 100000
# mouse # mouse
set -g mouse on set -g mouse on
set -s set-clipboard on
set -g allow-passthrough on
# utf8 / colors # utf8 / colors
set -g default-terminal "screen-256color" set -g default-terminal "screen-256color"
@@ -19,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-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" 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) # 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 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" 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"

1
.vimrc
View File

@@ -24,7 +24,6 @@ set backupdir=~/.vim/backup//
set nobackup set nobackup
set mouse=a " mouse support set mouse=a " mouse support
noremap <Up> <NOP> noremap <Up> <NOP>
noremap <Down> <NOP> noremap <Down> <NOP>
noremap <Left> <NOP> noremap <Left> <NOP>

20
.zshrc
View File

@@ -36,9 +36,10 @@ zmodload zsh/stat
# plugin manager # plugin manager
ZINIT_HOME="${XDG_DATA_HOME:-${HOME}}/.zinit.git" ZINIT_HOME="${XDG_DATA_HOME:-${HOME}}/.zinit.git"
[ ! -d $ZINIT_HOME ] && mkdir -p "$(dirname $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" [ ! -d "$ZINIT_HOME/.git" ] && git clone https://github.com/zdharma-continuum/zinit.git "$ZINIT_HOME"
source "${ZINIT_HOME}/zinit.zsh" 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-autosuggestions
zinit light zsh-users/zsh-syntax-highlighting zinit light zsh-users/zsh-syntax-highlighting
@@ -149,16 +150,17 @@ fi
alias .g='git --git-dir=$HOME/.dotgit/ --work-tree=$HOME' alias .g='git --git-dir=$HOME/.dotgit/ --work-tree=$HOME'
# aliases: tmux # aliases: tmux
alias tmuxr="tmux new-session -A -s auto" alias t="tmux new-session -A -s auto"
alias tmuxn="tmux new-session -A -s auto \; new-window" alias tmuxr="tmux new-session -A -s auto" # attach-or-create "auto"
alias tmuxa="tmux new-session -A -s" 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) # yazi wrapper (cd to dir on exit)
function y() { function y() {
local tmp="$(mktemp -t "yazi-cwd.XXXXXX")" cwd local tmp="$(mktemp -t "yazi-cwd.XXXXXX")" cwd
command yazi "$@" --cwd-file="$tmp" command yazi "$@" --cwd-file="$tmp"
IFS= read -r -d '' cwd < "$tmp" IFS= read -r -d '' cwd < "$tmp"
[ "$cwd" != "$PWD" ] && [ -d "$cwd" ] && builtin cd -- "$cwd" [[ "$cwd" != "$PWD" ]] && [[ -d "$cwd" ]] && builtin cd -- "$cwd"
rm -f -- "$tmp" rm -f -- "$tmp"
} }
@@ -172,10 +174,14 @@ function pj {
dir=$(find -L ${(u)roots} -mindepth 1 -maxdepth 1 -type d 2>/dev/null | sort | awk '{printf "%3d %s\n", NR, $0}' | fzf --reverse --prompt="project> " --query="$1" --select-1 --exit-0 --with-nth=2.. | sed 's/^ *[0-9]* //') && cd "$dir" dir=$(find -L ${(u)roots} -mindepth 1 -maxdepth 1 -type d 2>/dev/null | sort | awk '{printf "%3d %s\n", NR, $0}' | fzf --reverse --prompt="project> " --query="$1" --select-1 --exit-0 --with-nth=2.. | sed 's/^ *[0-9]* //') && cd "$dir"
} }
function clip {
echo -ne "\033]52;c;$(base64 | tr -d '\n')\a"
}
function mkcd { function mkcd {
: "${1:?where?}" : "${1:?where?}"
[[ -e $1 ]] && { echo "file exists"; return 1 } [[ -e $1 ]] && { echo "file exists"; return 1 }
mkdir -p $1 && cd $1 mkdir -p "$1" && cd "$1"
} }
function cdtmp { function cdtmp {