1

我在 OS X Snow Leopard 上尝试了几种解决方案来让 TextMate2 识别mate filename,但似乎没有“伙伴”可供mate命令调用:

$cd /Applications/TextMate.app/Contents/SharedSupport/
$ ls -al
total 0
drwxr-xr-x  3 admin  staff  102  9 Jul  2012 .
drwxr-xr-x  9 admin  staff  306  9 Jul  2012 ..
drwxr-xr-x  3 admin  staff  102  9 Jul  2012 Bundles

$ which mate
/Users/admin/bin/mate

但是 mate 脚本 (~/bin/mate) 失败,因为 'Contents/Resources/mate' 不存在:

#!/bin/sh
exec "${TM_MATE:-$("$TM_SUPPORT_PATH/bin/find_app" com.macromates.TextMate.preview)/Contents/Resources/mate}" "$@"

...所以mate myfile给出:

/Users/admin/bin/mate: line 2: /bin/find_app: No such file or directory
/Users/admin/bin/mate: line 2: /Contents/Resources/mate: No such file or directory
/Users/admin/bin/mate: line 2: exec: /Contents/Resources/mate: cannot execute: No such file or directory

大约 2 小时后,我找不到解决方案,所以如果有人遇到同样的问题,我将不胜感激。

4

1 回答 1

2

我认为问题在于您已经安装了 TextMate 但尚未通过终端启用 shell 支持。现在只需单击几下即可解决此问题。

  1. 打开 Text Mate 并导航到 TextMate | 喜好。

  2. 选择终端。您可能会看到一条消息,指出尚未安装 Shell 支持,您需要安装 mate shell 命令并在 .bashrc 中添加一行。

  3. 单击“安装”按钮安装 mate shell 命令。

  4. 复制下面的行并将其粘贴到您的 .bashrc 中。

    export EDITOR="/usr/local/bin/mate -w"

  5. 关闭并重新打开终端,“mate”命令现在应该可以按预期工作了。

于 2014-01-08T13:55:05.087 回答