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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.