3577fba6122e602e6a3fb0a5682dc4b8ef05e186

Author
Robby Russell <robby@planetargon.com>
Committer
Robby Russell <robby@planetargon.com>
Date

Message

Merge pull request #3058 from chrisfsmith/feature/textastic

Adding Textastic plugin (OS X only)

Diff

 1diff --git a/plugins/textastic/README.md b/plugins/textastic/README.md
 2new file mode 100644
 3index 0000000000000000000000000000000000000000..369c2c137d4435cd274ad2c02cb1c4228191f03f
 4--- /dev/null
 5+++ b/plugins/textastic/README.md
 6@@ -0,0 +1,15 @@
 7+## textastic
 8+
 9+Plugin for Textastic, a text and code editor for Mac OS X 
10+
11+### Requirements
12+
13+ * [Textastic](http://www.textasticapp.com/mac.html)
14+
15+### Usage
16+
17+ * If `tt` command is called without an argument, launch Textastic
18+
19+ * If `tt` is passed a directory, cd to it and open it in Textastic
20+
21+ * If `tt` is passed a file, open it in Textastic
22diff --git a/plugins/textastic/textastic.plugin.zsh b/plugins/textastic/textastic.plugin.zsh
23new file mode 100644
24index 0000000000000000000000000000000000000000..f5901eae2fcfcaa6fdb460b2a9e6c11c29f2f538
25--- /dev/null
26+++ b/plugins/textastic/textastic.plugin.zsh
27@@ -0,0 +1,17 @@
28+#
29+# If the tt command is called without an argument, launch Textastic
30+# If tt is passed a directory, cd to it and open it in Textastic
31+# If tt is passed a file, open it in Textastic
32+#
33+function tt() {
34+    if [[ -z "$1" ]]
35+    then
36+        open -a "textastic.app"
37+    else
38+        open -a "textastic.app" "$1"
39+        if [[ -d "$1" ]]
40+        then
41+            cd "$1"
42+        fi
43+    fi
44+}