Compare commits
2 Commits
docs/readm
...
master
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
6612cb02f1 | ||
|
|
d6e67828ea |
@@ -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-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
1
.vimrc
@@ -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>
|
||||||
|
|||||||
16
.zshrc
16
.zshrc
@@ -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"
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -179,7 +181,7 @@ function clip {
|
|||||||
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 {
|
||||||
|
|||||||
132
README.md
132
README.md
@@ -1,132 +0,0 @@
|
|||||||
# dotfiles
|
|
||||||
|
|
||||||
Bare-git managed dotfiles for zsh/vim/tmux on Linux and macOS.
|
|
||||||
|
|
||||||
## How it works
|
|
||||||
|
|
||||||
This repo uses a **bare git repository** at `~/.dotgit` with the work tree set to `$HOME`. This avoids symlinks and lets dotfiles live at their native paths.
|
|
||||||
|
|
||||||
The alias that drives everything:
|
|
||||||
|
|
||||||
```bash
|
|
||||||
alias .g='git --git-dir=$HOME/.dotgit/ --work-tree=$HOME'
|
|
||||||
```
|
|
||||||
|
|
||||||
`.g status`, `.g add`, `.g diff`, `.g commit`, `.g push` — same as git, just scoped to the dotfiles repo. Untracked files are hidden by default (`showUntrackedFiles = no` in config).
|
|
||||||
|
|
||||||
## Bootstrap on a new machine
|
|
||||||
|
|
||||||
```bash
|
|
||||||
git clone --bare https://gitea.abra.me/svxf/dotfiles.git $HOME/.dotgit
|
|
||||||
alias .g='git --git-dir=$HOME/.dotgit/ --work-tree=$HOME'
|
|
||||||
.g checkout
|
|
||||||
.g config status.showUntrackedFiles no
|
|
||||||
```
|
|
||||||
|
|
||||||
If checkout conflicts with existing files, back them up first:
|
|
||||||
|
|
||||||
```bash
|
|
||||||
.g checkout 2>&1 | grep "^\t" | xargs -I{} mv {} {}.bak
|
|
||||||
.g checkout
|
|
||||||
```
|
|
||||||
|
|
||||||
On next shell start, zinit will bootstrap itself and install all plugins automatically.
|
|
||||||
|
|
||||||
## Tracked files
|
|
||||||
|
|
||||||
| File | What it does |
|
|
||||||
|---|---|
|
|
||||||
| `.zshrc` | Shell config — plugins, aliases, functions, keybindings, PATH |
|
|
||||||
| `.vimrc` | Vim config — space-leader, persistent undo, arrow keys disabled |
|
|
||||||
| `.tmux.conf` | tmux config — mouse, green accent, fzf window switcher, auto-rename |
|
|
||||||
| `.starship.toml` | Prompt — two-line, git status, docker indicators, command duration |
|
|
||||||
| `.gitignore_global` | Global ignores — `*~`, `.DS_Store`, `__pycache__`, `.idea`, `.ipynb_checkpoints` |
|
|
||||||
|
|
||||||
## Key features
|
|
||||||
|
|
||||||
### Zinit plugin stack (`.zshrc`)
|
|
||||||
|
|
||||||
- **zsh-autosuggestions** — inline fish-style suggestions
|
|
||||||
- **zsh-syntax-highlighting** — live command coloring
|
|
||||||
- **zsh-completions** — extra completion definitions
|
|
||||||
- **zsh-history-substring-search** — up/down searches from prefix
|
|
||||||
- **starship** — installed via zinit from GitHub releases
|
|
||||||
|
|
||||||
### Async dotfiles pull
|
|
||||||
|
|
||||||
On shell start, a background job pulls `--ff-only` from origin once per day (marker at `~/.cache/.dotfiles-pull`). Silent, non-blocking.
|
|
||||||
|
|
||||||
### Starship prompt (`.starship.toml`)
|
|
||||||
|
|
||||||
Two-line layout:
|
|
||||||
- **Line 1**: docker container indicator → docker-compose status → git branch/status → (fill) → directory
|
|
||||||
- **Line 2**: `➤` character (green=ok, red=error)
|
|
||||||
- **Right**: command duration (>5s) → user@host → time
|
|
||||||
|
|
||||||
Custom modules detect `/.dockerenv` for container awareness and parse `docker compose ps` for service status.
|
|
||||||
|
|
||||||
### fzf integration (`.zshrc`)
|
|
||||||
|
|
||||||
Sources fzf keybindings and completion when available. Default opts: `--height 40% --reverse`.
|
|
||||||
|
|
||||||
### Project switcher — `pj` (`.zshrc`)
|
|
||||||
|
|
||||||
Fuzzy-finds directories under `/projects` or `~/projects` using fzf. `pj foo` pre-fills the query.
|
|
||||||
|
|
||||||
### Yazi wrapper — `y` (`.zshrc`)
|
|
||||||
|
|
||||||
Wraps the yazi file manager so the shell `cd`s to wherever you navigated on exit.
|
|
||||||
|
|
||||||
### Docker compose aliases (`.zshrc`)
|
|
||||||
|
|
||||||
| Alias | Expands to |
|
|
||||||
|---|---|
|
|
||||||
| `,dcdu` | `docker compose --profile dev up service_dev --force-recreate --detach` |
|
|
||||||
| `,dcdd` | `docker compose --profile dev down --remove-orphans` |
|
|
||||||
| `,dcdl` | `docker compose --profile dev logs -f service_dev` |
|
|
||||||
| `dcu` | `docker compose up --force-recreate --detach` |
|
|
||||||
| `dcd` | `docker compose down --remove-orphans` |
|
|
||||||
| `dcl` | `docker compose logs -f` |
|
|
||||||
|
|
||||||
### Tmux aliases (`.zshrc`)
|
|
||||||
|
|
||||||
| Alias | What it does |
|
|
||||||
|---|---|
|
|
||||||
| `tmuxr` | Attach-or-create session named "auto" |
|
|
||||||
| `tmuxn` | Same + opens a new window |
|
|
||||||
| `tmuxa NAME` | Attach-or-create a named session |
|
|
||||||
|
|
||||||
### Tmux keybindings (`.tmux.conf`)
|
|
||||||
|
|
||||||
- **Shift+Left/Right** — switch windows (no wrap)
|
|
||||||
- **PgUp/PgDn** — swap window position left/right
|
|
||||||
- **prefix+f** — fzf fuzzy window switcher
|
|
||||||
- **prefix+R** — rename window
|
|
||||||
- Splits retain current path. 1-indexed windows, auto-rename shows `command@directory`.
|
|
||||||
|
|
||||||
### Vim (`.vimrc`)
|
|
||||||
|
|
||||||
Space as leader. `jk` exits insert mode. Persistent undo in `~/.vim/undo/`. Arrow keys disabled (hjkl only). Mouse enabled. Smart case search. 8-line scroll margin.
|
|
||||||
|
|
||||||
### Utility functions (`.zshrc`)
|
|
||||||
|
|
||||||
| Function | Purpose |
|
|
||||||
|---|---|
|
|
||||||
| `clip` | Pipe stdin to system clipboard via OSC 52 (works over SSH/tmux) |
|
|
||||||
| `mkcd DIR` | mkdir + cd in one step |
|
|
||||||
| `cdtmp [label]` | Create and cd into a timestamped temp dir under `~/tmp/` |
|
|
||||||
|
|
||||||
### Other aliases (`.zshrc`)
|
|
||||||
|
|
||||||
- `c` → `claude`
|
|
||||||
- `,cd` → `claude --dangerously-skip-permissions` (with sandbox flag)
|
|
||||||
- `zshreload` → `exec zsh`
|
|
||||||
- `LATEST` — global alias expanding to `*(om[1])` (most recently modified file)
|
|
||||||
|
|
||||||
### Shell options (`.zshrc`)
|
|
||||||
|
|
||||||
Extended history (100k lines, shared, deduped). Case-insensitive globbing. Auto-pushd on cd. No flow control (Ctrl-S disabled). Emacs keybindings with Ctrl+X,E / Alt+E for `$EDITOR`.
|
|
||||||
|
|
||||||
### Machine-local overrides
|
|
||||||
|
|
||||||
`~/.zshrc-extra` is sourced at the end if it exists — for per-machine config that doesn't belong in version control.
|
|
||||||
Reference in New Issue
Block a user