Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Fixes and improves the behavior of the tm command

  • Loading branch information...
commit 30890b9eb9e1b6fc4b553d94a97424049bd6003e 1 parent 757fa33
@jasongill jasongill authored
Showing with 11 additions and 2 deletions.
  1. +11 −2 plugins/textmate/textmate.plugin.zsh
View
13 plugins/textmate/textmate.plugin.zsh
@@ -6,7 +6,16 @@ alias etts='mate app config lib db public script spec test vendor/plugins vendor
# Edit Ruby app in TextMate
alias mr='mate CHANGELOG app config db lib public script spec test'
+# If the tm command is called without an argument, open TextMate in the current directory
+# If tm is passed a directory, cd to it and open it in TextMate
+# If tm is passed a file, open it in TextMate
function tm() {
- cd $1
- mate $1
+ if [[ -z $1 ]]; then
+ mate .
+ else
+ mate $1
+ if [[ -d $1 ]]; then
+ cd $1
+ fi
+ fi
}
Please sign in to comment.
Something went wrong with that request. Please try again.