aboutsummaryrefslogtreecommitdiffstats
path: root/docs/zh-CN/key-binding.md
diff options
context:
space:
mode:
Diffstat (limited to 'docs/zh-CN/key-binding.md')
-rw-r--r--docs/zh-CN/key-binding.md37
1 files changed, 37 insertions, 0 deletions
diff --git a/docs/zh-CN/key-binding.md b/docs/zh-CN/key-binding.md
new file mode 100644
index 00000000..ea93032b
--- /dev/null
+++ b/docs/zh-CN/key-binding.md
@@ -0,0 +1,37 @@
+# 键绑定
+
+默认情况下, Atuin 将会重新绑定 <kbd>Ctrl-r</kbd> 和 `up` 键。如果你不想使用默认绑定,请在调用 `atuin init` 之前设置 ATUIN_NOBIND
+
+例如:
+
+```
+export ATUIN_NOBIND="true"
+eval "$(atuin init zsh)"
+```
+
+如果需要,你可以在调用 `atuin init` 之后对 Atuin 重新进行键绑定
+
+# zsh
+
+Atuin 定义了 ZLE 部件 "\_atuin_search_widget"
+
+```
+export ATUIN_NOBIND="true"
+eval "$(atuin init zsh)"
+
+bindkey '^r' _atuin_search_widget
+
+# 取决于终端模式
+bindkey '^[[A' _atuin_search_widget
+bindkey '^[OA' _atuin_search_widget
+```
+
+# bash
+
+```
+export ATUIN_NOBIND="true"
+eval "$(atuin init bash)"
+
+# 绑定到 ctrl-r, 也可以在这里添加任何其他你想要的绑定方式
+bind -x '"\C-r": __atuin_history'
+```