mirror of
https://github.com/atuinsh/atuin.git
synced 2025-08-16 18:11:55 +02:00
Rework atuin init
(#652)
* Rework `atuin init` This allows users to disable the CTRL-R and Up Arrow bindings, independently from one another * Document --disable-{ctrl-r,up-arrow} * Apply suggestions from code review Co-authored-by: Ellie Huxtable <ellie@elliehuxtable.com> Co-authored-by: Ellie Huxtable <ellie@elliehuxtable.com>
This commit is contained in:
@ -1,11 +1,27 @@
|
||||
# Key binding
|
||||
|
||||
By default, Atuin will rebind both <kbd>Ctrl-r</kbd> and the up arrow. If you do not want
|
||||
this to happen, set ATUIN_NOBIND before the call to `atuin init`
|
||||
By default, Atuin will rebind both <kbd>Ctrl-r</kbd> and the up arrow.
|
||||
|
||||
For example
|
||||
You can also disable either the up-arrow or <kbd>Ctrl-r</kbd> bindings individually, by passing
|
||||
`--disable-up-arrow` or `-disable-ctrl-r` to the call to `atuin init`:
|
||||
|
||||
```
|
||||
# Bind ctrl-r but not up arrow
|
||||
eval "$(atuin init zsh --disable-up-arrow)"
|
||||
|
||||
# Bind up-arrow but not ctrl-r
|
||||
eval "$(atuin init zsh --disable-ctrl-r)"
|
||||
```
|
||||
|
||||
If you do not want either key to be bound, either pass both `--disable` arguments, or set the
|
||||
environment varuable `ATUIN_NOBIND` to any value before the call to `atuin init`:
|
||||
|
||||
```
|
||||
## Do not bind any keys
|
||||
# Either:
|
||||
eval "$(atuin init zsh --disable-up-arrow --disable-ctrl-r)"
|
||||
|
||||
# Or:
|
||||
export ATUIN_NOBIND="true"
|
||||
eval "$(atuin init zsh)"
|
||||
```
|
||||
@ -36,6 +52,7 @@ eval "$(atuin init bash)"
|
||||
# bind to ctrl-r, add any other bindings you want here too
|
||||
bind -x '"\C-r": __atuin_history'
|
||||
```
|
||||
|
||||
# fish
|
||||
|
||||
```
|
||||
|
Reference in New Issue
Block a user