From 5337033ee484f1282539a1e45e13ae89066ae0d8 Mon Sep 17 00:00:00 2001 From: Cameron Moon Date: Tue, 8 Aug 2017 12:19:10 +1000 Subject: [PATCH 1/4] Add option to force show vi mode --- fish_prompt.fish | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/fish_prompt.fish b/fish_prompt.fish index 1373133..b0e4896 100644 --- a/fish_prompt.fish +++ b/fish_prompt.fish @@ -585,7 +585,9 @@ end function __bobthefish_prompt_vi -S -d 'Display vi mode' [ "$theme_display_vi" != 'no' ]; or return - [ "$fish_key_bindings" = 'fish_hybrid_key_bindings' -o "$fish_key_bindings" = 'fish_vi_key_bindings' ]; or return + [ "$fish_key_bindings" = 'fish_vi_key_bindings' \ + -o "$fish_key_bindings" = 'fish_hybrid_key_bindings' \ + -o "$theme_display_vi" = 'force' ]; or return switch $fish_bind_mode case default __bobthefish_start_segment $__color_vi_mode_default From d204ecdb5b974dafcf55da5974f809e70d9b44a1 Mon Sep 17 00:00:00 2001 From: Cameron Moon Date: Tue, 8 Aug 2017 12:20:14 +1000 Subject: [PATCH 2/4] Enable vi mode display for hybrid_bindings Vi mode display should be enabled for people using the hybrid_bindings function found in the fish documentation. --- fish_prompt.fish | 1 + 1 file changed, 1 insertion(+) diff --git a/fish_prompt.fish b/fish_prompt.fish index b0e4896..c574679 100644 --- a/fish_prompt.fish +++ b/fish_prompt.fish @@ -586,6 +586,7 @@ end function __bobthefish_prompt_vi -S -d 'Display vi mode' [ "$theme_display_vi" != 'no' ]; or return [ "$fish_key_bindings" = 'fish_vi_key_bindings' \ + -o "$fish_key_bindings" = 'hybrid_bindings' \ -o "$fish_key_bindings" = 'fish_hybrid_key_bindings' \ -o "$theme_display_vi" = 'force' ]; or return switch $fish_bind_mode From 22114be8164b93000343e125628d3092fd6a0502 Mon Sep 17 00:00:00 2001 From: Cameron Moon Date: Tue, 8 Aug 2017 12:43:10 +1000 Subject: [PATCH 3/4] Add docs for theme_display_vi --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index d8518f5..2505476 100644 --- a/README.md +++ b/README.md @@ -107,6 +107,7 @@ set -g theme_newline_cursor yes - `theme_display_ruby`. Use `no` to completely hide all information about Ruby version. By default Ruby version displayed if there is the difference from default settings. - `theme_display_vagrant`. This feature is disabled by default, use `yes` to display Vagrant status in your prompt. Please note that only the VirtualBox and VMWare providers are supported. +- `theme_display_vi`. By default the vi mode indicator will be shown if vi or hybrid key bindings are enabled. Use `no` to hide the indicator, or `force` to show the indicator. - `theme_show_exit_status`. Set this option to yes to have the prompt show the last exit code if it was non_zero instead of just the exclamation mark. - `theme_git_worktree_support`. If you do any git worktree shenanigans, setting this to `yes` will fix incorrect project-relative path display. If you don't do any git worktree shenanigans, leave it disabled. It's faster this way :) - `fish_prompt_pwd_dir_length`. bobthefish respects the Fish `$fish_prompt_pwd_dir_length` setting to abbreviate the prompt path. Set to `0` to show the full path, `1` (default) to show only the first character of each parent directory name, or any other number to show up to that many characters. From ee8e150424893ac371480b6e2a4c08a691456379 Mon Sep 17 00:00:00 2001 From: Cameron Moon Date: Tue, 8 Aug 2017 12:46:23 +1000 Subject: [PATCH 4/4] rename flag from 'force' to 'yes' --- README.md | 2 +- fish_prompt.fish | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 2505476..a28e0cd 100644 --- a/README.md +++ b/README.md @@ -107,7 +107,7 @@ set -g theme_newline_cursor yes - `theme_display_ruby`. Use `no` to completely hide all information about Ruby version. By default Ruby version displayed if there is the difference from default settings. - `theme_display_vagrant`. This feature is disabled by default, use `yes` to display Vagrant status in your prompt. Please note that only the VirtualBox and VMWare providers are supported. -- `theme_display_vi`. By default the vi mode indicator will be shown if vi or hybrid key bindings are enabled. Use `no` to hide the indicator, or `force` to show the indicator. +- `theme_display_vi`. By default the vi mode indicator will be shown if vi or hybrid key bindings are enabled. Use `no` to hide the indicator, or `yes` to show the indicator. - `theme_show_exit_status`. Set this option to yes to have the prompt show the last exit code if it was non_zero instead of just the exclamation mark. - `theme_git_worktree_support`. If you do any git worktree shenanigans, setting this to `yes` will fix incorrect project-relative path display. If you don't do any git worktree shenanigans, leave it disabled. It's faster this way :) - `fish_prompt_pwd_dir_length`. bobthefish respects the Fish `$fish_prompt_pwd_dir_length` setting to abbreviate the prompt path. Set to `0` to show the full path, `1` (default) to show only the first character of each parent directory name, or any other number to show up to that many characters. diff --git a/fish_prompt.fish b/fish_prompt.fish index c574679..2bc077f 100644 --- a/fish_prompt.fish +++ b/fish_prompt.fish @@ -588,7 +588,7 @@ function __bobthefish_prompt_vi -S -d 'Display vi mode' [ "$fish_key_bindings" = 'fish_vi_key_bindings' \ -o "$fish_key_bindings" = 'hybrid_bindings' \ -o "$fish_key_bindings" = 'fish_hybrid_key_bindings' \ - -o "$theme_display_vi" = 'force' ]; or return + -o "$theme_display_vi" = 'yes' ]; or return switch $fish_bind_mode case default __bobthefish_start_segment $__color_vi_mode_default