mirror of
https://github.com/atuinsh/atuin.git
synced 2025-02-05 13:10:03 +01:00
feat: Add 'a', 'A', 'h', and 'l' bindings to vim-normal mode (#1697)
The current 'i' binding to switch to insert mode is entirely unintuitive since what I almost always want to do is append to the current query. The fact that the cursor extends past the current input (which vim doesn't do with default settings) adds to the problem. The 'a' key is what I would reach for, but 'A' makes a lot of sense too so I added that. The 'h' and 'l' bindings for moving the cursor also help makes things a bit more usable.
This commit is contained in:
parent
b4f8d1433b
commit
8805d04c4b
@ -264,6 +264,26 @@ impl State {
|
||||
KeyCode::Char('k') if !ctrl => {
|
||||
return self.handle_search_up(settings, true);
|
||||
}
|
||||
KeyCode::Char('h') if !ctrl => {
|
||||
self.search.input.left();
|
||||
return InputAction::Continue;
|
||||
}
|
||||
KeyCode::Char('l') if !ctrl => {
|
||||
self.search.input.right();
|
||||
return InputAction::Continue;
|
||||
}
|
||||
KeyCode::Char('a') if !ctrl => {
|
||||
self.search.input.right();
|
||||
self.set_keymap_cursor(settings, "vim_insert");
|
||||
self.keymap_mode = KeymapMode::VimInsert;
|
||||
return InputAction::Continue;
|
||||
}
|
||||
KeyCode::Char('A') if !ctrl => {
|
||||
self.search.input.end();
|
||||
self.set_keymap_cursor(settings, "vim_insert");
|
||||
self.keymap_mode = KeymapMode::VimInsert;
|
||||
return InputAction::Continue;
|
||||
}
|
||||
KeyCode::Char('i') if !ctrl => {
|
||||
self.set_keymap_cursor(settings, "vim_insert");
|
||||
self.keymap_mode = KeymapMode::VimInsert;
|
||||
|
Loading…
Reference in New Issue
Block a user