aperezdc / zsh-fzy

Use the fzy fuzzy-finder in Zsh
MIT License
55 stars 9 forks source link

zsh-fzy should take the current value from the command line #2

Closed hlascelles closed 6 years ago

hlascelles commented 6 years ago

Steps:

1) Type something 2) Press bindkey 3) Expect that the initial search should have happened with what was already typed

Code fix would make use of something along the lines of...

        if [[ -z $BUFFER ]]; then
            cmd="fzy"
        else
            cmd="fzy -q "$BUFFER"
        fi

If you agree, I'll create a PR?

aperezdc commented 6 years ago

@hlascelles: You are absolutely right. My muscle memory is used to type Ctrl+R to open the history selection, and then write the search terms, but indeed it would be much nicer to reuse the text that has been already typed. I have noticed that the Zsh script provided with fzf behaves this way as well. I'll be glad to merger a PR.

hlascelles commented 6 years ago

Great stuff.... Done: https://github.com/aperezdc/zsh-fzy/pull/5