sublime text3如何解决Gosublime无法自动补全代码

下面由sublime教程栏目给大家分享sublime text3解决gosublime无法自动补全代码的方法,希望对需要的朋友有所帮助!

sublime text3如何解决Gosublime无法自动补全代码

sublime text3解决Gosublime无法自动补全代码

版本

Sublime Text3.2.1go version go1.12.1 darwin/amd64Gosublime 18.11.28

安装Gosublime

打开Perferences–Browse Packages…,进入Gosublime,在命令行里输入:

git clone https://github.com/DisposaBoy/GoSublime.git

自动补全解决方法

windowsmac上使用sublime text3安装Gosublime插件后都无法自动补全代码,经过多日的研究找到如下解决方法。

打开Perferences–Browse 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配置

Perferences–Package Settings–Gosublime–Settings - 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显示帮助

Perferences–Package Settings–Gosublime–Key Bindings - Default{"keys": ["ctrl+q"],// "keys": ["super+.", "super+h"],"command": "gs_doc","args": {"mode": "hint"},"context": [{ "key": "selector", "operator": "equal", "operand": "source.go" }]},

以上就是sublime text3如何解决Gosublime无法自动补全代码的详细内容,更多请关注创想鸟其它相关文章!

版权声明:本文内容由互联网用户自发贡献,该文观点仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。
如发现本站有涉嫌抄袭侵权/违法违规的内容, 请发送邮件至 chuangxiangniao@163.com 举报,一经查实,本站将立刻删除。
发布者:程序猿,转转请注明出处:https://www.chuangxiangniao.com/p/115962.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2025年11月24日 19:26:23
下一篇 2025年11月24日 19:40:39

相关推荐

发表回复

登录后才能评论
关注微信