我如何获得git的使用TextMate的作为默认编辑器? [英] How do I get git to use Textmate as my default editor?

查看:160
本文介绍了我如何获得git的使用TextMate的作为默认编辑器?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在命令行,如果我做伴侣<文件路径方式> 它开辟了适合我的文件中的TextMate

At the command-line, if I do mate <filepath> it opens up the right file for me in TextMate.

但是,当我做的:

$ mate -v
open: invalid option -- v
Usage: open [-e] [-t] [-f] [-W] [-R] [-n] [-g] [-h] [-b <bundle identifier>] [-a <application>] [filenames] [--args arguments]

此外,当我做 git的承诺,我看到:

$ git commit
error: cannot run mate: No such file or directory
error: There was a problem with the editor 'mate'.
Please supply the message using either -m or -F option.

我的〜/ .bashprofile 有这些行:

#Set Textmate as my default editor from the command-line
alias mate='open -a TextMate.app'

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

〜/ .bashrc中有仅这一个:

alias mate='open -a TextMate.app'

修改1

我的〜/的.gitconfig 包括以下内容:

[user]
    name = My Name
    email = myemail@address.com
[core]
    editor = mate
[github]
    user = marcamillion
    token = 50e3iuaidsgadjkhwkjegakjhbsdkjb30432 (don't worry, this is fake)

帮助!

推荐答案

加入以下核心部分在〜/的.gitconfig

By adding the following to the core section in ~/.gitconfig

[core]
    editor = mate

更新:
确定,如果它已经存在那么问题可能是对TextMate而不是饭桶。

Update: Ok if it's already there then the issue is probably with textmate and not git.

2的TextMate:

Textmate 2:

在preferences有一个终端选项卡,并安装按钮
当你点击安装的队友会在/ usr / local / bin目录/伴侣,一切都应该工作。

In preferences there is a terminal tab and an install button When you click on install mate will be in /usr/local/bin/mate and everything should work.

TextMate的1:

Textmate 1:

您需要创建一个符号链接
http://manual.macromates.com/en/using_textmate_from_terminal.html

You need to create a symbolic link http://manual.macromates.com/en/using_textmate_from_terminal.html

我的TextMate 1(我现在使用vim:)

I have textmate 1 (I use vim now :)

ls -l `which mate`

lrwxr-xr-x  1 jameskyburz  staff  66 Jul  1  2011 /usr/local/bin/mate -> /Applications/TextMate.app/Contents/SharedSup

LN -s /Applications/TextMate.app/Contents/Resources/mate在/ usr / local / bin目录/伴侣

ln -s /Applications/TextMate.app/Contents/Resources/mate /usr/local/bin/mate

这篇关于我如何获得git的使用TextMate的作为默认编辑器?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