]> git.quilime.com - cfg.git/commitdiff
Adding git to OSX prompt
authorGabriel Dunne <gdunne@quilime.com>
Wed, 6 Apr 2022 17:14:31 +0000 (10:14 -0700)
committerGabriel Dunne <gdunne@quilime.com>
Wed, 6 Apr 2022 17:14:31 +0000 (10:14 -0700)
.zsh-darwin
.zshrc

index 22ad1d41e8515cd6eba4bf5b36a631799f5bff5c..8bddbf37acb1f117c49e6c3f7edaac12bd480a7d 100644 (file)
@@ -1,8 +1,17 @@
+#!/bin/sh
+# git
+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'
 
 # prompt
 # time: %F{magenta}%* 
 PROMPT='%F{cyan}%n@%m%f %F{240}%1~ %f%# '
-RPROMPT='%F{240}%*%f'
+RPROMPT='%F{green}${vcs_info_msg_0_} %F{240}%*%f'
 
 # aliases
 alias cfg='/usr/bin/git --git-dir=/Users/gld/.cfg/ --work-tree=/Users/gld'
diff --git a/.zshrc b/.zshrc
index f23c5e0fe3c295bac7c89f590e0929d789079ac9..ffba2fb8c406c1d8e79f1bbda566f30fc6a2ac20 100644 (file)
--- a/.zshrc
+++ b/.zshrc
@@ -1,5 +1,5 @@
 if [[ "$OSTYPE" == "darwin"* ]]; then
-    
+
     # if OSX
     if [[ -e ~/.zsh-darwin ]]; then
         source ~/.zsh-darwin