欢迎访问 生活随笔!

生活随笔

当前位置: 首页 > 编程资源 > 编程问答 >内容正文

编程问答

配置学习Go的编辑器:配置TextMate

发布时间:2025/7/25 编程问答 49 豆豆
生活随笔 收集整理的这篇文章主要介绍了 配置学习Go的编辑器:配置TextMate 小编觉得挺不错的,现在分享给大家,帮大家做个参考.
TextMate是苹果电脑上的著名的文本编辑器,有非常好用的一些插件,fei'chang我选用了TextMate。 1.Textmate官网:http://macromates.com/ Textmate是收费的文本编辑器,但是现在可以免费使用了,只需在提示你更新的时候,更新到最新的版本就可以一直使用,如果感觉好用,可以支持一下作者。 2.安装好之后需要配置下命令行调用: 两种方式: (1)将Textmate的可执行文件的路径添加到环境变量PATH中。 export TEXTMATE_PATH=/Applications/TextMate.app/Contents/Resources export PATH=${PATH}:${TEXTMATE_PATH} (2)给Textmate的可执行文件创建软连接: ln -s /Applications/TextMate.app/Contents/Resources/mate ~/bin/mate ~/bin/mate文件需要先在~/bin目录中先创建一个。 设置环境变量默认的编辑器为 echo 'export EDITOR=~/bin/mate -w:$EDITOR'>>~/.bash_profile 3.安装Go语言对应的插件: Preference-->Bundles-->选择Go语言的插件:

查看Go插件的帮助文档:

基本内容如下:

This bundle relies on amazing open source tooling for some functionality. These utilities can be installed with the following commands:

go get -u github.com/nsf/gocode # completion go get -u github.com/zmb3/gogetdoc # documentation go get -u golang.org/x/tools/cmd/goimports # import resolution/rewriting go get -u github.com/golang/lint/golint # linting go get -u github.com/rogpeppe/godef # goto definition go get -u github.com/alecthomas/gometalinter # metalinting

You may override the following TextMate variables in the preferences (adjust paths to your own configuration). TextMate does not inherit the users environment unless it is launched from the command line. It may be necessary to set TM_GOPATH and GOROOT.

TM_GO=/usr/local/bin/go TM_GOPATH=/Users/myuser/go TM_GOCODE=/Users/myuser/bin/gocode TM_GOGETDOC=/Users/myuser/bin/gogetdoc TM_GOFMT=/Users/myuser/bin/gofmt # or /Users/myuser/bin/goimports TM_GOIMPORTS=/Users/myuser/bin/goimports TM_GOLINT=/Users/myuser/bin/golint TM_GODEF=/Users/myuser/bin/godef TM_GOMETALINTER=/Users/myuser/bin/gometalinter

文中提到的插件都是开发Go语言程序和使用该插件的时候需要用到的,按照帮助文档中的提示下载安装插件,并配置插件路径,

提醒一点,别忘了配置TM_GOPATH和GOROOT哦。

配置完毕后变量配置页面结果为:

 

途中标红部分是你的用户名。

至此,用来开发Go的编辑器TextMate就配置完毕了。

 

 

 


 

 

转载于:https://www.cnblogs.com/mengyehongmanshan/p/7351910.html

总结

以上是生活随笔为你收集整理的配置学习Go的编辑器:配置TextMate的全部内容,希望文章能够帮你解决所遇到的问题。

如果觉得生活随笔网站内容还不错,欢迎将生活随笔推荐给好友。