summaryrefslogtreecommitdiff
path: root/plugins/bbedit/bbedit.plugin.zsh
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/bbedit.plugin.zsh
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/bbedit.plugin.zsh')
-rw-r--r--plugins/bbedit/bbedit.plugin.zsh21
1 files changed, 21 insertions, 0 deletions
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
+}