From 0bf59a383555682bbce4ea417010ea63fc976ba1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=B1=AA=E5=BF=83=E7=A6=BE?= Date: Wed, 15 May 2024 00:08:56 +0800 Subject: [PATCH] Vi replace mode --- functions/fish_right_prompt.fish | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/functions/fish_right_prompt.fish b/functions/fish_right_prompt.fish index 54ae5b4..f5441f3 100644 --- a/functions/fish_right_prompt.fish +++ b/functions/fish_right_prompt.fish @@ -11,6 +11,7 @@ set -q color_vi_mode_indicator; or set color_vi_mode_indicator black set -q color_vi_mode_normal; or set color_vi_mode_normal green set -q color_vi_mode_insert; or set color_vi_mode_insert blue +set -q color_vi_mode_replace; or set color_vi_mode_replace $color_vi_mode_insert set -q color_vi_mode_visual; or set color_vi_mode_visual red @@ -22,6 +23,7 @@ set -q color_vi_mode_visual; or set color_vi_mode_visual red # =========================== set -q cursor_vi_mode_normal; or set cursor_vi_mode_normal box_steady set -q cursor_vi_mode_insert; or set cursor_vi_mode_insert bar_steady +set -q cursor_vi_mode_replace; or set cursor_vi_mode_replace underline_steady set -q cursor_vi_mode_visual; or set cursor_vi_mode_visual box_steady @@ -63,6 +65,13 @@ function prompt_vi_mode -d 'vi mode status indicator' echo "$right_segment_separator" set_color -b $color_vi_mode_insert $color_vi_mode_indicator echo " I " + case replace replace_one + set -l mode (fish_cursor_name_to_code $cursor_vi_mode_replace) + echo -e "\e[\x3$mode q" + set_color $color_vi_mode_replace + echo "$right_segment_separator" + set_color -b $color_vi_mode_replace $color_vi_mode_indicator + echo " R " case visual set -l mode (fish_cursor_name_to_code $cursor_vi_mode_visual) echo -e "\e[\x3$mode q"