Compare commits

1 Commits

Author SHA1 Message Date
svxf
c643f0b719 fix: use zsh idioms and quote variables in shell config
- Use [[ ]] instead of [ ] for conditionals (zsh idiom)
- Quote variable expansions in ZINIT_HOME checks and dirname call
- Quote dollar-1 in mkcd function
- Remove extra blank line in .vimrc

Nightshift-Task: lint-fix
Nightshift-Ref: https://github.com/marcus/nightshift
2026-03-03 22:05:32 +00:00
3 changed files with 4 additions and 97 deletions

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>

8
.zshrc
View File

@@ -36,8 +36,8 @@ 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"
zinit light zsh-users/zsh-autosuggestions
@@ -158,7 +158,7 @@ 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 +179,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__`.