把vim当做golang的IDE
2016-02-24 20:27
561 查看
开始决定丢弃鼠标,所以准备用vim了。
那么在vim里面如何搭建golang环境呢?
git盛行之下,搭建vim环境是如此简单。
而且vim搭建好了之后,基本上跟IDE没有差别。
高亮、自动补全、自动格式化、查看定义跳转、语法检测等等等等, 简直是不要不要的:
Improved Syntax highlighting with items such as Functions, Operators, Methods.
Auto completion support via
Better
Go to symbol/declaration with
Look up documentation with
Automatically import packages via
Compile your package with
Quickly execute your current file/files with
Automatic
Change or display
Create a coverage profile and display annotated source code in browser to see which functions are covered with
Call
Lint your code with
Run your code through
Advanced source analysis tools utilizing oracle, such as
Precise type-safe renaming of identifiers with
List all source files and dependencies
Unchecked error checking with
Integrated and improved snippets, supporting
Share your current code to play.golang.org with
On-the-fly type information about the word under the cursor. Plug it into your custom vim function.
Go asm formatting on save
Tagbar support to show tags of the source code in a sidebar with
Custom vim text objects such as
A async launcher for the go command is implemented for Neovim, fully async building and testing (beta).
Integrated with the Neovim terminal, launch
Alternate between implementation and test code with
安装起来也非常方便,只要一下三行代码:
PS:
a)这里要求vim 要开启lua :
b)如果需要类解析,需要转ctag
原文:http://farazdagi.com/blog/2015/vim-as-golang-ide/
效果如下:
那么在vim里面如何搭建golang环境呢?
git盛行之下,搭建vim环境是如此简单。
而且vim搭建好了之后,基本上跟IDE没有差别。
高亮、自动补全、自动格式化、查看定义跳转、语法检测等等等等, 简直是不要不要的:
Improved Syntax highlighting with items such as Functions, Operators, Methods.
Auto completion support via
gocode
Better
gofmton save, which keeps cursor position and doesn't break your undo history
Go to symbol/declaration with
:GoDef
Look up documentation with
:GoDocinside Vim or open it in browser
Automatically import packages via
:GoImportor plug it into autosave
Compile your package with
:GoBuild, install it with
:GoInstallor test them with
:GoTest(also supports running single tests via
:GoTestFunc)
Quickly execute your current file/files with
:GoRun
Automatic
GOPATHdetection based on the directory structure (i.e.
gbprojects,
godepvendored projects)
Change or display
GOPATHwith
:GoPath
Create a coverage profile and display annotated source code in browser to see which functions are covered with
:GoCoverage
Call
gometalinterwith
:GoMetaLinter, which invokes all possible linters (golint, vet, errcheck, deadcode, etc..) and shows the warnings/errors
Lint your code with
:GoLint
Run your code through
:GoVetto catch static errors
Advanced source analysis tools utilizing oracle, such as
:GoImplements,
:GoCallees, and
:GoReferrers
Precise type-safe renaming of identifiers with
:GoRename
List all source files and dependencies
Unchecked error checking with
:GoErrCheck
Integrated and improved snippets, supporting
ultisnipsor
neosnippet
Share your current code to play.golang.org with
:GoPlay
On-the-fly type information about the word under the cursor. Plug it into your custom vim function.
Go asm formatting on save
Tagbar support to show tags of the source code in a sidebar with
gotags
Custom vim text objects such as
a functionor
inner functionlist.
A async launcher for the go command is implemented for Neovim, fully async building and testing (beta).
Integrated with the Neovim terminal, launch
:GoRunand other go commands in their own new terminal. (beta)
Alternate between implementation and test code with
:GoAlternate
安装起来也非常方便,只要一下三行代码:
#下载安装 git clone git@github.com:farazdagi/vim-go-ide.git ~/.vim_go_runtime sh ~/.vim_go_runtime/bin/install #运行 vim -u ~/.vimrc.go
PS:
a)这里要求vim 要开启lua :
brew install vim --with-lua --override-system-vim
b)如果需要类解析,需要转ctag
原文:http://farazdagi.com/blog/2015/vim-as-golang-ide/
效果如下:
相关文章推荐
- LeetCode Algorithms #21 <Merge Two Sorted Lists>
- Mongo性能检查
- LeetCode Algorithms #231 <Power of Two>
- GCM Google官方示例的简单介绍和使用
- Qualcomm官方QDN1月EDM:属于你的Dragon Board 410c
- DragonBoard 410c HDMI配置的艰辛路
- Go文件上传的例子
- golang beego 路由个人理解
- beego里面自定义配置文件
- 【CodeForces 616D】Longest k-Good Segment
- django项目部署到SAE上的个人博客
- GO语言(golang)官方网站!
- GO语言(golang)官方网站!
- 灰度世界算法(Gray World Algorithm)和White Patch Retinex算法
- django使用django.db模块创建表之二
- Navicat 导入数据报错 --- 1153 - Got a packet bigger than 'max_allowed_packet' bytes
- golang模板语法简明教程
- Golang学习摘录(三)
- google排名算法,公式
- 骁龙相机(SnapdragonCamera)低分率拍照放到PC端照片损毁