Reputation: 2247
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?
Upvotes: 4
Views: 1009
Reputation: 15934
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
Upvotes: 5