Compare commits
4 Commits
7062581131
...
docs/add-r
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
f0c477104e | ||
| 396c36f5a9 | |||
| d11695bcf8 | |||
| 0a7d11c6d4 |
26
.tmux.conf
26
.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,9 @@ 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
|
||||
# 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 +33,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"
|
||||
|
||||
5
.zshrc
5
.zshrc
@@ -112,6 +112,7 @@ zinit light starship/starship
|
||||
# paths
|
||||
typeset -U path
|
||||
path=(
|
||||
/projects/bin
|
||||
$HOME/.local/bin
|
||||
$HOME/.cargo/bin
|
||||
/usr/local/go/bin
|
||||
@@ -171,6 +172,10 @@ 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 }
|
||||
|
||||
92
README.md
Normal file
92
README.md
Normal file
@@ -0,0 +1,92 @@
|
||||
# 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__`.
|
||||
Reference in New Issue
Block a user