←back to thread

131 points tosh | 1 comments | | HN request time: 0.2s | source
1. Despacito2019 ◴[] No.44364989[source]
I love atuin but i am not quite as fond of the UI (only because i am not used to it), so i have my own little function to use atuin with fzf instead:

    insert_atuin_with_fzf () {
        local result
        result=$(atuin history list --reverse --format "{command}" | \
                awk '!seen[$0]++ && length($0) > 2 && !/^j /' | \
            fzf +s)
        [[ -n $result ]] && LBUFFER+="$result"
    }
    
    # Bind the widget to Ctrl-Q
    zle -N insert_atuin_with_fzf
    bindkey -M emacs '^q' insert_atuin_with_fzf
    bindkey -M emacs '^x^q' atuin-search