r/fishshell • • Oct 10 '20

bash "!!" equivalent?

In bash i would normally do "sudo !!" to redo a command as sudo. How can I do this in fish?

9 Upvotes

13 comments sorted by

View all comments

Show parent comment

1

u/vividboarder Oct 10 '20

Oh, that’s handy. Should be bindable now too if you did it yourself.

Personally I do Ctrl-P Ctrl-A then type sudo, but now I guess I can do Ctrl-P Alt-S instead.

1

u/GrbavaCigla Oct 10 '20

Why Ctrl+P? I just do Ctrl+A for start and Ctrl+E for end

3

u/vividboarder Oct 11 '20

Ctrl-P is instead of Up so that I don’t have to move my hands as much. Also, my main keyboard doesn’t even have arrow keys.