Skip to content

zoxide+fzf: shorcut to search zoxide entries and paste result into terminal #1007

Answered by lmBored
SamuelBorn asked this question in Q&A
Discussion options

You must be logged in to vote

This is indeed right way to do it, I also have something similar but with a bit of UI tweaks:

function zoxide_fzf() {
    local orig_buffer=$LBUFFER
    local selection
    selection=$(zoxide query --list | fzf --height 40% --reverse --border) || {
        LBUFFER=$orig_buffer
        zle redisplay
        return 0
    }

    if [[ -n "$selection" ]]; then
        LBUFFER+="$selection"
        zle redisplay
    fi
}

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@lmBored
Comment options

Answer selected by SamuelBorn
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants