Skip to content
Create a gist now

Instantly share code, notes, and snippets.

Embed URL


Subversion checkout URL

You can clone with
Download ZIP
ZSH Prompt w/ VI Cmd Mode and Git status
source ~/.zsh/zsh-git-prompt/
# makes color constants available
autoload -U colors
# enable colored output from ls, etc
export CLICOLOR=1
export LSCOLORS=gxBxhxDxfxhxhxhxhxcxcx
# expand functions in the prompt
setopt prompt_subst
# prompt
local ssh_prompt="%F{064}%n@%m%f:"
local MODE_INDICATOR="%F{136}-%fvi-cmd%F{136}-%f"
# Set path to red if return code is not 0
export PROMPT="${SSH_CONNECTION+${ssh_prompt}}%(?,%F{136},%F{160})%~%f "
export RPROMPT='$(git_super_status)'
function zle-line-init {
zle reset-prompt
function zle-line-init zle-keymap-select {
export RPROMPT="${${KEYMAP/vicmd/$MODE_INDICATOR}/(main|viins)/$(git_super_sta
zle reset-prompt
zle -N zle-line-init
zle -N zle-keymap-select
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.