-
-
Notifications
You must be signed in to change notification settings - Fork 85
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
disable vi mode show only for insert mode #205
Comments
Thank you for the suggestion! This is not what you have suggested, but I think you might like the setting described in #85 (comment), where you can remove |
thanks, looks like something that would work for me! I'll check soon :) |
So I spent a little time trying out the example you linked. It seems to add a vim-airline like capability, and it's probably by poor bash skills, but I didn't manage to set it up in a way, that during insert mode it is not shown at all (commenting out the line with the print INSERT will actually just drop the case down to ?????) and setting this empty in case of insert mode still leaves the color bar at the bottom so one would have to catch insert mode one more level higher really. On the hand I'm mostly happy with the base set up, since I could just set Btw, thank you very being so very responsive! |
As I wrote in the first reply, you could actually remove
Maybe you can set the face to function ferdinandyb/set-up-status-line {
bleopt keymap_vi_mode_show=
bleopt keymap_vi_mode_update_prompt=1
function ble/prompt/backslash:ferdinandyb/currentmode {
local mode; ble/keymap:vi/script/get-mode
case $mode in
(*n) ble/prompt/print $'\e[1m-- NORMAL --\e[m' ;;
(*v) ble/prompt/print $'\e[1m-- VISUAL --\e[m' ;;
(*V) ble/prompt/print $'\e[1m-- V-LINE --\e[m' ;;
(*^V) ble/prompt/print $'\e[1m-- V-BLOQ --\e[m' ;;
(*s) ble/prompt/print $'\e[1m-- SELECT --\e[m' ;;
(*S) ble/prompt/print $'\e[1m-- S-LINE --\e[m' ;;
(*^S) ble/prompt/print $'\e[1m-- S-BLOQ --\e[m' ;;
(i) ;;
(R) ble/prompt/print $'\e[1m-- RPLACE --\e[m' ;;
(^R) ble/prompt/print $'\e[1m-- VPLACE --\e[m' ;;
(*) ble/prompt/print $'\e[1m-- ?????? --\e[m' ;;
esac
ble-face prompt_status_line=none
}
bleopt prompt_status_line='\q{ferdinandyb/currentmode}'
}
blehook/eval-after-load keymap_vi ferdinandyb/set-up-status-line
This doesn't work because
I don't think this can be used to turn off the mode indicator only for the insert mode. If we make it an empty string, it also makes the surrounding characters of other modes empty. Or, we might prepare the options of the surrounding characters for each mode, but again, I don't want to provide 30+30 prefix and suffix options to control the surrounding strings for each mode combination.
The normal mode is strictly not a mode but a special mode combination that no modes are activated. On the other hand, the insert mode is a mode that can be combined with other modes. And, as I have already written, I don't want to provide 30 options to control each mode combination separately.
I'm now thinking of adding another prompt shown in the position where the built-in mode indicator is currently shown. |
Thanks for the very detailed explanation! The snippet you provided actually does pretty much what I wanted so I'll go with it now, although if you do implement a prompt at the below-the-line position, I might revisit this topic. Thanks again! |
I have implemented # blerc
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 Could you try it and let me hear what you think? |
@ferdinandyb Have you already taken a look at this? Can I close the issue if you are satisfied with the current implementation? |
Sorry, I seemed to have missed this update, but it works as expected, thank you very much for fixing all the issues so fast! |
OK, thanks! |
I haven't been able to find such on option, but since in a terminal insert mode is really the default I only want to show any other modes, but not insert mode.
The text was updated successfully, but these errors were encountered: