Instead of using !! in bash, I am using a function to prepend sudo after a key combination.It seems the only way to use it is to bind the key every time a new shell is created. I have tried putting

bind \cs 'prepend_command sudo'

in ~/.config/fish/config.fish but to no avail. How can I bind the key at the start of every fish shell?

1 Answer 1


You want to put your bindings in fish_user_key_bindings. See this answer for some more detailed instructions.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .