From 0a234b4e5deefdf04c5bbdbaea6e71e507bb1bb3 Mon Sep 17 00:00:00 2001 From: Phil Thomas Date: Tue, 2 Feb 2016 08:56:21 -0600 Subject: [PATCH] Add Atom plugin/alias based on Textmate plugin --- plugins/atom/atom.plugin.zsh | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 plugins/atom/atom.plugin.zsh diff --git a/plugins/atom/atom.plugin.zsh b/plugins/atom/atom.plugin.zsh new file mode 100644 index 000000000..404444aad --- /dev/null +++ b/plugins/atom/atom.plugin.zsh @@ -0,0 +1,13 @@ +# If the am command is called without an argument, open Atom in the current directory +# If am is passed a directory, cd to it and open it in Atom +# If am is passed a file, open it in Atom +function am() { + if [[ -z $1 ]]; then + atom . + else + atom $1 + if [[ -d $1 ]]; then + cd $1 + fi + fi +}