fish-shell/share/functions/__fish_prepend_sudo.fish
2019-10-06 15:17:49 +02:00

8 lines
263 B
Fish

function __fish_prepend_sudo -d "Prepend 'sudo ' to the beginning of the current commandline"
set -l cmd (commandline -boc)
if test "$cmd[1]" != "sudo"
commandline -C 0
commandline -i "sudo "
commandline -f end-of-line
end
end