From a5616aea8fa28db6f8f7b1a44e28f90aab3363b7 Mon Sep 17 00:00:00 2001 From: Jamie Quigley Date: Sat, 24 Dec 2022 17:18:44 +0000 Subject: 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 Co-authored-by: Ellie Huxtable --- docs/key-binding.md | 23 ++++++++++++++++++++--- 1 file changed, 20 insertions(+), 3 deletions(-) (limited to 'docs') diff --git a/docs/key-binding.md b/docs/key-binding.md index 7a968030..013c28bc 100644 --- a/docs/key-binding.md +++ b/docs/key-binding.md @@ -1,11 +1,27 @@ # Key binding -By default, Atuin will rebind both Ctrl-r 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 Ctrl-r and the up arrow. -For example +You can also disable either the up-arrow or Ctrl-r 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 ``` -- cgit v1.3.1