-
-
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
Change or hide mode names #57
Comments
Thank you for the suggestion!
Configuration of mode namesI think I can support it, but I need to consider how to provide a way to configure it because these mode names are not fixed strings but dynamically generated depending on the current detailed status (just like in vim). Possible values include
I don't think it is useful to prepare 30 options to configure each. I would like to somehow organize the settings. Can I ask you about what kind of configuration you would like to make for the mode names. For example:
Mode names in prompt
Maybe I could add a special escape sequence for prompts |
Yes it would seem ugly to set options for every case. Personally I would like to change words (including enclosing string) to some sensible icon not to clutter my prompt. I think enclosing strings should be included in the names themselves not to have too many options. |
Thank you for your reply! OK, it seems like you would like to have a mode indicator in the prompt. I think "the mode line" and "the mode string in prompt" can be configured separately. In the commit 76be6f1 , I added options for the mode line and the prompt. I also added a support for Readline settings of
For example, you can write the following setting in # blerc
# Define prompt sequence \q{my/vim-mode}
function ble/prompt/backslash:my/vim-mode {
bleopt keymap_vi_mode_update_prompt:=1
case $_ble_decode_keymap in
(vi_[on]map) ble/prompt/print '(cmd)' ;;
(vi_imap) ble/prompt/print '(ins)' ;;
(vi_smap) ble/prompt/print '(sel)' ;;
(vi_xmap) ble/prompt/print '(vis)' ;;
esac
}
# Specify \q{my/vim-mode} in PS1
PS1='blahblah\q{my/vim-mode}\$ '
# Do not show mode line
bleopt keymap_vi_mode_show:= I also added a sample configuration at # blerc
ble-import contrib/prompt-vim-mode
PS1='....\q{contrib/vim-mode}\$ '
bleopt keymap_vi_mode_show:= Can you test the behavior? Any additional suggestions are welcome. |
I have tested it out thoroughly. It works perfect. Except that on startup there is an error related to ps: I am atomized by and thankful for your very fast response. |
Thank you for your testing!
It seems I cannot reproduce the error.
|
Yes. But, I was using the packaged version (
I am using
I do have prompt setting using |
Sorry for the confusion. I got bad configs in It might be off-topic but Is there a way to make PS1 transient and replace it with other prompt? Like in zsh's p10k plugin? I would look it up myself but I don't know where to start. Maybe some directions? |
Maybe you could have exploited 06381c9 Instead of hacking Also some option names have been changed:
For the detailed description, please follow the above links. Here I explain a simple usage: When you want to have a similar effect with p10k # blerc
# Similar to POWERLEVEL9K_TRANSIENT_PROMPT=always
bleopt prompt_ps1_transient=always:trim For # blerc
# Similar to POWERLEVEL9K_TRANSIENT_PROMPT=same-dir
bleopt prompt_ps1_transient=same-dir:trim For more flexible configuration, you can use # blerc
PS1='\e[33m\n--:--:-- \w\n\$ '
bleopt prompt_ps1_final='\e[33m\n\t \w\n\$ ' Note: as I'm not familiar with p10k, I have referenced the following links. I have just taken a look at the articles and haven't tried p10k in my machine, so it is possible that the behavior would be different from the intended one. If you notice some differences, please feel free to let me know that. |
Perfect! Clear and Works as intended. Thanks. |
Thank you! |
As far as I seen in the wiki, There is only an option to change normal mode name (
keymap_vi_nmap_name
). I think it would be nice to be able to change insert mode name and others. Also it is great to be able to set the position of mode indicator for example at the right end of the prompt.The text was updated successfully, but these errors were encountered: