Aravind Prabhakar

Systems Engineer | Networking | Security | PreSales | Cloud | Devops | AIOps

View on GitHub Linkedin Blogs Tags
9 April 2023

Using vim-go plugin

By Aravind

Installation of vim-go plugin

I pretty much followed what was given here

  1. 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
    
  2. open your .vimrc file and below contents

     call plug#begin()
     Plug 'fatih/vim-go', { 'do': ':GoInstallBinaries' }
     call plug#end()
    
  3. Open vim

  4. Install gobinaries
     :GoInstallBinaries
    
  5. Start your main.go
     vim main.go
    

Usage

  1. Using go run from terminal
     :GoRun
    
  2. Build the file
     :GoBuild
    
  3. Mapping keys for go build and go run
  4. Display files
     :GoFiles
    
  5. Call targets. This will go various call Targets
     :GoCallees
    
[ golang  linux  ] tags: golang - linux