Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up

Go development plugin for Vim

License

NotificationsYou must be signed in to change notification settings

fatih/vim-go

Repository files navigation

Vim-go logo

Features

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

  • Compile your package with:GoBuild, install it with:GoInstall or test itwith:GoTest. Run a single test with:GoTestFunc).
  • Quickly execute your current file(s) with:GoRun.
  • Improved syntax highlighting and folding.
  • Debug programs with integrateddelve support with:GoDebugStart.
  • Completion and many other features support viagopls.
  • formatting on save keeps the cursor position and undo history.
  • Go to symbol/declaration with:GoDef.
  • Look up documentation with:GoDoc or:GoDocBrowser.
  • Easily import packages via:GoImport, remove them via:GoDrop.
  • Precise type-safe renaming of identifiers with:GoRename.
  • See which code is covered by tests with:GoCoverage.
  • Add or remove tags on struct fields with:GoAddTags and:GoRemoveTags.
  • Lint your code with:GoLint or:GoMetaLinter, run your code through:GoVet to catch static errors, or make sure errors are checked with:GoErrCheck.
  • Advanced source analysis utilizinggopls, such as:GoImplements,:GoCallees, and:GoReferrers.
  • ... and many more! Please seedoc/vim-go.txt for more information.
  • Integration withgopls.
  • Thegopls instance can be shared with other Vim plugins.
  • Vim-go's use ofgopls can be disabled and alternative tools can be used when desired.
  • Integration withTagbar viagotags.
  • Integration withUltisnips and other snippet engines.

Install

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

Thelatest stable release is therecommended version to use. If you choose to use the master branch instead,please do so with caution; it is adevelopment branch.

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

  • Vim 8 packages
    • git clone https://github.com/fatih/vim-go.git ~/.vim/pack/plugins/start/vim-go
  • Neovim packages
    • git clone https://github.com/fatih/vim-go.git ~/.local/share/nvim/site/pack/plugins/start/vim-go
  • Pathogen
    • git clone https://github.com/fatih/vim-go.git ~/.vim/bundle/vim-go
  • vim-plug
    • Plug 'fatih/vim-go', { 'do': ':GoUpdateBinaries' }
  • Vundle
    • Plugin 'fatih/vim-go'

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

Check out the Install section inthe documentation for moredetailed instructions (:help go-install).

Usage

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

Depending on your installation method, you may have to generate the plugin'shelp tagsmanually (e.g.:helptags ALL).

We also have atutorial in theofficial vim-go wiki.

FAQ and troubleshooting

The FAQ and troubleshooting tips are in the documentation and can be quicklyaccessed using:help go-troubleshooting. If you believe you've found a bug orshortcoming in vim-go that is neither addressed by help nor inexistingissues, please open an issue withclear reproduction steps.:GoReportGitHubIssue can be used pre-populate a lotof the information needed when creating a new issue.

Contributing

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

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

License

The BSD 3-Clause License - seeLICENSE for more details


[8]ページ先頭

©2009-2025 Movatter.jp