下载GoSublime
官网地址:https://github.com/DisposaBoy/GoSublime.git
打开sublime插件位置
在sublime中,选中Preferences->**Browse Packages… **并点击,如图:
添加GoSublime插件
将下载的GoSublime文件夹移动到该目录下,如图:
生效
关闭sublime,重新打开,此时在Prefernces->Package Settines中可以看到GoSublime插件:
选中Settings-Users,设置为:
{
"goroot": "C:\\Go",
"gopath": "F:\\gopath",
}
报错
gosublime安装后重启sublime,发现sublime下方出现报错:
(margo.sublime build failed: press ` ctrl+. `, ` ctrl+x ` to configure margo or check console for errors)
解决方法:
按照 https://margo.sh/b/hello-margo/ 文档编辑margo,但是使用` ctrl+. `, ` ctrl+x `没有效果,因此手动创建margo包
1、选中 Preferences->**Browse Packages… ** 并点击
2、创建目录 GoSublime\src\margo
3、将 GoSublime\src\margo.sh\extension-example\extension-example.go 复制粘贴为 GoSublime\src\margo\margo.go