Created
April 20, 2015 11:14
-
-
Save jaseg/15ad5c9967586c1812b5 to your computer and use it in GitHub Desktop.
fish: Remap CTRL+O to execute the current command as root
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
bind \co sudo-execute |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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