mipsy icon indicating copy to clipboard operation
mipsy copied to clipboard

zsh-autosuggestions style autocomplete

Open joooooooooooooooooooooooooooooooooooosh opened this issue 3 years ago • 5 comments

Could we give C-f the same behaviour as the right arrow key? If the cursor is at the end of the line the right arrow key autocompletes the suggested command, otherwise it just moves the cursor forward. Currently C-f only moves the cursor forward, even if the end of the line has already been reached.

(this is probably handled inside the rustyline crate so idk how easily this can be done)

~~This should be configurable with something in here: https://www.gnu.org/software/bash/manual/html_node/Readline-Init-File-Syntax.html~~ And rustyline doesn't support reading a config file.

Dylan-Brotherston avatar Oct 28 '21 11:10 Dylan-Brotherston

Good thought, I'll look into it 🙂

insou22 avatar Oct 28 '21 14:10 insou22

Looking into it further, binding this would be a very simple change within the rustyline crate itself, but as of now the API support for conditional/overloaded keybindings is basically nonexistent. Not possible to neatly implement within mipsy unfortunately

Looks like this still doesn't work after the rustyline upgrade, is that as expected @joooooooooooooooooooooooooooooooooooosh ?

insou22 avatar Dec 31 '21 04:12 insou22

Yeah it still isn't implemented, upgrading rustyline was just a side effect of me trying to get it working in the first place. However this will make it easy to fix if my rustyline PR gets added or I decide to bother making use of ConditionalEventHandlers which are a newer rustyline feature.