Bind to both emacs and vi-insert keymaps in Bash #434
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Thank you for reviewing all the PRs that I submitted so far!
This is the final PR. Unlike the previous ones, this is a suggestion for a change.
Problem: Bash has several keymaps depending on the current editing mode (i.e., the emacs editing mode or the vi editing mode). The default keymap for the vi editing mode is separate from the one for the emacs editing mode. Currently (in the
master
branch), the Bash keybindings are only set up in the current keymap. If the user changes the editing mode aftereval "$(mcfly init bash)"
, the keybindings become unavailable because the default keymap is switched.For example, with the following bashrc, the keybindings are inactive:
Solution: This PR registers the keybindings to both keymaps by explicitly specifying a keymap to register the keybindings.