vim-go README

The project's README from github.com/fatih/vim-go. As one markdown file: README.md.

vim-go GitHub Actions Status

Vim-go logo

Features

This plugin adds Go language support for Vim, with the following main features:

Install

vim-go requires at least Vim 8.2.5072 or Neovim 0.4.0.

The latest stable release is the recommended version to use. If you choose to use the master branch instead, please do so with caution; it is a development branch.

vim-go follows the standard runtime path structure. Below are some helper lines for popular package managers:

You will also need to install all the necessary binaries. vim-go makes it easy to install all of them by providing a command, :GoInstallBinaries, which will go install all the required binaries.

Check out the Install section in the documentation for more detailed instructions (:help go-install).

Usage

The full documentation can be found at doc/vim-go.txt. You can display it from within Vim with :help vim-go.

Depending on your installation method, you may have to generate the plugin's help tags manually (e.g. :helptags ALL).

We also have a tutorial in the official vim-go wiki.

FAQ and troubleshooting

The FAQ and troubleshooting tips are in the documentation and can be quickly accessed using :help go-troubleshooting. If you believe you've found a bug or shortcoming in vim-go that is neither addressed by help nor in existing issues, please open an issue with clear reproduction steps. :GoReportGitHubIssue can be used pre-populate a lot of the information needed when creating a new issue.

Contributing

All PRs are welcome. If you are planning to contribute a large patch or to integrate a new tool, please create an issue first to get any upfront questions or design decisions out of the way first.

You can run the tests locally by running make. It will lint the VimL for you, lint the documentation, and run the tests against the minimum required version of Vim, other versions of Vim that may be critical to support, and Neovim.

License

The BSD 3-Clause License - see LICENSE for more details

vim-go (fatih/vim-go)

Searching Database…

16.2K ·GitHub
这是什么?vim-go 是一个 Vim 插件,为你的编辑器添加 Go 语言支持:编译、运行和测试代码,更丰富的语法高亮,调试,以及基于 gopls 的自动补全和代码跳转。
这是一个独立的 IDE,还是装在我 Vim 里面的东西?它是一个由 Vim 或 Neovim 加载的插件,不是独立的 IDE——它会安装到 Vim 的运行时路径里,为你已经在用的编辑器添加 Go 相关的命令和工具。
在使用之前需要先装什么吗?需要 Vim 8.2.5072 或更新版本,或者 Neovim 0.4.0 或更新版本,外加一个 Go 工具链——所需的二进制文件会通过 :GoInstallBinaries 命令用 go install 来安装。
我应该一直跟踪 master 分支吗?最好别这样:推荐使用最新的稳定版本,master 是开发分支,使用时需要谨慎。
它能在哪些系统上运行?凡是 Vim 8.2+ 或 Neovim 0.4+ 能运行的地方都可以——它是终端编辑器的插件,所以 Linux、macOS 和 Windows 都没问题。
它为构建和测试 Go 代码添加了哪些命令?它添加了 :GoBuild 来编译你的包,还有 :GoInstall、:GoTest 用于运行测试、:GoTestFunc 用于运行单个测试,以及 :GoRun 来快速运行你当前打开的文件。
我能在不离开 Vim 的情况下调试 Go 程序吗?可以——vim-go 集成了 delve 调试器:用 :GoDebugStart 启动调试会话,就能直接在编辑器里单步调试你的程序。
gopls 在这里负责什么?我可以换掉它吗?gopls 提供自动补全以及 :GoImplements、:GoCallees 和 :GoReferrers 这类高级代码分析。它的实例可以和其他 Vim 插件共享,如果你更喜欢别的工具,也可以禁用 vim-go 对 gopls 的使用。
它能帮助重构和处理 struct 标签吗?能::GoRename 可以对标识符进行精确的类型安全重命名,:GoAddTags 和 :GoRemoveTags 则用来给 struct 字段添加或删除标签。
What are similar projects?ale, nerdtree, vimrc, YouCompleteMe, zenc, helix, neovim, NvChad
Creator
fatih
Size
6.8 MB
Stars
16.2K
Age
12y
Commits · 90 Days