Created
March 5, 2012 12:51
-
-
Save webmat/1978201 to your computer and use it in GitHub Desktop.
"e" shortcut for vim lovers
This file contains hidden or 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
export EDITOR=vim | |
function e { | |
if [ -z $1 ] ; then # nothing specified | |
$EDITOR . | |
elif [ -d $1 ] ; then # directory specified | |
cd $1 ; $EDITOR . ; cd - | |
else # file specified | |
$EDITOR $1 | |
fi | |
} | |
alias ':e'='e' |
Haha! And why not another favorite :-)
alias ':x'='exit'
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Brilliant! Also:
😃