atuin
atuin copied to clipboard
Support vi-style up-down navigation with `j` and `k`
I love it, I just wish I could navigate up and down the list with j
and k
.
How would this work? -I have no clue
Okay, I lie. To feel authentic vi-style, it would probably need an "insert" mode to show the search bar and a "visual" mode to hide the bar and allow navigating with alternate up-down keys.
--
going further, a visual mode could allow paging up and down through queries.
Yes, this would be great !
Ctrl-j/k does work. But as you pointed out we don't have an insert/normal mode distinction
Also, when using the vi-mode in zsh, pressing k in normal mode does not invoke atuin. In insert mode, pressing the up arrow works fine.
- Ctrl-h/j/k/l are already bound to vi equivalent navigation commands, so this issue probably should be closed unless Atuin wants to consider having a vi-mode? Having a vi-mode seems like a lot of work, since we'd have to maintain a separate vi-compatability layer, and it would have to be behind a flag since you don't want a non-vi user to accidentally get stuck in it via hitting
escape
. - Ctrl-j is broken for me somehow, it's interpreted the same as
enter
, even though Ctrl-n (which atuin maps to the same thing) works fine for me. I've made a note to track that down since it's probably something weird in my config.
when using the vi-mode in zsh, pressing k in normal mode does not invoke atuin
- This is an unrelated issue, and is because the zsh init script doesn't set the keybindings for all of the modes. That probably needs to be touched by somebody more familiar with zsh than me. I think you can get it to work with
bindkey -M vicmd 'k' _atuin_search_widget
- Ctrl-h/j/k/l are already bound to vi equivalent navigation commands, so this issue probably should be closed unless Atuin wants to consider having a vi-mode? Having a vi-mode seems like a lot of work, since we'd have to maintain a separate vi-compatability layer, and it would have to be behind a flag since you don't want a non-vi user to accidentally get stuck in it via hitting
escape
.
I agree. A vi-mode might not really be in the scope of this project.
2. Ctrl-j is broken for me somehow, it's interpreted the same as `enter`, even though Ctrl-n (which atuin maps to the same thing) works fine for me. I've made a note to track that down since it's probably something weird in my config.
I have the exact same problem.
3. This is an unrelated issue, and is because the zsh init script doesn't set the keybindings for all of the modes. That probably needs to be touched by somebody more familiar with zsh than me. I _think_ you can get it to work with `bindkey -M vicmd 'k' _atuin_search_widget`
Ok, thank you for the suggestion
On CTRL+j
shortcut, it's by default a newline character, and is interpreted that way by something before atuin gets the input. Either the terminal or maybe X (I am on linux).
Same Ctrl-j
issue. I have tried unbinding this in:
- Zsh:
bindkey -r "^J"
- Bash:
bind -r "\C-j"
The binding stops working in these shells, but strangely enough works in dash
. I couldn't find any builtin commands for manipulating keybindings in this shell. Took a dive into keycodes and decided Ctrl-n
is good enough for now.
I'd also love to see an easy exit shortcut! My muscle memory is trained on Ctrl-c
but only Esc
works in Atuin
Would also love to see a VIM mode, currently using zsh in Vi mode. So... Entering normal mode for navigation comes naturally. Using K
to go upwards in history launches atuin and I start typing kkk
instead of navigating suggestions upwards. I'd prefer just entering in normal mode. Anyone got a workflow for this?