Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Vi replace mode #71

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions functions/fish_right_prompt.fish
Original file line number Diff line number Diff line change
Expand Up @@ -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
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The default value of color_vi_mode_replace is to be determined.

It is temporarily set to $color_vi_mode_insert as in https://github.com/oh-my-fish/theme-bobthefish/blob/954fbc961b779c29ad24749f9a09095d049fb752/functions/fish_mode_prompt.fish#L34

set -q color_vi_mode_visual; or set color_vi_mode_visual red


Expand All @@ -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


Expand Down Expand Up @@ -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"
Expand Down