mirror of
https://github.com/atuinsh/atuin.git
synced 2024-11-28 19:23:47 +01:00
2ef5169357
The current widget names for Zsh start with "_", which gives an impression to users that those widgets are internal API and should not be bound by the users. However, we actually instruct users to set up custom keybindings by specifying them to bindkey. In other shells, a separate namespace for widgets are not prepared, so we want to prefix "_" to shell function names to tell the users that these are not the commands that are supposed to be called from the command line. However, the widget names are separated in their own namespace in Zsh, so we do not have to isolate them by prefixing "_". In fact, other frameworks such as `fzf` define widgets with names not starting with "_". In this patch, we update the widget names to have the form "atuin-*". The old widget names that existed in the release version <= 17.2.1 are left for compatibility.
1.1 KiB
1.1 KiB
Key binding
По умолчанию, Autin будет переназначать Ctrl-r и клавишу 'стрелка вверх'.
Если вы не хотите этого, установите параметр ATUIN_NOBIND прежде чем вызывать atuin init
Например,
export ATUIN_NOBIND="true"
eval "$(atuin init zsh)"
Таким образом вы можете разрешить переназначение клавиш Autin, если это необходимо. Делайте это до инициализирующего вызова.
zsh
Autin устанавливает виджет ZLE "atuin-search"
export ATUIN_NOBIND="true"
eval "$(atuin init zsh)"
bindkey '^r' atuin-search
# зависит от режима терминала
bindkey '^[[A' atuin-search
bindkey '^[OA' atuin-search
bash
export ATUIN_NOBIND="true"
eval "$(atuin init bash)"
# Переопределите ctrl-r, и любые другие сочетания горячих клавиш тут
bind -x '"\C-r": __atuin_history'