Skip to content

Instantly share code, notes, and snippets.

@bmaland
Created November 18, 2010 18:13
Show Gist options
  • Select an option

  • Save bmaland/705368 to your computer and use it in GitHub Desktop.

Select an option

Save bmaland/705368 to your computer and use it in GitHub Desktop.
# Prefix the previous line with "sudo " then execute it
rerun-with-sudo () {
LBUFFER="sudo !!"
zle accept-line
}
zle -N rerun-with-sudo
bindkey '\C-x\C-x' rerun-with-sudo
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment