Add vi mode info & move prompt to newline.
This commit is contained in:
parent
9f4c21cee8
commit
d3424ca74a
1 changed files with 13 additions and 4 deletions
|
@ -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
|
||||||
|
|
Loading…
Reference in a new issue