1
0
mirror of https://github.com/jbranchaud/til synced 2026-01-02 22:58:01 +00:00

Add Build And Install A Go Program as a vim til

This commit is contained in:
jbranchaud
2016-02-06 09:03:00 -06:00
parent fae4df4b89
commit b8dbc4607b
2 changed files with 28 additions and 0 deletions

View File

@@ -318,6 +318,7 @@ _325 TILs and counting..._
- [The Black Hole Register](vim/the-black-hole-register.md)
- [Breaking The Undo Sequence](vim/breaking-the-undo-sequence.md)
- [Buffer Time Travel](vim/buffer-time-travel.md)
- [Build And Install A Go Program](vim/build-and-install-a-go-program.md)
- [Case-Aware Substitution With vim-abolish](vim/case-aware-substitution-with-vim-abolish.md)
- [Case-Insensitive Substitution](vim/case-insensitive-substitution.md)
- [Center The Cursor](vim/center-the-cursor.md)

View File

@@ -0,0 +1,27 @@
# Build And Install A Go Program
With the [`vim-go`](https://github.com/fatih/vim-go) plugin, Vim gets all
kinds of support for working with a Go project. Generally, with a Go
project, you have to run `go build` to compile the project and if that is
successful, you can run `go install` to put the executable binary on the
`$GOPATH`.
This plugin allows you to tighten the feedback loop. You can build right
within your Vim session using
```
:GoBuild
```
which will alert you to any compilation errors.
You can then install the program using
```
:GoInstall
```
Your program is now ready to run.
It's worth noting that this plugin will also notify you about syntax errors
when you save, if they exist.