Last active
November 12, 2020 16:49
-
-
Save rstecca/c3da09e6996a2894fdfca6689bcab21e to your computer and use it in GitHub Desktop.
macOS .zshrc boilerplate (essential with current git branch)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/zsh | |
export EDITOR="nvim" | |
export VISUAL="nvim" | |
export ZDOTDIR="$XDG_CONFIG_HOME/zsh" | |
export HISTFILE="$ZDOTDIR/.zhistory" # History filepath | |
export HISTSIZE=10000 # Maximum events for internal history | |
export SAVEHIST=10000 | |
autoload -U promptinit | |
promptinit | |
# prompt bart # red yellow magenta | |
autoload -Uz compinit; compinit | |
# - # - # - # - # - # - # - # - # - # - # - # - # | |
## https://git-scm.com/book/en/v2/Appendix-A%3A-Git-in-Other-Environments-Git-in-Zsh | |
autoload -Uz vcs_info | |
precmd_vcs_info() { vcs_info } | |
precmd_functions+=( precmd_vcs_info ) | |
setopt prompt_subst | |
RPROMPT=\$vcs_info_msg_0_ | |
# PROMPT=\$vcs_info_msg_0_'%# ' | |
zstyle ':vcs_info:git:*' formats '%b' | |
# - # - # - # - # - # - # - # - # - # - # - # - # | |
autoload -U colors && colors1 ## load colors definitions | |
## how this prompt was built (mini tutorial) | |
## PROMPT="[%n] " ## show username | |
## PROMPT="[%n]%~ " ## add the path relative to ~ | |
## PROMPT="[%n]%~ %% " ## add '%' | |
## PROMPT="[%n]%~ %B%%%b " ## add bold to '%' | |
PROMPT="%{%F{cyan}%}[%n]%~%{%f%} %B%%%b " ## add colors (reset with %{%f%}) | |
PROMPT="%{%F{cyan}%}%n]%~%{%f%} %B%%%b " ## got rid of a '[' because. | |
export PATH="/usr/local/sbin:$PATH" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Tested in macOS Catalina