Skip to content

momaek/golang-vim

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

golang-vim

This is my vim configuration for golang

Install

  1. Install plugged
  2. Download vimrc
mv ~/.vimrc ~/.vimrc.back
wget -O ~/.vimrc https://raw.githubusercontent.com/momaek/golang-vim/master/vimrc
wget -O ~/.vim/coc-settings.json https://raw.githubusercontent.com/momaek/golang-vim/master/coc-settings.json

Usage

Initialize

  1. Install plugins
:PlugInstall
  1. Install vim-go dependencies
:GoInstallBinaries

Basic Usage

  • Jump to defination: C+], jump back: C+o
  • Jump to type-defination gy
  • Jump to references gr
  • Save current sw
  • Force quit qq
  • Normal mode jj
  • Search / or space
  • Buffers C+b
  • MRU C+b then C+f
  • GoInstall gi

And more please check vimrc

Golint

Install golint

Modify vimrc " golint

" set rtp+=/path/to/your/golint
" autocmd BufWritePost,FileWritePost *.go execute 'Lint' | cwindow

to

set rtp+=/path/to/your/golin
autocmd BufWritePost,FileWritePost *.go execute 'Lint' | cwindow

Align JSON tag

Install formattag

Modify vimrc " pretty tag

" set rtp+=/path/to/your/formattag
" autocmd BufWritePost,FileWritePost *.go execute 'PrettyTag' | checktime

to

set rtp+=/path/to/your/formattag
autocmd BufWritePost,FileWritePost *.go execute 'PrettyTag' | checktime

Dependencies

About

Golang vim Configuration

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published