2 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
4 changed files with 15 additions and 100 deletions

View File

@@ -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"

1
.vimrc
View File

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

16
.zshrc
View File

@@ -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,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"
}
@@ -179,7 +181,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 {

View File

@@ -1,92 +0,0 @@
# dotfiles
Personal dotfiles managed as a bare Git repository. The repo lives at `~/.dotgit/` with the work tree set to `$HOME`, so tracked files sit at their real paths without symlinks.
## Bootstrap
```bash
# Clone bare repo
git clone --bare https://gitea.abra.me/svxf/dotfiles.git "$HOME/.dotgit"
# Checkout files into $HOME
git --git-dir="$HOME/.dotgit/" --work-tree="$HOME" checkout
# Hide untracked files from status noise
git --git-dir="$HOME/.dotgit/" --work-tree="$HOME" config status.showUntrackedFiles no
```
After checkout, restart your shell. Zinit and Starship will self-install on first launch.
## Usage
The `.g` alias wraps `git --git-dir=$HOME/.dotgit/ --work-tree=$HOME`, so everyday operations look like:
```bash
.g status
.g add ~/.vimrc
.g commit -m "update vimrc"
.g push
```
A background job in `.zshrc` auto-pulls once per day (`~/.cache/.dotfiles-pull` marker).
## File summaries
### .zshrc
Shell configuration and the main entry point.
- **Plugin manager**: Zinit (auto-installed from `zdharma-continuum/zinit`). Plugins: `zsh-autosuggestions`, `zsh-syntax-highlighting`, `zsh-completions`, `zsh-history-substring-search`.
- **History**: 100k entries, shared across sessions, deduped, extended format.
- **Completions**: Case-insensitive matching, menu selection.
- **Keybindings**: Emacs mode. Ctrl+Q push-line, Alt+E / Ctrl+X,E edit-command-line, Up/Down prefix search.
- **Prompt**: Starship (installed via Zinit from GitHub releases).
- **fzf integration**: Keybindings and completion sourced when available; `--height 40% --reverse` default opts.
- **PATH**: `/projects/bin`, `~/.local/bin`, `~/.cargo/bin`, `/usr/local/go/bin`, `~/go/bin`, `/opt/homebrew/bin`.
- **Aliases**:
- `.g` — bare-repo git wrapper
- `tmuxr` / `tmuxn` / `tmuxa` — tmux attach-or-create helpers
- `,dcdu` / `,dcdd` / `,dcdl` — docker-compose dev-profile shortcuts
- `dcu` / `dcd` / `dcl` — generic docker-compose shortcuts
- `c` / `,cd` — Claude CLI / Claude with sandbox skip
- `LATEST` — global alias expanding to most-recently-modified file
- **Functions**:
- `y` — yazi file manager wrapper that `cd`s to the selected directory on exit
- `pj` — fuzzy project switcher (searches `/projects` and `~/projects` via fzf)
- `clip` — pipe stdin to system clipboard via OSC 52 escape sequence
- `mkcd` — mkdir + cd in one step
- `cdtmp` — create and cd into a timestamped temp directory under `~/tmp/`
- **Extras**: `~/.zshrc-extra` sourced at end for machine-local overrides (not tracked).
### .tmux.conf
- **Mouse** enabled, clipboard passthrough on.
- **Splits** preserve current path.
- **Navigation**: Shift+Arrow switches windows (no wrap), Alt+Arrow switches panes, PgUp/PgDn swaps window order.
- **Window naming**: Auto-rename to `command@dir`.
- **Fuzzy switcher**: `prefix + f` opens fzf popup to pick a window.
- **Status bar**: Dark theme (colour235 bg), green session indicator, powerline-style window tabs with alternating shading, no right-side status.
- **Pane borders**: Green active, grey inactive.
- **Base index**: 1 (not 0).
### .vimrc
- `jk` mapped to Escape, Space as leader.
- 4-space soft tabs, syntax on, cursor line highlighted.
- Persistent undo (`~/.vim/undo/`), swap and backup dirs under `~/.vim/`.
- Smart case search, incremental + highlighted.
- Arrow keys disabled in normal mode (forces hjkl).
- Mouse support enabled, 8-line scroll margin.
### .starship.toml
Two-line prompt:
- **Line 1** (left → right): Docker container indicator (if inside), docker-compose service summary (running/stopped counts), git branch + status, fill, directory.
- **Line 2**: `➤` character (green on success, red on error).
- **Right prompt**: Command duration (>5s), `user@host`, time.
- Docker-compose status uses `docker compose ps --format json | jq` to show `▲N/▼N` counts.
### .gitignore_global
Ignores: `*~`, `.DS_Store`, `.idea`, `.ipynb_checkpoints`, `__pycache__`.