Compare commits
5 Commits
7062581131
...
master
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
6612cb02f1 | ||
|
|
d6e67828ea | ||
| 396c36f5a9 | |||
| d11695bcf8 | |||
| 0a7d11c6d4 |
32
.tmux.conf
32
.tmux.conf
@@ -5,6 +5,8 @@ set -g history-limit 100000
|
||||
|
||||
# mouse
|
||||
set -g mouse on
|
||||
set -s set-clipboard on
|
||||
set -g allow-passthrough on
|
||||
|
||||
# utf8 / colors
|
||||
set -g default-terminal "screen-256color"
|
||||
@@ -19,9 +21,15 @@ 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"
|
||||
|
||||
# swap windows left/right with Ctrl+Shift+Arrow
|
||||
bind-key -n C-S-Left swap-window -t -1\; select-window -t -1
|
||||
bind-key -n C-S-Right swap-window -t +1\; select-window -t +1
|
||||
# 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"
|
||||
|
||||
# sensible defaults
|
||||
set -s escape-time 10
|
||||
@@ -31,10 +39,26 @@ set -g renumber-windows on
|
||||
|
||||
# Auto-rename windows: directory/process
|
||||
set -g automatic-rename on
|
||||
set -g automatic-rename-format '#{pane_current_command}@#{b:pane_current_path}'
|
||||
set -g automatic-rename-format '#{pane_current_command}@#{b:pane_current_path}#{?pane_title,: #{pane_title},}'
|
||||
|
||||
# Rename window (prefix + R)
|
||||
bind R command-prompt -I "#{window_name}" "rename-window '%%'"
|
||||
|
||||
# Fuzzy window switcher (prefix + f)
|
||||
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=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=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=colour238"
|
||||
set -g pane-active-border-style "fg=colour34"
|
||||
|
||||
1
.vimrc
1
.vimrc
@@ -24,7 +24,6 @@ set backupdir=~/.vim/backup//
|
||||
set nobackup
|
||||
set mouse=a " mouse support
|
||||
|
||||
|
||||
noremap <Up> <NOP>
|
||||
noremap <Down> <NOP>
|
||||
noremap <Left> <NOP>
|
||||
|
||||
21
.zshrc
21
.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
|
||||
@@ -112,6 +113,7 @@ zinit light starship/starship
|
||||
# paths
|
||||
typeset -U path
|
||||
path=(
|
||||
/projects/bin
|
||||
$HOME/.local/bin
|
||||
$HOME/.cargo/bin
|
||||
/usr/local/go/bin
|
||||
@@ -148,16 +150,17 @@ 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 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
|
||||
|
||||
# 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"
|
||||
}
|
||||
|
||||
@@ -171,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"
|
||||
}
|
||||
|
||||
function clip {
|
||||
echo -ne "\033]52;c;$(base64 | tr -d '\n')\a"
|
||||
}
|
||||
|
||||
function mkcd {
|
||||
: "${1:?where?}"
|
||||
[[ -e $1 ]] && { echo "file exists"; return 1 }
|
||||
mkdir -p $1 && cd $1
|
||||
mkdir -p "$1" && cd "$1"
|
||||
}
|
||||
|
||||
function cdtmp {
|
||||
|
||||
Reference in New Issue
Block a user