From 030aac759aa975824b210746e68c2b3dcbedc462 Mon Sep 17 00:00:00 2001 From: Gabriel Dunne Date: Wed, 6 Apr 2022 10:14:31 -0700 Subject: [PATCH] Adding git to OSX prompt --- .zsh-darwin | 11 ++++++++++- .zshrc | 2 +- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/.zsh-darwin b/.zsh-darwin index 22ad1d4..8bddbf3 100644 --- a/.zsh-darwin +++ b/.zsh-darwin @@ -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 f23c5e0..ffba2fb 100644 --- a/.zshrc +++ b/.zshrc @@ -1,5 +1,5 @@ if [[ "$OSTYPE" == "darwin"* ]]; then - + # if OSX if [[ -e ~/.zsh-darwin ]]; then source ~/.zsh-darwin -- 2.34.1