Last active
April 1, 2025 19:29
-
-
Save tobyjsullivan/79d87f2b279f7b59a8d0f9b6b2aedf53 to your computer and use it in GitHub Desktop.
.zshrc
This file contains hidden or 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
# share history across sessions | |
setopt inc_append_history | |
setopt share_history | |
# Setup tab completion | |
autoload -Uz compinit | |
compinit | |
# fix opt+backspace on paths | |
autoload -U select-word-style | |
select-word-style bash | |
# customize prompt | |
## git branch name in prompt | |
function use_git_prompt() | |
{ | |
autoload -Uz vcs_info | |
precmd_vcs_info() { vcs_info } | |
precmd_functions+=( precmd_vcs_info ) | |
RPROMPT='%F{red}%B${vcs_info_msg_0_}%b%f' | |
# ref: https://zsh.sourceforge.io/Doc/Release/User-Contributions.html#vcs_005finfo-Variables | |
zstyle ':vcs_info:git:*' check-for-changes true | |
zstyle ':vcs_info:git:*' formats '(%b)%c%u' | |
} | |
## remove hostname from prompt | |
function use_clean_prompt() | |
{ | |
PS1='%1~ %# ' | |
} | |
setopt prompt_subst | |
use_git_prompt | |
use_clean_prompt | |
# Recommended by brew doctor | |
export PATH="/usr/local/sbin:$PATH" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment