summaryrefslogtreecommitdiff
path: root/plugins/bbedit
diff options
context:
space:
mode:
authorRobby Russell <robby@planetargon.com>2014-08-31 11:26:14 -0700
committerRobby Russell <robby@planetargon.com>2014-08-31 11:26:14 -0700
commitc22658e15d9d4934ddf411c0cb580f6dd3e901c8 (patch)
treeda990ea567d1fe55635960ca64e634e2b8778035 /plugins/bbedit
parentb88d68279e3974b0e5b177c9cd4b17f4ada89eba (diff)
parentd7f77f818d3f094f42e02554b3c697c0f3d26ed6 (diff)
downloadzsh-c22658e15d9d4934ddf411c0cb580f6dd3e901c8.tar.gz
zsh-c22658e15d9d4934ddf411c0cb580f6dd3e901c8.tar.bz2
zsh-c22658e15d9d4934ddf411c0cb580f6dd3e901c8.zip
Merge pull request #3059 from chrisfsmith/feature/bbedit
Adding BBEdit plugin (OS X only)
Diffstat (limited to 'plugins/bbedit')
-rw-r--r--plugins/bbedit/README.md20
-rw-r--r--plugins/bbedit/bbedit.plugin.zsh21
2 files changed, 41 insertions, 0 deletions
diff --git a/plugins/bbedit/README.md b/plugins/bbedit/README.md
new file mode 100644
index 000000000..ec2b743d6
--- /dev/null
+++ b/plugins/bbedit/README.md
@@ -0,0 +1,20 @@
+## bbedit
+
+Plugin for BBEdit, an HTML and text editor for Mac OS X
+
+### Requirements
+
+ * [BBEdit](http://www.barebones.com/products/bbedit/)
+ * [BBEdit Command-Line Tools](http://www.barebones.com/support/bbedit/cmd-line-tools.html)
+
+### Usage
+
+ * If the `bb` command is called without an argument, launch BBEdit
+
+ * If `bb` is passed a directory, cd to it and open it in BBEdit
+
+ * If `bb` is passed a file, open it in BBEdit
+
+ * If `bbpb` create a new BBEdit document with the contents of the clipboard
+
+ * If `bbd` alias for BBEdit diff tool
diff --git a/plugins/bbedit/bbedit.plugin.zsh b/plugins/bbedit/bbedit.plugin.zsh
new file mode 100644
index 000000000..fe9e72c65
--- /dev/null
+++ b/plugins/bbedit/bbedit.plugin.zsh
@@ -0,0 +1,21 @@
+alias bbpb='pbpaste | bbedit --clean --view-top'
+
+alias bbd=bbdiff
+
+#
+# If the bb command is called without an argument, launch BBEdit
+# If bb is passed a directory, cd to it and open it in BBEdit
+# If bb is passed a file, open it in BBEdit
+#
+function bb() {
+ if [[ -z "$1" ]]
+ then
+ bbedit --launch
+ else
+ bbedit "$1"
+ if [[ -d "$1" ]]
+ then
+ cd "$1"
+ fi
+ fi
+}