Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Getting part of autocomplete

Tags:

fish

While I typing Fish shows me the autocomplete suggestions, there's any way to accept only part of it suggestion?

For example, I type:

$ git

So fish suggest to me:

$ git push origin master

But I'd like send a push to dev branch and not master. For do this, I accept it suggestion and type dev. There's any shortcut to accept part of suggestion?

$ git push origin

ALT + Right Arrow can accept the first word suggested, there's any shortcut for accept all until the last world?

like image 291
Daniela Morais Avatar asked Oct 14 '25 10:10

Daniela Morais


1 Answers

ALT + Right Arrow can accept the first word suggested, there's any shortcut for accept all until the last world?

No.

Fish's bindings accept the part of the suggestion they move the cursor over - e.g. "forward-word" would move over the next word if that was actually in the commandline, so it accepts the next word of the suggestion.

The exception is "forward-char" (bound to e.g. right-arrow and ctrl-f by default), which accepts the entire suggestion.

There currently is no binding to accept everything but the last word of the suggestion.

This can be simulated by binding "accept-autosuggestion" and "backward-kill-bigword" (or similar).

bind \cf accept-autosuggestion backward-kill-bigword
like image 181
faho Avatar answered Oct 18 '25 05:10

faho



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!