Skip to content

Instantly share code, notes, and snippets.

@jaseg
Created April 20, 2015 11:14
Show Gist options
  • Save jaseg/15ad5c9967586c1812b5 to your computer and use it in GitHub Desktop.
Save jaseg/15ad5c9967586c1812b5 to your computer and use it in GitHub Desktop.
fish: Remap CTRL+O to execute the current command as root
bind \co sudo-execute
function sudo-execute -d "Command line editor function that prepends the current commandline with \"sudo\" and executes it afterwards"
commandline sudo\ (commandline | sed 's/^\W*sudo\?\W*//')
commandline -f repaint
commandline -f execute
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment