Vim compiler plugin for Go (golang)

Vim compiler file for Go (golang)

Compiles Go files in the background and usefully underlines and reports errors to the QuickFix window:

Installation:

Pathogen

Just clone this repo into your bundles directory:

git clone https://github.com/rjohnsondev/vim-compiler-go.git ~/.vim/bundle/vim-compiler-go

Either ensure the $GOROOT environment variable is set, or otherwise set the g:golang_goroot variable in .vimrc to where your go installation can be found. This must be an absolute path:

let g:golang_goroot = "/home/richard/go"

Manual installation

Drop golang.vim in ~/.vim/compiler directory.

Add the following line to the autocmd section of .vimrc

autocmd FileType go compiler golang

Set the g:golang_goroot variable to where your go installation can be found. This must be an absolute path

let g:golang_goroot = "/home/richard/go"

The plugin assumes a standard project layout with the files stored in a src directory. The GOPATH is set to one directory below the src folder.

Usage:

Golang is called after a buffer with Go code is saved. The QuickFix window is opened to show errors, warnings and hints provided by Golang.

To disable calling Golang every time a buffer is saved, put into .vimrc file:

let g:golang_onwrite = 0

The QuickFix window can be disabled with:

let g:golang_cwindow = 0

Setting highlights for the lines can be disabled with:

let g:golang_inline_highlight = 0

Of course, standard :make command can be used as is the case with every other compiler.

Owner
Richard Johnson
Former London-based CTO recently relocated to Melbourne; wrangler of data, servant-leader of high performance teams, lover of functional programming.
Richard Johnson
Similar Resources

Compiler as a Service is a compiler that is available over http/https and gRPC

BlakBoks(CaaS) Elasticsearch but for compiling untrusted code Compiler as a Service is a compiler that is available over http/2 and gRPC. Setup First

Nov 24, 2021

Learning Vim and Vimscript doesn't have to be hard. This is the guide that you're looking for.

Learning Vim and Vimscript doesn't have to be hard. This is the guide that you're looking for.

Learn Vim (the Smart Way) What's This? Learn Vim (the Smart Way) is a guide to learn the good parts of Vim. There are many places to learn Vim: the vi

Jan 1, 2023

A terminal based game that teaches you how to use Vim.

A terminal based game that teaches you how to use Vim.

VimMan Learn how to use Vim in its natural environment, the Terminal! About VimMan is terminal program that's a semi editor and a semi game. The purpo

Dec 5, 2022

Integrated console application library, using Go structs as commands, with menus, completions, hints, history, Vim mode, $EDITOR usage, and more ...

Integrated console application library, using Go structs as commands, with menus, completions, hints, history, Vim mode, $EDITOR usage, and more ...

