Update key-binding.md (#1291)

added some info about FISH and how to bind the CTRL-up keyset.
This commit is contained in:
Evan McBeth 2023-10-10 00:37:14 +11:00 committed by GitHub
parent 089cb6847c
commit 14bef9c4a4
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -83,6 +83,7 @@ bind -x '"\C-r": __atuin_history'
``` ```
## fish ## fish
Edit key bindings in FISH shell by adding the following to ~/.config/fish/config.fish
``` ```
set -gx ATUIN_NOBIND "true" set -gx ATUIN_NOBIND "true"
@ -93,6 +94,15 @@ bind \cr _atuin_search
bind -M insert \cr _atuin_search bind -M insert \cr _atuin_search
``` ```
Adding the useful alternative key binding of <kbd>CTRL-up</kbd> is tricky and determined by the terminals adherence to terminfo(5).
Conveniently FISH uses a command to capture keystrokes and advises you of the exact command to add for your specific terminal.
In your terminal, run `fish_key_reader` then punch the desired keystroke/s.
For example, in Gnome Terminal the output to <kbd>CTRL-upkey</kbd> is `bind \e\[1\;5A 'do something'`
So, adding this to the above sample, `bind \e\[1\;5A _atuin_search` will provide the additional search keybinding.
## nu ## nu
``` ```