diff options
| author | Ellie Huxtable <e@elm.sh> | 2021-02-13 22:06:27 +0000 |
|---|---|---|
| committer | Ellie Huxtable <e@elm.sh> | 2021-02-13 22:06:27 +0000 |
| commit | d8aacb4a806c097fb316305dab8c481546d72b8b (patch) | |
| tree | e30757902c93c3ccd8f99d14fb6360545566ee6b /atuin.plugin.zsh | |
| parent | Update readme (diff) | |
| download | atuin-d8aacb4a806c097fb316305dab8c481546d72b8b.zip | |
Add fuzzy history search and distinct arg
Diffstat (limited to 'atuin.plugin.zsh')
| -rw-r--r-- | atuin.plugin.zsh | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/atuin.plugin.zsh b/atuin.plugin.zsh index d46346f2..e6d4ef25 100644 --- a/atuin.plugin.zsh +++ b/atuin.plugin.zsh @@ -1,5 +1,6 @@ # Source this in your ~/.zshrc export ATUIN_SESSION=$(atuin uuid) +export ATUIN_FUZZY=fzf _atuin_preexec(){ id=$(atuin history start $1) @@ -14,5 +15,14 @@ _atuin_precmd(){ atuin history end $ATUIN_HISTORY_ID --exit $EXIT } +_atuin_search(){ + $(atuin history list --distinct | $ATUIN_FUZZY) +} + add-zsh-hook preexec _atuin_preexec add-zsh-hook precmd _atuin_precmd + +zle -N _atuin_search_widget _atuin_search + +bindkey -r '^r' +bindkey '^r' _atuin_search_widget |
