Show only basename and git branch in prompt
* Switch order from "[git branch][pathname]" to "basename git branch %". * Remove noisy brackets. Example old: [master][~/dev/thoughtbot/dotfiles] Example new: dotfiles dc-prompt %
This commit is contained in:
parent
397155648d
commit
7dbc8f44a1
1 changed files with 2 additions and 2 deletions
4
zshrc
4
zshrc
|
@ -2,11 +2,11 @@
|
|||
git_prompt_info() {
|
||||
ref=$(git symbolic-ref HEAD 2> /dev/null)
|
||||
if [[ -n $ref ]]; then
|
||||
echo "[%{$fg_bold[green]%}${ref#refs/heads/}%{$reset_color%}]"
|
||||
echo " %{$fg_bold[green]%}${ref#refs/heads/}%{$reset_color%}"
|
||||
fi
|
||||
}
|
||||
setopt promptsubst
|
||||
export PS1='$(git_prompt_info)[${SSH_CONNECTION+"%{$fg_bold[green]%}%n@%m:"}%{$fg_bold[blue]%}%~%{$reset_color%}] '
|
||||
export PS1='${SSH_CONNECTION+"%{$fg_bold[green]%}%n@%m:"}%{$fg_bold[blue]%}%c%{$reset_color%}$(git_prompt_info) %# '
|
||||
|
||||
# load our own completion functions
|
||||
fpath=(~/.zsh/completion $fpath)
|
||||
|
|
Loading…
Add table
Reference in a new issue