bew / dotfiles

All my dotfiles in one place!

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

~As-you-type completion in shell (but not everywhere?)

bew opened this issue · comments

Existing plugin: https://github.com/marlonrichert/zsh-autocomplete
(note: nice plugin organization!)

BUT NOTE that it seems to come with its own completion engine, and its key bindings, and its own completion config (may be interesting to take some things!)...
I'd like to have like vim: C-n/p and M-hjkl, allow the use of TAB to enter the interactive completion system (the builtin from zsh).

To me, the ideal plugin should do only auto complete thing, not override everything, do its own config, come with its own widgets, ....


And "not everywhere", because some completion functions are expansive, I wouldn't want to have them auto-triggered when I don't need them (e.g: nix run pkgs#<TAB>)

Since 325f1eb I enabled the interactive mode of the menu completion system of zsh, and I can refine the listed completions as-I-type once I triggered the completion menu.

(it was builtin, crazy right??)

Though it's a bit buggy, like:

# FIXME: completion inside text (with remaining input after cursor) is BROKEN,
# it eats chars from the right..
# mpv-audio-loop tra| --shuffle
# ('|' is cursor, start menu completion (with interactive mode) then accept entry 'trance/')
# gives:
# mpv-audio-loop trance/|huffle
# (=> the entry is inserted, but chars after cursor are overwritten..)
#
# TOCHECK: does it work with a completely stripped down zsh config? (looks like not, read on..)
# -> I checked in an old shell (does not have my new completion cfg), and entering interactive mode
# then exit out of interactive mode to the normal menu mode is ALSO broken.. (eats right chars)
# (don't even need to accept the match)
# => This seems to be a bug in zsh with the interactive menu mode :/
# TODO (bug report): see above (about broken interactive mode when accepting match, when completion initiated in the middle of the BUFFER)

And a few others (look for bug report & feature req in that file)