diff options
| author | Ellie Huxtable <ellie@elliehuxtable.com> | 2024-01-01 19:47:34 +0000 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-01-01 19:47:34 +0000 |
| commit | 356324b341f80290a2e04f87713bcee3b679da50 (patch) | |
| tree | d3b8d8b714fb27eff890be693d97c3507ec36dc1 | |
| parent | fix(stats): time now_local not working (diff) | |
| download | atuin-356324b341f80290a2e04f87713bcee3b679da50.zip | |
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>
| -rw-r--r-- | atuin/src/shell/atuin.zsh | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/atuin/src/shell/atuin.zsh b/atuin/src/shell/atuin.zsh index afff2d33..7091382a 100644 --- a/atuin/src/shell/atuin.zsh +++ b/atuin/src/shell/atuin.zsh @@ -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() { |
