Skip to content
File

Blob: container/root.zshrc

2.2 KB
1autoload -Uz colors compinit vcs_info
2 
3colors
4 
5mkdir -p ~/.cache/zsh
6compinit -d ~/.cache/zsh/zcompdump
7 
8setopt AUTO_CD
9setopt AUTO_MENU
10setopt COMPLETE_IN_WORD
11setopt HIST_IGNORE_ALL_DUPS
12setopt HIST_IGNORE_SPACE
13setopt HIST_REDUCE_BLANKS
14setopt INTERACTIVE_COMMENTS
15setopt PROMPT_SUBST
16setopt SHARE_HISTORY
17# Avoid zsh's partial-line prompt marker (`#` for root) in the web terminal.
18unsetopt PROMPT_SP
19 
20HISTFILE=~/.zsh_history
21HISTSIZE=10000
22SAVEHIST=10000
23 
24zstyle ':completion:*' menu select
25zstyle ':completion:*' matcher-list 'm:{a-z}={A-Z}'
26zstyle ':vcs_info:*' enable git
27zstyle ':vcs_info:git:*' check-for-changes true
28zstyle ':vcs_info:git:*' stagedstr '+'
29zstyle ':vcs_info:git:*' unstagedstr '*'
30zstyle ':vcs_info:git:*' formats ' %F{244}[%b%c%u]%f'
31zstyle ':vcs_info:git:*' actionformats ' %F{244}[%b|%a%c%u]%f'
32 
33precmd() {
34 vcs_info
35}
36 
37if [ -r /usr/share/zsh-autosuggestions/zsh-autosuggestions.zsh ]; then
38 source /usr/share/zsh-autosuggestions/zsh-autosuggestions.zsh
39fi
40 
41if [ -r /usr/share/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh ]; then
42 source /usr/share/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh
43fi
44 
45bindkey '^[[A' history-beginning-search-backward
46bindkey '^[[B' history-beginning-search-forward
47 
48export SHELL=/usr/bin/zsh
49 
50ccccocc_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 
90if [[ -o interactive && -z "${CCCCOCC_STARTUP_BANNER_SHOWN:-}" ]]; then
91 export CCCCOCC_STARTUP_BANNER_SHOWN=1
92 ccccocc_print_startup_banner
93fi
94 
95PROMPT='%F{81}%~%f${vcs_info_msg_0_} $ '