File
Blob: container/root.zshrc
| 1 | autoload -Uz colors compinit vcs_info |
| 2 | |
| 3 | colors |
| 4 | |
| 5 | mkdir -p ~/.cache/zsh |
| 6 | compinit -d ~/.cache/zsh/zcompdump |
| 7 | |
| 8 | setopt AUTO_CD |
| 9 | setopt AUTO_MENU |
| 10 | setopt COMPLETE_IN_WORD |
| 11 | setopt HIST_IGNORE_ALL_DUPS |
| 12 | setopt HIST_IGNORE_SPACE |
| 13 | setopt HIST_REDUCE_BLANKS |
| 14 | setopt INTERACTIVE_COMMENTS |
| 15 | setopt PROMPT_SUBST |
| 16 | setopt SHARE_HISTORY |
| 17 | # Avoid zsh's partial-line prompt marker (`#` for root) in the web terminal. |
| 18 | unsetopt PROMPT_SP |
| 19 | |
| 20 | HISTFILE=~/.zsh_history |
| 21 | HISTSIZE=10000 |
| 22 | SAVEHIST=10000 |
| 23 | |
| 24 | zstyle ':completion:*' menu select |
| 25 | zstyle ':completion:*' matcher-list 'm:{a-z}={A-Z}' |
| 26 | zstyle ':vcs_info:*' enable git |
| 27 | zstyle ':vcs_info:git:*' check-for-changes true |
| 28 | zstyle ':vcs_info:git:*' stagedstr '+' |
| 29 | zstyle ':vcs_info:git:*' unstagedstr '*' |
| 30 | zstyle ':vcs_info:git:*' formats ' %F{244}[%b%c%u]%f' |
| 31 | zstyle ':vcs_info:git:*' actionformats ' %F{244}[%b|%a%c%u]%f' |
| 32 | |
| 33 | precmd() { |
| 34 | vcs_info |
| 35 | } |
| 36 | |
| 37 | if [ -r /usr/share/zsh-autosuggestions/zsh-autosuggestions.zsh ]; then |
| 38 | source /usr/share/zsh-autosuggestions/zsh-autosuggestions.zsh |
| 39 | fi |
| 40 | |
| 41 | if [ -r /usr/share/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh ]; then |
| 42 | source /usr/share/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh |
| 43 | fi |
| 44 | |
| 45 | bindkey '^[[A' history-beginning-search-backward |
| 46 | bindkey '^[[B' history-beginning-search-forward |
| 47 | |
| 48 | export SHELL=/usr/bin/zsh |
| 49 | |
| 50 | ccccocc_print_startup_banner() { |
| 51 | local -a agents editors tooling |
| 52 | local cmd |
| 53 | |
| 54 | for cmd in claude codex; do |
| 55 | if command -v "$cmd" >/dev/null 2>&1; then |
| 56 | agents+=("$cmd") |
| 57 | fi |
| 58 | done |
| 59 | |
| 60 | for cmd in vim emacs; do |
| 61 | if command -v "$cmd" >/dev/null 2>&1; then |
| 62 | editors+=("$cmd") |
| 63 | fi |
| 64 | done |
| 65 | |
| 66 | for cmd in git node npm curl; do |
| 67 | if command -v "$cmd" >/dev/null 2>&1; then |
| 68 | tooling+=("$cmd") |
| 69 | fi |
| 70 | done |
| 71 | |
| 72 | print -P "%F{81}ccccocc%f %F{244}sandbox terminal%f" |
| 73 | print "Workspace: /workspace" |
| 74 | |
| 75 | if (( ${#agents[@]} > 0 )); then |
| 76 | print "Agents: ${(j:, :)agents}" |
| 77 | fi |
| 78 | |
| 79 | if (( ${#editors[@]} > 0 )); then |
| 80 | print "Editors: ${(j:, :)editors}" |
| 81 | fi |
| 82 | |
| 83 | if (( ${#tooling[@]} > 0 )); then |
| 84 | print "Tooling: ${(j:, :)tooling}" |
| 85 | fi |
| 86 | |
| 87 | print "" |
| 88 | } |
| 89 | |
| 90 | if [[ -o interactive && -z "${CCCCOCC_STARTUP_BANNER_SHOWN:-}" ]]; then |
| 91 | export CCCCOCC_STARTUP_BANNER_SHOWN=1 |
| 92 | ccccocc_print_startup_banner |
| 93 | fi |
| 94 | |
| 95 | PROMPT='%F{81}%~%f${vcs_info_msg_0_} $ ' |