feat: integrate with zsh-autosuggestions (#1479)

* feat: integrate with zsh-autosuggestions

* Update atuin/src/shell/atuin.zsh

Co-authored-by: Patrick Jackson <patrick@jackson.dev>

* Update atuin/src/shell/atuin.zsh

Co-authored-by: Patrick Jackson <patrick@jackson.dev>

* feedback

---------

Co-authored-by: Patrick Jackson <patrick@jackson.dev>
This commit is contained in:
Ellie Huxtable 2024-01-01 19:47:34 +00:00 committed by GitHub
parent e2a4e9cf13
commit 356324b341
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -9,6 +9,15 @@
# Source this in your ~/.zshrc
autoload -U add-zsh-hook
# If zsh-autosuggestions is installed, configure it to use Atuin's search. If
# you'd like to override this, then add your config after the $(atuin init zsh)
# in your .zshrc
_zsh_autosuggest_strategy_atuin() {
suggestion=$(atuin search --cmd-only --limit 1 --search-mode prefix "$1")
}
ZSH_AUTOSUGGEST_STRATEGY=("atuin" "${ZSH_AUTOSUGGEST_STRATEGY[@]}")
export ATUIN_SESSION=$(atuin uuid)
_atuin_preexec() {