Skip to content

Instantly share code, notes, and snippets.

@mikebranski
Created March 27, 2015 21:29
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 mikebranski/13147199e83cec158d32 to your computer and use it in GitHub Desktop.
Save mikebranski/13147199e83cec158d32 to your computer and use it in GitHub Desktop.
oh-my-zsh editor plugin
# Quick shortcut to the specified editor ($EDITOR).
# Adapted from @holman's .dotfiles.
#
# To install:
# Copy script to $ZSH/custom/plugins/editor/editor.plugin.zsh
# Add `editor` to the list of plugins included by oh-my-zsh
#
# If you're not using oh-my-zsh, you can just drop this in your shell profile
# (e.g. ~/.zshrc, ~/.bash_profile, etc)
#
# USAGE:
#
# $ e
# # => opens the current directory in your editor
#
# $ e .
# $ e /usr/local
# # => opens the specified directory in your editor
function e() {
if [ "$1" = "" ] ; then
"$EDITOR" .
else
"$EDITOR" "$1"
fi
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment