https://github.com/arnie97/go-cmd.vim
Minimalist asynchronous :Go command for Vim
https://github.com/arnie97/go-cmd.vim
go golang vim
Last synced: about 2 months ago
JSON representation
Minimalist asynchronous :Go command for Vim
- Host: GitHub
- URL: https://github.com/arnie97/go-cmd.vim
- Owner: Arnie97
- License: other
- Created: 2022-12-18T17:45:08.000Z (over 3 years ago)
- Default Branch: master
- Last Pushed: 2024-07-03T10:01:27.000Z (almost 2 years ago)
- Last Synced: 2025-03-21T21:13:44.914Z (over 1 year ago)
- Topics: go, golang, vim
- Language: Vim Script
- Homepage:
- Size: 4.88 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
- License: license.md
Awesome Lists containing this project
README
go-cmd.vim is a minimalist vim script wrapper for
[the `go` command](https://pkg.go.dev/cmd/go).
It provides one command `:Go` with command-line completions, and the
command results are collected in the quickfix list.
## Installation
The minimum recommended version is Neovim 0.2.0 or Vim 7.4.2044.
The plugin will fallback to synchronous blocking mode on older versions.
Use your preferred package manager to install this script and its only
dependency, [asyncrun.vim](https://github.com/skywind3000/asyncrun.vim).
### vim-plug
Below is a sample using [vim-plug](https://github.com/junegunn/vim-plug):
Plug 'skywind3000/asyncrun.vim'
Plug 'arnie97/go-cmd.vim'
let g:asyncrun_open = 2 " open quickfix automatically (optional)
set wildmenu " show the completion menu (optional)
Or leverage the built-in package loader:
### Neovim
$ git clone https://github.com/skywind3000/asyncrun.vim \
~/.local/share/nvim/site/pack/plugins/start/asyncrun.vim
$ git clone https://github.com/arnie97/go-cmd.vim \
~/.local/share/nvim/site/pack/plugins/start/go-cmd.vim
### Vim 8+
$ git clone https://github.com/skywind3000/asyncrun.vim \
~/.vim/pack/plugins/start/asyncrun.vim
$ git clone https://github.com/arnie97/go-cmd.vim \
~/.vim/pack/plugins/start/go-cmd.vim
## FAQ
### Why not vim-go?
I've been a long time [vim-go](https://github.com/fatih/vim-go) user.
It's an all-in-one solution which steps overs the boundaries defined by
the language server protocol and provides a lot of otherwise language-
agnostic components, e.g. LSP client, linter, and code completion.
Therefore it often conflicts with native Neovim features (LSP, DAP,
tree-sitter) or third-party plugins (ALE, COC), which generally works
better and provides a more consistent experience across file types.
After disabling the most functionalities in vim-go, I felt that the
`:Go*` commands were the only part that still in use, so I wrote this
plugin to provide better completions for them.
### Why not `:make` or `:!go`?
Unfortunately these approaches lack support for asynchronous execution
and sub-command completion. I would definitely go back to `&makeprg`
again if these pain points are resolved natively in the future.
## Credits
The plugin design was inspired by the `:Git` or `:G` command provided by
[vim-fugitive](https://github.com/tpope/vim-fugitive).
## License
This software is released into the public domain.