For when you forget sudo

This commit is contained in:
Andrew Tomaka 2013-05-28 23:32:51 -04:00
parent afad98a9dd
commit 631f77f852
2 changed files with 11 additions and 2 deletions

View file

@ -7,7 +7,12 @@ function g {
}
compdef g=git
function port-forward {
ssh $1 -R $2":localhost:"$2 -g;
insert-sudo() {
zle beginning-of-line
zle -U "sudo "
}
function port-forward {
ssh $1 -R $2":localhost:"$2 -g
}

4
.zshrc
View file

@ -72,6 +72,10 @@ PATH=$PATH:$HOME/bin
# Customize to your needs...
# Bind insert_sudo function
zle -N insert-sudo
bindkey "^z" insert-sudo
# make 256colors work maybe
if [ $TERM="xterm" ]; then
export TERM=xterm-256color