Open cantino opened 4 years ago
Also might be able to improve bash bindings using something like https://stackoverflow.com/questions/57811962/bind-up-arrow-key-to-fzf-command
@cantino You might even be able to reuse zsh-autosuggestions itself. They added the ability to add “providers” to the suggestions (like inline suggestions for completions), and I think you can use that abstraction to easily add your history suggestions. (I have no further knowledge, I guess you can just open an issue and ask them.)
Does not look very complex: https://github.com/zsh-users/zsh-autosuggestions/blob/master/src/strategies/history.zsh#L31
Could mcfly search just output all suggestions as lines instead of opening a TUI when it detects a non-tty file on stdout?
The hacky work around is using this:
╭─[~/.homesick/repos/dotfiles/zsh/zsh-autosuggestions]─[tags/v0.6.4]
╰─ % mcfly search --output-selection /tmp/foo1 foo </dev/null
╭─[~/.homesick/repos/dotfiles/zsh/zsh-autosuggestions]─[tags/v0.6.4]
╰─ % cat /tmp/foo1
mode display
commandline foo
however it still tries to spawn a menu for a split-second.
@cantino do you mean like what this does? https://github.com/Aloxaf/fzf-tab
Not quite, Auto-suggestions show up without tabs.
This hacky line extracts suggestions:
$ suggestion=$(script -q -O /dev/null -c "mcfly search -o /proc/self/fd/3 test </dev/null" 3>&1 >/dev/null)
$ echo $suggestion
mode display
commandline test
$ filtered=$(echo $suggestion | grep -oP '(?<=commandline )\w+')
$ echo $filtered
test
What would it take to make a zsh-autosuggestions completion hook for McFly?