From 6d6b60dee7d05699b809201f39f34266841275c3 Mon Sep 17 00:00:00 2001 From: Micheil Smith Date: Fri, 20 Jun 2014 10:40:24 +0100 Subject: [PATCH] Add mtab command to osx integration ``` mtab count [path] ``` It's exactly like `tab`, excepting it runs for `count`, so you can quickly open several of the same tab. --- plugins/osx/osx.plugin.zsh | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/plugins/osx/osx.plugin.zsh b/plugins/osx/osx.plugin.zsh index d7baa1191..d04d34ea6 100644 --- a/plugins/osx/osx.plugin.zsh +++ b/plugins/osx/osx.plugin.zsh @@ -12,7 +12,7 @@ EOF echo "$the_app" } -function tab() { +function _tab() { # Must not have trailing semicolon, for iTerm compatibility local command="cd \\\"$PWD\\\"; clear" (( $# > 0 )) && command="${command}; $*" @@ -524,6 +524,20 @@ function spotify() { done } +function tab() { + _tab "$PWD/${1-}" +} + +function mtab() { + counter=0 + limit=$1 + while [ "$counter" -lt "$limit" ] + do + _tab "$PWD/${2-}" + counter=$(($counter+1)) + done +} + # Show/hide hidden files in the Finder alias showfiles="defaults write com.apple.finder AppleShowAllFiles -bool true && killall Finder"