1
0
Fork 0
mirror of synced 2024-11-14 03:58:58 -05:00

Add vi mode info & move prompt to newline.

This commit is contained in:
Colin Jamison 2017-01-17 16:18:29 +01:00
parent 9f4c21cee8
commit d3424ca74a

View file

@ -109,7 +109,7 @@ prompt_git() {
# Dir: current working directory # Dir: current working directory
prompt_dir() { prompt_dir() {
prompt_segment cyan ${PRIMARY_FG} " $(short_pwd) " prompt_segment green ${PRIMARY_FG} " $(short_pwd) "
} }
# Status: # Status:
@ -140,7 +140,14 @@ prompt_eriner_main() {
prompt_eriner_precmd() { prompt_eriner_precmd() {
vcs_info vcs_info
PROMPT='%{%f%b%k%}$(prompt_eriner_main) ' print -rP '%{%f%b%k%}$(prompt_eriner_main)'
}
function zle-keymap-select zle-line-init {
local INSM=""
local NORM="%{%F{red}%}"
PROMPT="${${KEYMAP/vicmd/$NORM}/(main|viins)/$INSM} "
zle reset-prompt
} }
prompt_eriner_setup() { prompt_eriner_setup() {
@ -150,6 +157,8 @@ prompt_eriner_setup() {
prompt_opts=(cr subst percent) prompt_opts=(cr subst percent)
add-zsh-hook precmd prompt_eriner_precmd add-zsh-hook precmd prompt_eriner_precmd
zle -N zle-keymap-select
zle -N zle-line-init
zstyle ':vcs_info:*' enable git zstyle ':vcs_info:*' enable git
zstyle ':vcs_info:*' check-for-changes false zstyle ':vcs_info:*' check-for-changes false