Gonsole - Integrated Console Application library This package rests on a readline console library, (giving advanced completion, hint, input and histor

Nov 20, 2022

Vim made in Go that you shouldn't use.

novavim This is my attempt at making Vim from scratch in Go, meaning this project will utilize no libs outside of the Go standard library: no ncurses,

Aug 4, 2022

go program that installs and customizes ohmyzsh tmux vim via various plugins and other nice to haves

go program that installs and customizes ohmyzsh tmux vim via various plugins and other nice to haves

Pimp-My-Shell Table of Contents Pimp-My-Shell Install Usage About Resources Tmux Hotkeys VIM Hotkeys Adjusting Custom Aliases Mac Fix Terminal bind ke

Dec 22, 2022

The `protoc` compiler plugin which dumps the generation request details

Progotgen DUMP The protoc compiler plugin which dumps the generation request details in "google.golang.org/protobuf/compiler/protogen format to stderr

Jan 23, 2022

Golang CS:GO external base. Development currently halted due to compiler/runtime Golang bugs.

gogo Golang CS:GO External cheat/base. Also, my first Golang project. Wait! Development momentarily halted due to compiler/runtime bugs. Disclaimer Th

Jun 25, 2022

packM 🧬 is fivem resource compiler for golang with the power of golang+typescript+webpack

packM 🧬 packM 🧬 is fivem resource compiler for golang ,typescript with the power of golang+typescript compiler+webpack

Jun 28, 2022

vault-plugin-auth-usertotp is an auth method plugin for HashiCorp Vault

vault-plugin-auth-usertotp is an auth method plugin for HashiCorp Vault. Create user accounts, add TOTP tokens (user supplied pin + totp), and have peace of mind using 2FA.

Jul 5, 2021

Kubectl Locality Plugin - A plugin to get the locality of pods

Kubectl Locality Plugin - A plugin to get the locality of pods

Nov 18, 2021

vault-plugin-auth-usertotp is an auth method plugin for HashiCorp Vault.

vault-plugin-auth-usertotp is an auth method plugin for HashiCorp Vault. Create user accounts, add TOTP tokens (user supplied pin + totp), and have peace of mind using 2FA.

Jul 30, 2021

Create a Protocol Buffers (Protobuf) plugin, which is executed with the protoc compileCreate a Protocol Buffers (Protobuf) plugin, which is executed with the protoc compile

Interview Assignment Overview You assignment is to create a Protocol Buffers (Protobuf) plugin, which is executed with the protoc compiler. In this ex

Nov 19, 2021

The plugin serves as a starting point for writing a Mattermost plugin

Plugin Starter Template This plugin serves as a starting point for writing a Mattermost plugin. Feel free to base your own plugin off this repository.

Dec 10, 2021

Kobiton-execute-test-buildkite-plugin - A Buildkite Plugin to (synchronously) execute an automated test script on Kobiton service

Kobiton Execute Test Buildkite Plugin A Buildkite Plugin to (synchronously) exec

Feb 10, 2022

Cf-cli-find-app-plugin - CF CLI plugin to find applications containing a search string

Overview This cf cli plugin allows users to search for application names that co

Jan 3, 2022

Packer Plugin Vagrant - The Vagrant multi-component plugin can be used with HashiCorp Packer to create custom images

Packer Plugin Vagrant - The Vagrant multi-component plugin can be used with HashiCorp Packer to create custom images

Jul 13, 2022

Twitter-plugin - Falco Plugin for Twitter Stream

Twitter Plugin This repository contains the twittter plugin for Falco, which fol

Mar 17, 2022

Gentee - script programming language for automation. It uses VM and compiler written in Go (Golang).

Gentee script programming language Gentee is a free open source script programming language. The Gentee programming language is designed to create scr

Dec 15, 2022
Comments
  • Use environment's $GOPATH if set

    Use environment's $GOPATH if set

    My $GOPATH is different, the plugin fails to find imports with the existing logic. This patch checks if $GOPATH is set, if not reverts to the current way.

Go development plugin for Vim
Go development plugin for Vim

vim-go Features This plugin adds Go language support for Vim, with the following main features: Compile your package with :GoBuild, install it with :G

Jan 7, 2023
A terminal based game that teaches you how to use Vim.
A terminal based game that teaches you how to use Vim.

VimMan Learn how to use Vim in its natural environment, the Terminal! About VimMan is terminal program that's a semi editor and a semi game. The purpo

Dec 5, 2022
A Golang plugin collection for SublimeText 3, providing code completion and other IDE-like features.

GoSublime Intro GoSublime is an IDE-like plugin for Sublime Text 3 mainly, but not limited to, providing integration for most of your Go/Golang develo

Jan 4, 2023
golab: go local application builder - a web-based golang ide
golab: go local application builder - a web-based golang ide

golab golab was a Go IDE for Linux. This project is no longer maintained and might not build due to chganges in dependency projects. The author (mb0)

Aug 16, 2022
Vim plugin for https://github.com/hexdigest/gounit
Vim plugin for https://github.com/hexdigest/gounit

gounit-vim Vim plugin for gounit tool that allows you to generate Go tests easily. Demo Installation gounit-vim requires gounit to be available in you

Sep 27, 2022
Go development plugin for Vim
Go development plugin for Vim

vim-go Features This plugin adds Go language support for Vim, with the following main features: Compile your package with :GoBuild, install it with :G

Jan 7, 2023
🐉 BLAZINGLY FAST CLI plugin manager for (neo)vim

viper BLAZINGLY FAST CLI plugin manager for (neo)vim. Usage Viper does all the nice and basic things you'd expect from a (neo)vim plugin manager, and

Jun 9, 2022
ReCT-Go-Compiler - A compiler for the ReCT programming language written in Golang

ReCT-Go-Compiler A compiler for the ReCT programming language written in Golang

Nov 30, 2022
ReCT-Go-Compiler - A compiler for the ReCT programming language written in Golang

ReCT-Go-Compiler A compiler for the ReCT programming language written in Golang

Nov 30, 2022
Go compiler made from scratch, which can compile itself. It's going to be the smallest and simplest go compiler in the world.

Babygo, a go compiler made from scratch Babygo is a small and simple go compiler. (Smallest and simplest in the world, I believe.) It is made from scr

Jan 8, 2023