jeudi 21 avril 2022

Ajouter Git au prompt Zsh

 https://www.themoderncoder.com/add-git-branch-information-to-your-zsh-prompt/

modifier la config (vim faire i (insert mode) modifier puis ESC puis :x! pour save ou :w! pour quit-no-save)

vim ~/.zshrc
Ajouter ensuite :
# Load version control information
autoload -Uz vcs_info
precmd() { vcs_info }

# Format the vcs_info_msg_0_ variable
zstyle ':vcs_info:git:*' formats 'on branch %b'
 
# Set up the prompt (with git branch name)
setopt PROMPT_SUBST
PROMPT='%n in ${PWD/#$HOME/~} ${vcs_info_msg_0_} > '

Aucun commentaire:

Enregistrer un commentaire