on master help sign in
Add `C-j` and `C-k` to keybinds for picker (#876)

* Add `C-j` and `C-k` for moving down/up in pickers * Add new binds to keymap doc

commit67829976faca1c2fdeb3964c25cb35bc41f0b8df authorVuiMuich <jm.spam@gmx.net> dateTue 19 Oct 2021, 11:37 (5 years ago) parent1766bdb
2 files changed+17−9
book/src/keymap.md+9−9 helix-term/src/ui/picker.rs+8
book/src/keymap.md+9−9
@@ -242,12 +242,12 @@ commands (including goto) to extend the existing selection instead of replacing
242242
243243Keys to use within picker. Remapping currently not supported.
244244
245−| Key | Description |
246−| ----- | ------------- |
247−| `Up`, `Ctrl-p` | Previous entry |
248−| `Down`, `Ctrl-n` | Next entry |
249−| `Ctrl-space` | Filter options |
250−| `Enter` | Open selected |
251−| `Ctrl-h` | Open horizontally |
252−| `Ctrl-v` | Open vertically |
253−| `Escape`, `Ctrl-c` | Close picker |
245+| Key | Description |
246+| ----- | ------------- |
247+| `Up`, `Ctrl-k`, `Ctrl-p` | Previous entry |
248+| `Down`, `Ctrl-j`, `Ctrl-n` | Next entry |
249+| `Ctrl-space` | Filter options |
250+| `Enter` | Open selected |
251+| `Ctrl-h` | Open horizontally |
252+| `Ctrl-v` | Open vertically |
253+| `Escape`, `Ctrl-c` | Close picker |
helix-term/src/ui/picker.rs+8
@@ -336,6 +336,10 @@ impl<T: 'static> Component for Picker<T> {
336336 code: KeyCode::BackTab,
337337 ..
338338 }
339+ | KeyEvent {
340+ code: KeyCode::Char('k'),
341+ modifiers: KeyModifiers::CONTROL,
342+ }
339343 | KeyEvent {
340344 code: KeyCode::Char('p'),
341345 modifiers: KeyModifiers::CONTROL,
@@ -349,6 +353,10 @@ impl<T: 'static> Component for Picker<T> {
349353 | KeyEvent {
350354 code: KeyCode::Tab, ..
351355 }
356+ | KeyEvent {
357+ code: KeyCode::Char('j'),
358+ modifiers: KeyModifiers::CONTROL,
359+ }
352360 | KeyEvent {
353361 code: KeyCode::Char('n'),
354362 modifiers: KeyModifiers::CONTROL,