Using vim-go plugin
By Aravind
Installation of vim-go plugin
I pretty much followed what was given here
-
First install using below. You can just copy paste
curl -fLo ~/.vim/autoload/plug.vim --create-dirs https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim git clone https://github.com/fatih/vim-go.git ~/.vim/plugged/vim-go -
open your
.vimrcfile and below contentscall plug#begin() Plug 'fatih/vim-go', { 'do': ':GoInstallBinaries' } call plug#end() -
Open vim
- Install gobinaries
:GoInstallBinaries - Start your main.go
vim main.go
Usage
- Using go run from terminal
:GoRun - Build the file
:GoBuild - Mapping keys for go build and go run
- Display files
:GoFiles - Call targets. This will go various call Targets
:GoCallees
golang
linux
]
tags: golang - linux