本文摘自PHP中文网,作者藏色散人,侵删。
下面由sublime教程栏目给大家分享sublime text3解决Gosublime无法自动补全代码的方法,希望对需要的朋友有所帮助!sublime text3解决Gosublime无法自动补全代码
版本
1 2 3 | Sublime Text3.2.1
go version go1.12.1 darwin/amd64
Gosublime 18.11.28
|
安装Gosublime
打开Perferences?CBrowse Packages…,进入Gosublime,在命令行里输入:
自动补全解决方法
在windows和mac上使用sublime text3安装Gosublime插件后都无法自动补全代码,经过多日的研究找到如下解决方法。
打开Perferences?CBrowse Packages…,进入Gosublime:
1、在src目录下创建margo目录;
2、拷贝src/margo.sh/extension-example/extension-example.go文件到margo目录下;
3、拷贝margo文件夹(所有文件和目录)到src/margo.sh/vendor目录下;
4、重新打开sublime text3,稍等几分钟就可以自动补全代码了。
Gosublime配置
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 | Perferences?CPackage Settings?CGosublime?CSettings - User
{
"env" : {
"GOPATH" : "/data" ,
"GOROOT" : "/usr/local/go" ,
"PATH" : "$GOROOT:$GOPATH:$GOROOT/bin" ,
},
"gscomplete_enabled" : true,
"fmt_enabled" : true,
"fmt_tab_indent" : false,
"fmt_tab_width" : 4,
"autocomplete_snippets" : true,
"autocomplete_tests" : true,
"autocomplete_builtins" : true,
"autocomplete_closures" : true,
"autocomplete_suggest_imports" : true,
"calltips" : true,
"use_named_imports" : true,
"autoinst" : true,
"ipc_timeout" : 1,
"fmt_cmd" : [ "goimports" ],
"on_save" : [
{ "cmd" : "gs_comp_lint" },
{ "cmd" : "goimports" }
],
"lint_enabled" : true,
"linters" : [
{ "cmd" : [ "go" , "run" ]}
],
"comp_lint_enabled" : true,
"comp_lint_commands" : [
{ "cmd" : [ "go" , "install" ]}
],
}
|
ctrl+q显示帮助
1 2 3 4 5 6 7 8 | Perferences?CPackage Settings?CGosublime?CKey Bindings - Default
{
"keys" : [ "ctrl+q" ],
"command" : "gs_doc" ,
"args" : { "mode" : "hint" },
"context" : [{ "key" : "selector" , "operator" : "equal" , "operand" : "source.go" }]
},
|
以上就是sublime text3如何解决Gosublime无法自动补全代码的详细内容,更多文章请关注木庄网络博客!
相关阅读 >>
详解sublime搭建c/c++编译环境
sublime快捷键,欢迎保存~
mac系统sublime text3安装与使用中遇到的问题
sublime text的快捷方式有哪些
sublime text 3 package install 无法安装插件
2步实现在git bash中用sublime打开文件
在sublime中实现代码检测
sublime如何为方法加注释快捷键
比较一下sublime和vscode
sublime text 3如何设置宏?
更多相关阅读请进入《sublime》频道 >>
转载请注明出处:木庄网络博客 » sublime text3如何解决Gosublime无法自动补全代码