v icon indicating copy to clipboard operation
v copied to clipboard

You can now use v with fzf

Open pkrumins opened this issue 5 years ago • 0 comments

I made v work with fzf. First, modify v not to display the choice dialog when using the -l flag, then use this shell function to call it:

v() {
    if [[ -z "$@" ]]; then
        local -r choice="$(command v -l 2>&1 | fzf +s --tac --height 15 --reverse | sed -r 's/^[0-9,. \t]*//')"
        if [[ ! -z "$choice" ]]; then
            local -r file="${choice/#~/$HOME}"
            vim "$file"
        fi
    else
        command v "$@"
    fi
}

pkrumins avatar Dec 28 '19 19:12 pkrumins