diff options
| author | Carlo Sala <carlosalag@protonmail.com> | 2024-08-01 19:55:05 +0200 |
|---|---|---|
| committer | Carlo Sala <carlosalag@protonmail.com> | 2024-08-01 19:55:05 +0200 |
| commit | 2527959e79432bb28269840e5b8b81ef3acf187a (patch) | |
| tree | bd08f78969572ec925440b5582b0aab445e04a62 /plugins/vi-mode | |
| parent | bc337e9a9e45d35d58d11c7ac2429ffc19cfbdd6 (diff) | |
| download | zsh-2527959e79432bb28269840e5b8b81ef3acf187a.tar.gz zsh-2527959e79432bb28269840e5b8b81ef3acf187a.tar.bz2 zsh-2527959e79432bb28269840e5b8b81ef3acf187a.zip | |
fix(vi-mode): don't overwrite settings
Closes #11673
Diffstat (limited to 'plugins/vi-mode')
| -rw-r--r-- | plugins/vi-mode/vi-mode.plugin.zsh | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/plugins/vi-mode/vi-mode.plugin.zsh b/plugins/vi-mode/vi-mode.plugin.zsh index 5c104f7bb..85208cfc9 100644 --- a/plugins/vi-mode/vi-mode.plugin.zsh +++ b/plugins/vi-mode/vi-mode.plugin.zsh @@ -18,12 +18,12 @@ typeset -g VI_MODE_SET_CURSOR # if $VI_MODE_SET_CURSOR=true. # # See https://vt100.net/docs/vt510-rm/DECSCUSR for cursor styles -typeset -g VI_MODE_CURSOR_NORMAL=2 -typeset -g VI_MODE_CURSOR_VISUAL=6 -typeset -g VI_MODE_CURSOR_INSERT=6 -typeset -g VI_MODE_CURSOR_OPPEND=0 +typeset -g VI_MODE_CURSOR_NORMAL=${VI_MODE_CURSOR_NORMAL:=2} +typeset -g VI_MODE_CURSOR_VISUAL=${VI_MODE_CURSOR_VISUAL:=6} +typeset -g VI_MODE_CURSOR_INSERT=${VI_MODE_CURSOR_INSERT:=6} +typeset -g VI_MODE_CURSOR_OPPEND=${VI_MODE_CURSOR_OPPEND:=0} -typeset -g VI_KEYMAP=main +typeset -g VI_KEYMAP=${VI_KEYMAP:=main} function _vi-mode-set-cursor-shape-for-keymap() { [[ "$VI_MODE_SET_CURSOR" = true ]] || return @@ -162,9 +162,7 @@ if [[ -z "${VI_MODE_DISABLE_CLIPBOARD:-}" ]]; then fi # if mode indicator wasn't setup by theme, define default, we'll leave INSERT_MODE_INDICATOR empty by default -if [[ -z "$MODE_INDICATOR" ]]; then - MODE_INDICATOR='%B%F{red}<%b<<%f' -fi +typeset -g MODE_INDICATOR=${MODE_INDICATOR:='%B%F{red}<%b<<%f'} function vi_mode_prompt_info() { echo "${${VI_KEYMAP/vicmd/$MODE_INDICATOR}/(main|viins)/$INSERT_MODE_INDICATOR}" |
