Files
dot/.local/share/blesh/contrib/prompt-vim-mode.bash

21 lines
521 B
Bash
Raw Normal View History

2026-02-14 12:43:31 -05:00
# ble/contrib/prompt-vim-mode.bash (C) 2020-2021, akinomyoga
# \q{contrib/vim-mode} (Prompt escape sequence)
#
# Example:
#
# ble-import contrib/prompt-vim-mode
# PS1='[\u@\h \W]\q{contrib/vim-mode}\$ '
# bleopt keymap_vi_mode_show:=
#
function ble/prompt/backslash:contrib/vim-mode {
local mode; ble/keymap:vi/script/get-mode
case $mode in
([iR]*) ble/prompt/print '(ins)' ;;
(*n) ble/prompt/print '(cmd)' ;;
(*x) ble/prompt/print '(vis)' ;;
(*s) ble/prompt/print '(sel)' ;;
esac
}