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

Custom key bindings #193

Open
mightyiam opened this issue Oct 20, 2021 · 9 comments
Open

Custom key bindings #193

mightyiam opened this issue Oct 20, 2021 · 9 comments
Labels
enhancement New feature or request

Comments

@mightyiam
Copy link

I'm using this and liking it. Thank you!

Just for the record, I'd like to use different key bindings than the default arrows.

@dceddia
Copy link

dceddia commented Feb 15, 2022

I just found this and it seems awesome, but I wanted to customize the bindings too. I'm using zsh, and in the zsh setup the section that binds the keys is guarded by the ATUIN_NOBIND env var here.

For my case, I just wanted to disable the arrows but still use Ctrl-R, so I put this in my .zshrc and it did the trick!

ATUIN_NOBIND=1 eval "$(atuin init zsh)"
bindkey '^r' _atuin_search_widget

@ellie
Copy link
Member

ellie commented Jan 5, 2024

I'm using this issue as the main issue for all "custom key bindings", whether that is inside the search TUI or from the shell

ellie added a commit that referenced this issue Jan 5, 2024
This enabled the Kitty Keyboard Protocol

Read more here: https://sw.kovidgoyal.net/kitty/keyboard-protocol/

No change on unsupported terminals, but means in the future we can be
more creative with keybinding depending on terminal.

Tested on Alacritty and events come through with all modifiers
supported.

Will be useful for #193
ellie added a commit that referenced this issue Jan 5, 2024
This enabled the Kitty Keyboard Protocol

Read more here: https://sw.kovidgoyal.net/kitty/keyboard-protocol/

No change on unsupported terminals, but means in the future we can be
more creative with keybinding depending on terminal.

Tested on Alacritty and events come through with all modifiers
supported.

Will be useful for #193
ellie added a commit that referenced this issue Jan 5, 2024
This enabled the Kitty Keyboard Protocol

Read more here: https://sw.kovidgoyal.net/kitty/keyboard-protocol/

No change on unsupported terminals, but means in the future we can be
more creative with keybinding depending on terminal.

Tested on Alacritty and events come through with all modifiers
supported.

Will be useful for #193
ellie added a commit that referenced this issue Jan 5, 2024
This enabled the Kitty Keyboard Protocol

Read more here: https://sw.kovidgoyal.net/kitty/keyboard-protocol/

No change on unsupported terminals, but means in the future we can be
more creative with keybinding depending on terminal.

Tested on Alacritty and events come through with all modifiers
supported.

Will be useful for #193
@atuin-bot
Copy link

This issue has been mentioned on Atuin Community. There might be relevant details there:

https://forum.atuin.sh/t/configure-atuin-like-ctrl-r/80/2

@atuin-bot
Copy link

This issue has been mentioned on Atuin Community. There might be relevant details there:

https://forum.atuin.sh/t/command-inspector-design-layout/187/8

martinetd added a commit to martinetd/atuin that referenced this issue Feb 22, 2024
Looking for old commands through ctrl-r I might often accept the command
as is, but using the up key I'll almost always want to edit it.

When editing a command, I'll almost always want to move the cursor (home
or left key) or try to delete something (backspace); this patch is just
something to get a feeling of how that'd be and confirm that'd be useful
as a feature (could be an option, or wait for atuinsh#193)

However just custom key bindings isn't enough: when exiting through the
home key you'd want to go to the begining of the line.
This is easy enough to do the same way we're doing the enter_accept
code: just pass some position argument with the command back for shells
to parse (only implemented bash in this poc)

I'd be tempted to be greedy and also want to emulate stuff like
alt-left/^W etc but that'd require computing the exact position and passing
an exact position to handle in each shells instead of the beginning of
line token I've used here, so that'll wait for more feedback -- I'm
also still in a 'trying atuin out' phase so I might just drop this all
tomorrow for all I know...

so:
 - what do you think of having such a feature?
 - how do you want to go about differentiating this from editing the
   search query? honestly I don't think I'll ever edit the search query
   in up mode, but in ctrl-r mode I might miss the backspace key..
@elthariel
Copy link

elthariel commented Feb 27, 2024

In addition to switching the custom key bindings, I'd really like to edit the key binding of the UI. More specifially, I'd like to have the enter key behave like the tab key, all the time.
I mostly search command to edit previous long commands, so most of the time I don't want to run it before inspecting it

Edit: found the enter_accept setting. My comment is way less relevant :)

@atuin-bot
Copy link

This issue has been mentioned on Atuin Community. There might be relevant details there:

https://forum.atuin.sh/t/is-it-possible-to-add-keybinds/294/3

@atuin-bot
Copy link

This issue has been mentioned on Atuin Community. There might be relevant details there:

https://forum.atuin.sh/t/custom-keybindings/295/1

@nghduc97
Copy link

nghduc97 commented Jun 17, 2024

In addition to switching the custom key bindings, I'd really like to edit the key binding of the UI. More specifially, I'd like to have the enter key behave like the tab key, all the time. I mostly search command to edit previous long commands, so most of the time I don't want to run it before inspecting it

Edit: found the enter_accept setting. My comment is way less relevant :)

Thanks man, I almost thought there is no way to change this default behavior. Made a pull request to put it in a more visible place PR.

@ShalokShalom
Copy link

So this can be closed?

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

No branches or pull requests

8 participants