This gives you: - Ctrl+R history search (built-in) - History
timestamps (short) - ↑ / ↓ search through history by what you
already typed - Completion (autocomplete) - Autosuggestions
(typeahead) - Syntax highlighting - Git branch in prompt - Date/time in
prompt (via RPROMPT)
cp ~/.zshrc ~/.zshrc.bak.$(date +%Y%m%d-%H%M%S)mkdir -p ~/.zsh/pluginsgit clone https://github.com/zsh-users/zsh-autosuggestions ~/.zsh/plugins/zsh-autosuggestions
git clone https://github.com/zsh-users/zsh-syntax-highlighting ~/.zsh/plugins/zsh-syntax-highlighting# -------------------------
# Minimal Zsh setup
# -------------------------
# ---- History (fast + timestamps) ----
HISTFILE="$HOME/.zsh_history"
HISTSIZE=50000
SAVEHIST=50000
setopt APPEND_HISTORY
setopt INC_APPEND_HISTORY
setopt SHARE_HISTORY
setopt HIST_IGNORE_DUPS
setopt HIST_IGNORE_ALL_DUPS
setopt HIST_REDUCE_BLANKS
setopt HIST_VERIFY
setopt EXTENDED_HISTORY # stores timestamps in the history file
# Show timestamps when you run `history`
HIST_STAMPS="yyyy-mm-dd"
# ---- Keybindings ----
bindkey -e
# Ctrl+R reverse incremental history search (built-in)
bindkey '^R' history-incremental-search-backward
# Up/Down: search history by what you've typed so far
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 # Up
bindkey '^[[B' down-line-or-beginning-search # Down
# ---- Completion (autocomplete) ----
autoload -Uz compinit
compinit -C
zstyle ':completion:*' menu select
zstyle ':completion:*' matcher-list 'm:{a-zA-Z}={A-Za-z}'
zstyle ':completion:*' completer _complete _approximate
# ---- Git branch in prompt (built-in vcs_info) ----
autoload -Uz vcs_info
zstyle ':vcs_info:*' enable git
zstyle ':vcs_info:git:*' formats ' (%b)'
precmd() { vcs_info }
setopt PROMPT_SUBST
# Left prompt: user@host path (branch)
PROMPT='%F{cyan}%n@%m%f %F{blue}%~%f%F{magenta}${vcs_info_msg_0_}%f %# '
# Right prompt: date/time (clean + subtle)
RPROMPT='%F{yellow}%D{%H:%M}%f'
# ---- Autosuggestions ----
source "$HOME/.zsh/plugins/zsh-autosuggestions/zsh-autosuggestions.zsh"
# ---- Syntax highlighting (MUST be last) ----
source "$HOME/.zsh/plugins/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh"exec zshCtrl+R→ reverse history search\- Type
gitthen press↑→ cycles matching commands\ history 5→ shows timestamps\cd+Tab→ completion menu\- Inside a git repo → prompt shows
(branch)\ - Right side shows time
RPROMPT='%F{yellow}%D{%Y-%m-%d %H:%M}%f'PROMPT='%F{yellow}%D{%Y-%m-%d %H:%M}%f %F{cyan}%n@%m%f %F{blue}%~%f%F{magenta}${vcs_info_msg_0_}%f %# '
RPROMPT=''