Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Fish shell: Shortcut for accept and run command suggestion

Tags:

shell

fish

is it possible to create a shortcut such as "Shift+Return" to accept and run the displayed suggestion?

The default key-bindings require pressing the arrow keys, which involve a movement away from the keys.

like image 568
Jan15 Avatar asked Dec 02 '22 10:12

Jan15


2 Answers

CTRL-f should complete the displayed suggestion, after which tapping Return will run it.

like image 63
Justin Mayer Avatar answered Dec 29 '22 06:12

Justin Mayer


Yes, to bind (example) control-y to accept and then execute:

bind \cy accept-autosuggestion execute
like image 24
ridiculous_fish Avatar answered Dec 29 '22 07:12

ridiculous_fish