Last active 1788242958

.zshrc Raw
1# ~/.zshrc - macOS Tahoe / Zsh
2
3# Hanya jalankan konfigurasi ini pada shell interaktif.
4[[ -o interactive ]] || return
5
6# -----------------------------------------------------------------------------
7# Homebrew (Apple Silicon)
8# -----------------------------------------------------------------------------
9if [[ -x /opt/homebrew/bin/brew ]]; then
10 eval "$(/opt/homebrew/bin/brew shellenv)"
11fi
12
13# -----------------------------------------------------------------------------
14# History
15# -----------------------------------------------------------------------------
16HISTFILE="$HOME/.zsh_history"
17HISTSIZE=100000
18SAVEHIST=500000
19
20setopt APPEND_HISTORY
21setopt INC_APPEND_HISTORY
22setopt HIST_IGNORE_ALL_DUPS
23setopt HIST_SAVE_NO_DUPS
24setopt HIST_REDUCE_BLANKS
25setopt HIST_IGNORE_SPACE
26setopt EXTENDED_HISTORY
27
28# -----------------------------------------------------------------------------
29# Aliases
30# -----------------------------------------------------------------------------
31alias sudo='sudo '
32
33# GNU ls dari Homebrew + vivid bila tersedia.
34if command -v gls >/dev/null 2>&1; then
35 alias ls='gls -lah --color=auto'
36else
37 # Fallback ke BSD ls bawaan macOS.
38 alias ls='ls -lahG'
39fi
40
41if command -v tree >/dev/null 2>&1; then
42 alias treeall='tree -ugsh --du'
43fi
44
45# File alias tambahan per-user.
46[[ -f "$HOME/.zsh_aliases" ]] && source "$HOME/.zsh_aliases"
47
48# -----------------------------------------------------------------------------
49# Completion Zsh
50# -----------------------------------------------------------------------------
51autoload -Uz compinit
52compinit -d "$HOME/.zcompdump"
53
54# -----------------------------------------------------------------------------
55# Custom prompt
56# -----------------------------------------------------------------------------
57[[ -f /usr/local/etc/shell-prompt.zsh ]] && source /usr/local/etc/shell-prompt.zsh
58
59# -----------------------------------------------------------------------------
60# LS_COLORS dengan tema vivid yang berubah berdasarkan tanggal
61# -----------------------------------------------------------------------------
62if command -v vivid >/dev/null 2>&1; then
63 themes=(
64 alabaster_dark ayu catppuccin-frappe catppuccin-latte dracula
65 iceberg-dark jellybeans lava molokai nord one-dark one-light
66 rose-pine rose-pine-dawn snazzy solarized-dark tokyonight-moon zenburn
67 )
68
69 current_date=$(date +%Y%m%d)
70 random_index=$(( 10#$current_date % ${#themes[@]} + 1 ))
71 theme_now=${themes[$random_index]}
72 export LS_COLORS="$(vivid generate "$theme_now")"
73fi
74
75# -----------------------------------------------------------------------------
76# Fastfetch
77# -----------------------------------------------------------------------------
78if command -v fastfetch >/dev/null 2>&1; then
79 fastfetch --config "/usr/local/etc/fastfetch/config.jsonc"
80fi
81