Skip to content

Instantly share code, notes, and snippets.

@pavelrevak
Last active October 8, 2019 19:28
Show Gist options
  • Save pavelrevak/0371352ea97e35d6c77f06a193117916 to your computer and use it in GitHub Desktop.
Save pavelrevak/0371352ea97e35d6c77f06a193117916 to your computer and use it in GitHub Desktop.
zsh@macos configuration: simple prompt in colors: "user@host time path [git branch] $"
# macports path
if [ -d "/opt/local/bin" ] ; then
PATH="/opt/local/bin:$PATH"
fi
if [ -d "/opt/local/sbin" ] ; then
PATH="/opt/local/sbin:$PATH"
fi
# user path
if [ -d "$HOME/Software/gcc-arm-none-eabi/bin" ] ; then
PATH="$HOME/Software/gcc-arm-none-eabi/bin:$PATH"
fi
if [ -d "$HOME/Software/bin" ] ; then
PATH="$HOME/Software/bin:$PATH"
fi
# Setting PATH for Python 3.7
PATH="/Library/Frameworks/Python.framework/Versions/3.7/bin:${PATH}"
# color listing
export CLICOLOR=1
# history
SAVEHIST=1000000
setopt HIST_IGNORE_DUPS
setopt APPEND_HISTORY
setopt EXTENDED_HISTORY
setopt HIST_IGNORE_SPACE
setopt HIST_REDUCE_BLANKS
# FN-SHIFT-LEFT/RIGHT for HOME/END
bindkey "^[[H" beginning-of-line
bindkey "^[[F" end-of-line
# completion
autoload -Uz compinit && compinit
# git status
autoload -Uz vcs_info
setopt PROMPT_SUBST
precmd_vcs_info() { vcs_info }
precmd_functions+=( precmd_vcs_info )
# show only git branch in prompt
zstyle ':vcs_info:git:*' formats ' %F{cyan}%b%f'
# prompt: "user@host time path [branch] $"
PROMPT="%B%F{magenta}%n@%m%f %F{blue}%T%f %F{white}%~%f%b\$vcs_info_msg_0_ %(?.%F{green}.%F{red})%(!.#.$)%f "
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment