From db31957cd7aab24cb1ea12c140970c7dad39f949 Mon Sep 17 00:00:00 2001 From: Sorin Ionescu Date: Wed, 28 Dec 2011 11:42:41 -0500 Subject: [PATCH] Easily open files and directories in TextMate. --- plugins/textmate/init.zsh | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/plugins/textmate/init.zsh b/plugins/textmate/init.zsh index 80564b1c..6a66820f 100644 --- a/plugins/textmate/init.zsh +++ b/plugins/textmate/init.zsh @@ -9,6 +9,10 @@ alias mr='mate CHANGELOG app config db lib public script spec test' # Functions function tm() { - cd "$1" && mate . + if [[ -z "$1" ]]; then + mate . + else + ( [[ -d "$1" ]] && cd "$1" && mate . ) + fi }