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

Section "using vi-mode in your shell" is incomplete #59

Open
emk2203 opened this issue Oct 7, 2024 · 0 comments
Open

Section "using vi-mode in your shell" is incomplete #59

emk2203 opened this issue Oct 7, 2024 · 0 comments

Comments

@emk2203
Copy link

emk2203 commented Oct 7, 2024

For the use of vi-mode, it's necessary to also add to your .inputrc:

set show-mode-in-prompt on
set vi-cmd-mode-string "\1\e[2 q\2"
set vi-ins-mode-string "\1\e[6 q\2"
set keymap vi-insert
"\C-L": clear-screen

Otherwise, you won't have any indication of what mode you are in, which makes it impractical to use vi-mode.

The last line is an example of how to carry over keybindings which you want to keep from the EMACS mode.

Besides set -o vi, the .bashrc file should also reset the different cursors:

# set vi mode for command line:
set -o vi

# reset cursor after manipulations, like for vi mode above
PS0="\e[2 q\2"

This gives a smooth and user-friendly vi-mode experience.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant