ble.sh: fix newlines inserted at the top of the terminal

This commit is contained in:
teutat3s 2024-04-15 13:23:10 +02:00
parent 10a9f1c0b0
commit 298b480680
Signed by: teutat3s
GPG key ID: 4FA1D3FA524F22C1

View file

@ -74,7 +74,28 @@ in {
# Bash vim mode keybindings
if [[ $- == *i* ]]; then # in interactive session
set -o vi
fi
# Don't show a mode name in the normal mode
function ferdinandyb/set-up-mode-indicator {
# Define \q{ferdinandyb/mode-indicator}
function ble/prompt/backslash:ferdinandyb/mode-indicator {
if local mode; ble/keymap:vi/script/get-mode; [[ $mode != i ]]; then
# call the built-in mode indicator
ble/prompt/process-prompt-string '\q{keymap:vi/mode-indicator}'
fi
}
# Specify \q{ferdinandyb/mode-indicator} in the mode-indicator prompt
bleopt prompt_vi_mode_indicator='\q{ferdinandyb/mode-indicator}'
# In case you would like to show "-- NORMAL --" instead of "~"
bleopt keymap_vi_mode_string_nmap=$'\e[1m-- NORMAL --\e[m'
}
blehook/eval-after-load keymap_vi ferdinandyb/set-up-mode-indicator
function blerc/vim-mode-hook {
# Write your settings for vi/vim mode here
ble-bind -m vi_imap -f 'ENTER' 'vi_imap/complete'
ble-bind -m vi_imap -f 'TAB' 'vi_imap/complete'
@ -88,7 +109,9 @@ in {
ble-bind -m vi_nmap -f 'l' 'vi-command/forward-char'
ble-bind -m vi_imap -f 'C-c' discard-line
fi
}
blehook/eval-after-load keymap_vi blerc/vim-mode-hook
# end of .bashrc
# Somehow we need to ensure starship starts later than ble.sh