您现在的位置是:网站首页> 编程资料编程资料
sublime text3解决Gosublime无法自动补全代码的问题_Golang_
2023-05-26
481人已围观
简介 sublime text3解决Gosublime无法自动补全代码的问题_Golang_
版本
Sublime Text3.2.1
go version go1.12.1 darwin/amd64
Gosublime 18.11.28
安装Gosublime
打开Perferences–Browse Packages…,进入Gosublime,在命令行里输入:
git clone https://github.com/DisposaBoy/GoSublime.git
自动补全解决方法
在windows和mac上使用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无法自动补全代码的问题的文章就介绍到这了,更多相关sublime text3 Gosublime自动补全内容请搜索以前的文章或继续浏览下面的相关文章希望大家以后多多支持!
相关内容
- Sublime Text3安装Go语言相关插件gosublime时搜不到gosublime的解决方法_Golang_
- Golang语言如何避免空指针引发的panic详解_Golang_
- go语言开发环境配置(sublime text3+gosublime)_Golang_
- 在 Golang 中使用 Cobra 创建 CLI 应用_Golang_
- go单例实现双重检测是否安全的示例代码_Golang_
- 详解go语言中sort如何排序_Golang_
- 如何利用Go语言实现LRU Cache_Golang_
- 关于golang监听rabbitmq消息队列任务断线自动重连接的问题_Golang_
- Golang小数操作指南之判断小数点位数与四舍五入_Golang_
- go语言中值类型和指针类型的深入理解_Golang_
