summaryrefslogtreecommitdiff
path: root/plugins/atom
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/atom')
-rw-r--r--plugins/atom/README.md17
-rw-r--r--plugins/atom/atom.plugin.zsh14
2 files changed, 31 insertions, 0 deletions
diff --git a/plugins/atom/README.md b/plugins/atom/README.md
new file mode 100644
index 000000000..75d77a0ac
--- /dev/null
+++ b/plugins/atom/README.md
@@ -0,0 +1,17 @@
+## atom
+
+Plugin for Atom, a cross platform text and code editor, available for Linux, Mac OS X, and Windows.
+
+### Requirements
+
+ * [Atom](https://atom.io/)
+
+### Usage
+
+ * If `at` command is called without an argument, launch Atom
+
+ * If `at` is passed a directory, `cd` to it and open it in Atom
+
+ * If `at` is passed a file, open it in Atom
+
+ * if `att` command is called, it is equivalent to `at .`, opening the current folder in Atom
diff --git a/plugins/atom/atom.plugin.zsh b/plugins/atom/atom.plugin.zsh
new file mode 100644
index 000000000..9adb9031a
--- /dev/null
+++ b/plugins/atom/atom.plugin.zsh
@@ -0,0 +1,14 @@
+local _atom_paths > /dev/null 2>&1
+_atom_paths=(
+ "$HOME/Applications/Atom.app"
+ "/Applications/Atom.app"
+)
+
+for _atom_path in $_atom_paths; do
+ if [[ -a $_atom_path ]]; then
+ alias at="open -a '$_atom_path'"
+ break
+ fi
+done
+
+alias att='at .'