Skip to content

Instantly share code, notes, and snippets.

@webmat
Created March 5, 2012 12:51
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save webmat/1978201 to your computer and use it in GitHub Desktop.
Save webmat/1978201 to your computer and use it in GitHub Desktop.
"e" shortcut for vim lovers
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'
@remi
Copy link

remi commented Mar 5, 2012

Brilliant! Also:

alias ':q'='exit'
alias ':wq'='exit'

😃

@webmat
Copy link
Author

webmat commented Mar 5, 2012

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