aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/dot_config/zsh/dot_zshrc
Commit message (Collapse)AuthorAgeFilesLines
* feat(zsh): add dj/rj aliases for dotfiles and remote-dev justfilesLibravatar sommerfeld12 days1-0/+2
| | | | | | | dj invokes ~/dotfiles/justfile and rj invokes ~/.local/share/dotfiles/remote-dev/justfile, both pinned to the justfile's directory via --working-directory so the aliases behave identically from any CWD.
* fix(zsh): only rename zellij tab when our pane is focusedLibravatar sommerfeld13 days1-5/+17
| | | | | | | | | | | | | | | | | `zellij action rename-tab` always targets the focused tab — there is no CLI way to bind the rename to the calling pane. On session resurrect zellij re-spawns every shell almost simultaneously while one tab is focused, so every precmd hook fires and they all race to rename that single focused tab; the last writer wins and the rest of the tabs are stuck at `Tab #N`. This is the "all tabs got the same label" bug from earlier. Guard the rename hooks behind a focused-pane check using `zellij action list-clients` (matches the `terminal_<ZELLIJ_PANE_ID>` column). Background panes silently skip the rename and update lazily the next time the user focuses them and a prompt fires. After resurrect that means untouched tabs say `Tab #N` until you visit them — but no tab gets a wrong label anymore.
* refactor(zsh): rename zellij tabs to dir:cmd without position prefixLibravatar sommerfeld13 days1-7/+15
| | | | | | | | | | | | | | Zellij's default 'Tab #N' name is fixed at tab creation (the N is the immutable creation index, not the live position) and never auto-updates when tabs are closed or moved, so the default is actively misleading after any tab reorg. Tmux's `renumber-windows on` has no zellij equivalent and no plugin solves this cleanly. Restore shell-side renaming but drop the position prefix `N:` — visual order in the tab bar implies position. After a session resurrect or closing a middle tab, untouched tabs still show their previous dir:cmd label until the next prompt fires there, but at least there is no misleading number to second-guess.
* fix(zsh): make compdef guard check completion fn, also wire nix-profile fpathLibravatar sommerfeld2026-05-141-8/+19
| | | | | | | | | | | | | | | | | | Previous guard checked `$+commands[Y]` (binary present in PATH), but the `compdef: unknown command or service: Y` message comes from compdef when the *completion function* `_Y` isn't registered — on the remote-dev VM `systemctl`, `just`, `lsd` are all on PATH yet zsh has no `_systemctl` because Ubuntu's system zsh doesn't include nix-profile's share/zsh/site-functions in fpath. Two-part fix: 1. Prepend $HOME/.nix-profile/share/zsh/{site-functions,vendor-completions} to fpath (when they exist) before compinit, so the completions get loaded on the VM the same way they do on Arch. 2. Switch the compdef guard to `$+_comps[Y]` — the assoc-array compinit actually populates with every command that has a registered completion handler. Still belt-and-suspenders in case something ships a binary without a matching completion file.
* fix(zsh): guard compdef on target command being installedLibravatar sommerfeld2026-05-141-5/+11
| | | | | | | | | | | | | | On minimal hosts (remote-dev VM, fresh container) several of the `compdef alias=target` lines fail at login with messages like: compdef: unknown command or service: just compdef: unknown command or service: systemctl compdef: unknown command or service: lsd — because zsh has no `_just`/`_systemctl`/`_lsd` completion function loaded when the binary isn't on the system. Wrap each call in a small helper that checks $commands[<target>] first so absent tools just silently skip their alias completion instead of spamming the prompt.
* refactor(zsh): stop renaming zellij tabs from the shellLibravatar sommerfeld2026-05-141-9/+7
| | | | | | | | | | | | | | | | | | | The hand-rolled `N:dir:cmd` tab labels could never stay in sync: - After session resurrection, tab names are restored from disk but no shell-visible event fires, so labels stayed stale until the user hit Enter to trigger precmd. - After closing a middle tab, zellij renumbers surviving tabs but again emits no per-pane event, so the `N:` prefix on every tab to the right silently became wrong. - Once a tab has a custom name, zellij's tab-bar plugin uses it verbatim — there's no way to keep the default `Tab #N` numbering while also injecting dir/cmd info. The only plugin that addresses this (vmaerten/ zellij-tab-rename) requires zellij built from main. Dropping the hooks restores zellij's built-in `Tab #N`, which is the single label that stays correct across resurrect and renumber. The zsh prompt already shows CWD inside the pane.
* feat(remote-dev): add zoxide/clang-tools/node/uv/AI agents; bring git+ssh; ↵Libravatar sommerfeld2026-05-141-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | SSH-format signing home.nix: - Add zoxide (fixes 'command not found' on shell start), clang-tools (no compiler driver), nodejs (Mason npm LSPs), uv (Mason python LSPs; does not install python3 in PATH, so Ubuntu's /usr/bin/python3 stays the system default), claude-code, github-copilot-cli. - Refine the leaf-tools policy comment: explicit denylist of build- toolchain binaries that would shadow Ubuntu's via PATH, plus a carve-out for editor/AI runtimes (node, uv, clang-tools). - Symlink ~/.config/git/{config,attributes,ignore} and ~/.ssh/config from the dotfiles tree. dot_config/zsh/dot_zshrc: guard direnv/zoxide/fzf inits with 'command -v X >/dev/null &&' so a fresh machine without one of them no longer prints a stderr error on every shell start. dot_config/git/config: append unconditional '[include] path = ~/.config/git/config.local' for machine-local overrides (used on the remote-dev VM to switch to SSH-format signing via the forwarded agent). Git silently skips missing include files. remote-dev/README.md: document the update flow (config-only vs HM rebuild), the single-shell leaf-tools policy, and the one-time VM setup for SSH-format commit signing (allowed_signers + config.local, ForwardAgent yes on the host).
* feat(remote-dev): add Nix Home-Manager flake for Ubuntu 22 VM dev envLibravatar sommerfeld2026-05-131-4/+27
| | | | | | | | | | | | | | | | | | | | | New remote-dev/ subdir with a Home-Manager flake that provisions a headless dev environment on a remote Ubuntu 22.04 VM accessed via SSH. Shares nvim, zellij, zsh, direnv, and ghostty configs from the same dotfiles repo via mkOutOfStoreSymlink (no rebuilds on config edits). CLI tool set mirrors the dev-tool subset of meta/base.txt; sysadmin tools (procs, gdu, duf), lazygit, and node/yarn (only needed for markdown-preview on GUI hosts) are excluded. bootstrap.sh is one-shot: installs Nix via Determinate Systems installer, clones the repo to ~/.local/share/dotfiles, runs home-manager switch, and chshes to the nix-store zsh. dot_config/zsh/dot_zshrc loses its hardcoded Arch plugin/git-prompt paths in favour of a fallback search: Arch path first, then $HOME/.nix-profile/share/. Same file works on host and VM. .chezmoiignore: exclude remote-dev/ from chezmoi deploy on the host.
* feat(zsh): rebuild PATH hash on every completionLibravatar sommerfeld2026-05-131-0/+1
| | | | | | | | | | | | | `zstyle ':completion:*' rehash true` makes zle re-scan $PATH directories on every TAB instead of caching the hash table at shell startup. Cost is trivial (one stat() per PATH entry per completion), benefit is that newly installed binaries — from paru, cargo install, pip install --user, npm install -g, manual /usr/local/bin drops, anything — show up immediately without an explicit `hash -r` or new shell. The pacman-hook alternative at https://wiki.archlinux.org/title/Zsh#Persistent_rehash only catches paru/pacman installs, missing cargo/pip/manual; rehash=true catches them all for the same negligible cost.
* feat(privesc): migrate from opendoas to sudo-rsLibravatar sommerfeld2026-05-131-7/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | doas's one-shot password and absent 'sudo -v' kept wasting hour-long paru AUR builds. sudo-rs is a memory-safe Rust rewrite (ISRG/Ferrous Systems), drop-in CLI compatible, and the same one Ubuntu 25.10 ships as default. We follow the Arch wiki 'Using sudo-rs without the sudo package' recipe verbatim — no custom shims. - meta/base.txt: -doas-sudo-shim +sudo-rs - etc/sudoers-rs (mode 0440): wiki minimal config + NOPASSWD reboot/poweroff - etc/pam.d/sudo: 4-line copy of upstream sudo's PAM file - run_onchange_after_deploy-etc.sh.tmpl: use real sudo, deploy sudoers-rs at 0440, create /etc/pam.d/sudo-i and /usr/local/bin/{sudo,sudoedit, su,visudo} → sudo-rs symlinks idempotently - delete etc/doas.conf, dot_local/bin/{doasedit,sudo} - zshrc: drop sudo=doas/sudoedit=doasedit aliases; rewrite ss/gimme/ pacdiff/ssys to call sudo - justfile: s/doas/sudo/g (status/diff/restore helpers) - nvim: rename :DoasWrite → :SudoWrite (uses sudo -S) - sway config: reboot/poweroff buttons call sudo - bootstrap.sh: update step-5 comment - README/KEYBINDS/copilot-instructions: flip the privesc convention No Defaults overrides: sudo's defaults (passwd_tries=3, timestamp_timeout=5) already fix the doas pain, and paru SudoLoop (kept) refreshes the 5-min window via real sudo -v.
* feat(nix): hybrid setup with flakes + direnv for per-project dev shellsLibravatar sommerfeld2026-05-131-0/+3
| | | | | | | | | | | | | | | | | | Install Nix (multi-user daemon) on Arch and wire up direnv so any project can declare its toolchain in a flake.nix and get a hermetic dev shell on cd. No NixOS, no home-manager, no migration off paru/chezmoi — just one new package manager scoped to project dev shells. - meta/nix.txt: nix from extra repo - meta/dev.txt: direnv (general-purpose, not nix-specific) - systemd-units/system/nix.txt: nix-daemon.socket (socket-activated) - etc/nix/nix.conf: enable flakes + nix-command, trusted-users=@wheel, auto-optimise-store, keep-outputs/derivations so direnv envs survive GC - dot_config/direnv/direnvrc: load nix-direnv 3.1.1 via source_url with pinned sha256 (not packaged for Arch; refusing -git AUR) - dot_config/nix/templates/{flake.nix,dev/}: flake template usable via 'nix flake init -t ~/.config/nix/templates' - dot_config/zsh/dot_zshrc: 'eval "$(direnv hook zsh)"'
* fix(zsh): preserve newlines in copy-last-outputLibravatar sommerfeld2026-05-131-1/+1
| | | | | Double-quoting a zsh array slice joins elements with spaces; use the (F) parameter expansion flag to join with newlines instead.
* feat(zsh): add Alt-Shift-Y widget to copy last command outputLibravatar sommerfeld2026-05-131-0/+39
| | | | | | | | | | | | Zellij has no native "copy last command output" feature, and ghostty's jump_to_prompt (Ctrl+Shift+J/K, via OSC 133) can't work inside zellij because zellij sits between the shell and the terminal emulator. Build it ourselves: a zle widget runs 'zellij action dump-screen --full', finds the last two lines matching the prompt prefix (user@host:), and pipes everything between them to wl-copy. Bound to Alt+Shift+Y. Requires running inside zellij and at least two prompts in the scrollback.
* feat(zsh): add wlc — tee-like wrapper around wl-copyLibravatar sommerfeld2026-05-131-0/+4
| | | | | wlc pipes stdin to stdout (visible) AND to wl-copy (clipboard). Usage: `somecmd | wlc`
* feat(zsh): add reload-env for stale zellij panesLibravatar sommerfeld2026-05-131-0/+22
| | | | | | | Re-exports WAYLAND_DISPLAY, SWAYSOCK, DBUS, SSH_AUTH_SOCK etc. from the currently running sway process, so a zellij pane whose server was started in a different session (SSH-attached, logout/login, etc.) regains working GUI/clipboard/systemctl --user.
* style: silence false-positive lint warningsLibravatar sommerfeld2026-04-211-0/+1
| | | | | | | | | | Inline directives for cases where the linter's shell/language dialect doesn't match reality: - init.lua: _G.P helper is intentional - dot_zprofile: zsh tied arrays, $+commands, optional sourcing - dot_zshrc: zsh brace-group-as-function-body - ipython_config: 'c' is injected by IPython at load time - doasedit: /bin/sh on Arch is bash, -O test is supported
* Revert partial meta cleanup: restore mold, choose, curlie, dogLibravatar sommerfeld2026-04-211-0/+1
| | | | | | | | | - mold moves cpp→dev (broader home; used by both Rust and C++ builds) - choose/curlie/dog restored to base (actively used) - restore 'alias curl=curlie' to match linux-headers stays only in nvidia.txt (pulled by nvidia-dkms; no other DKMS packages in the set).
* chore(zsh): drop 'stow' alias (migrated to chezmoi)Libravatar sommerfeld2026-04-211-1/+0
|
* fix(zsh): drop 'curl=curlie' alias (curlie removed from base)Libravatar sommerfeld2026-04-211-1/+0
|
* refactor: restructure to chezmoi source stateLibravatar sommerfeld2026-04-211-0/+322
Rename home/ contents to chezmoi naming conventions: - dot_ prefix for dotfiles and dot-dirs - private_dot_ for .gnupg and .ssh directories - private_ for 0600 files (nym.pub) - executable_ for scripts in .local/bin and display-toggle.sh - symlink_ for mimeapps.list symlink