I just love working in Vim and cannot even think of switching to a new editor. If you are also a Vim lover and you use Golang, you must read this post to make sure you have the right setup.
Here is how my vim looks like and yes the look is very simple though powerful.
Following are the most important features which I prefer to have:
Run gofmt and goimports on save
Peek at documentation
Autocomplete
Jump to symbols or functions definitions
Automatic variable type and function signature info
Pretty and lightweight status bar at bottom
Version control information
In order to have all these features integrated in Vim, I used the following plugins:
After installing all the plugins, here is how you can configure ~/.vimrc file:
syntax on
colo pablo
set encoding=utf-8
set fileencoding=utf-8
set number
set shiftwidth=2
" settings specific to Go file types
autocmd Filetype go setlocal tabstop=4 shiftwidth=4 softtabstop=4
filetype plugin indent on
set backspace=indent,eol,start
" vim-go commands
let g:go_fmt_command = "goimports"
let g:go_auto_type_info = 1
let g:go_highlight_functions = 1
let g:go_highlight_methods = 1
let g:go_highlight_fields = 1
let g:go_highlight_types = 1
let g:go_highlight_operators = 1
let g:go_highlight_build_constraints = 1
I hope you have enjoyed this post and it will be helpful for you to setup your Vim. Please like and share and feel free to comment if you have any suggestions or feedback.
In this article we will learn about reverse proxy, where to use it and how to implement it in Golang. A reverse proxy is a server that sits in front. read more…
In this post we are going to build a simple gRPC client and server application. I was recently trying to set this up in one of my projects and was. read more…
When we’re building a web application there’s some shared functionality that we want to run for many (or even all) HTTP requests. We might want to log every request, gzip. read more…
I have just started learning Go and found it to be a very interesting language. It bridges the gap between rapid development and performance by offering high performance like C,. read more…
Privacy & Cookies: This site uses cookies. By continuing to use this website, you agree to their use.
To find out more, including how to control cookies, see here:
Cookie Policy
Anuj Verma
Share post:
I just love working in Vim and cannot even think of switching to a new editor. If you are also a Vim lover and you use Golang, you must read this post to make sure you have the right setup.
Here is how my vim looks like and yes the look is very simple though powerful.
Following are the most important features which I prefer to have:
gofmt
andgoimports
on saveIn order to have all these features integrated in Vim, I used the following plugins:
vim-go development plugin
Installation
Uninstall
Lean and Mean status bar
Install
Uninstall
An awesome Git wrapper
Install
Uninstall
After installing all the plugins, here is how you can configure
~/.vimrc
file:I hope you have enjoyed this post and it will be helpful for you to setup your Vim. Please like and share and feel free to comment if you have any suggestions or feedback.
Share this:
Like this:
Simple and Powerful ReverseProxy in Go
In this article we will learn about reverse proxy, where to use it and how to implement it in Golang. A reverse proxy is a server that sits in front. read more…
Share this:
Like this:
Continue Reading
Golang gRPC communication made easy!
In this post we are going to build a simple gRPC client and server application. I was recently trying to set this up in one of my projects and was. read more…
Share this:
Like this:
Continue Reading
Simple HTTP request logging middleware in Go
When we’re building a web application there’s some shared functionality that we want to run for many (or even all) HTTP requests. We might want to log every request, gzip. read more…
Share this:
Like this:
Continue Reading
7 amazing tips for Go developer
I have just started learning Go and found it to be a very interesting language. It bridges the gap between rapid development and performance by offering high performance like C,. read more…
Share this:
Like this:
Continue Reading