bundlewrap/bundles/zsh/files/zprofile
CroneKorkN f3122f3d0a
refactor(zsh): replace oh-my-zsh with a hand-rolled zprofile
Drops both git_deploy clones (ohmyzsh, zsh-autosuggestions), the chown
action, the bw.zsh-theme, and the plugin directories. /etc/zsh/zprofile
now embeds a compact prompt mirroring the old theme's colors (no git
segment), sources zsh-autosuggestions from the new apt package, and
binds prefix-history search on the arrow keys.

Per-user ~/.zshrc is kept as a one-line marker so zsh-newuser-install
doesn't fire when ckn logs in.

Leftover /etc/zsh/oh-my-zsh/ trees aren't removed automatically — clean
once with `bw run linux 'rm -rf /etc/zsh/oh-my-zsh'` after the next
fleet-wide apply.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-16 01:00:07 +02:00

36 lines
1.4 KiB
Bash
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# /etc/zsh/zprofile — managed by ckn-bw bundles/zsh
# Sourced for login shells only. SSH gives login shells; that's all we need.
setopt prompt_subst
autoload -Uz colors && colors
autoload -Uz compinit && compinit
zstyle ':completion:*' matcher-list 'm:{a-z}={A-Z}'
# Mirrors the old bw.zsh-theme colors (sans git segment) plus a closing arrow:
# user — bold, yellow normally, green as root
# host — bold, green when last cmd succeeded, red otherwise
# path — cyan (full path, ~ for $HOME)
# — bold, same green/red as host
PROMPT='%B%(!.%F{green}.%F{yellow})%n%f%b@%B%(?.%F{green}.%F{red})%m%f%b %F{cyan}%~%f %(?.%F{green}.%F{red})%B%b%f '
# Prefix-based history search on arrow keys
autoload -Uz up-line-or-beginning-search down-line-or-beginning-search
zle -N up-line-or-beginning-search
zle -N down-line-or-beginning-search
bindkey '^[[A' up-line-or-beginning-search
bindkey '^[[B' down-line-or-beginning-search
bindkey '^[OA' up-line-or-beginning-search
bindkey '^[OB' down-line-or-beginning-search
# Autosuggestions (apt-installed; guarded for minimal images)
[[ -r /usr/share/zsh-autosuggestions/zsh-autosuggestions.zsh ]] \
&& source /usr/share/zsh-autosuggestions/zsh-autosuggestions.zsh
# Server-only conveniences, carried over from the old zprofile
alias s='sudo su - root -s /usr/bin/zsh'
hhtop() {
mkdir -p ~/.config/htop
cp /etc/htoprc.global ~/.config/htop/htoprc
htop
}