This repository aims to provide a basic .vimrc
file and instructions to set up Vim as a productive environment to develop programs esp. using the Go Programming Language. It leverages the great plugin Vim-Go developed by @fatih.
It also includes additional plugins that I often use to make Vim yet more productive. Please see list below.
This material is provided for free. These plugins and configurations work for me but there's no guarantee they will work for you. Use at your own risk!! You can also use the provided .vimrc
file as a starting point and make changes according to your preferences.
The following plugins are used:
- Vim-Go : Go (golang) support for vim
- Completor: Keyboard completion support for Vim8
- Neocomplete: Keyboard completion support for Vim
- TagBar: Outline tree for Vim
- Neosnippet: Code snippets support for Vim
- vim-airline: Status line plugin with support for a variety of features
- Fugitive: Best Git wrapper plugin for Vim
- Vim-gitgutter: Enables git diff status on the gutter (side column)
- Ctrl-p: Fuzzy file finder for Vim
- Nerdcommenter: Easy code commenter plugin
- Vim-autopairs: Insert or delete brackets, parens, quotes in pair.
- Numbers: Quickly switch line numbers on/off or set relative numbers
- Surround: Quickly add/delete/change surrounding brackets, quotes, tags, etc.
- NERDTree: Filesystem tree for Vim
This repository assumes you're using either Linux or Mac OSX with Go and Git already installed.
In order to use this repository, follow the instructions to install the plugins and use the provided .vimrc
file to start. You can clone this repository and link or copy the provided .vimrc
file to your home directory.
TODO: Windows instructions
The Vim provided by Apple is the old 7.4 version and does not support features like Lua which would be required by the completion plugin. For this guide we will use Vim 8 which you can install using Homebrew. If you don't want to use Homebrew, you can always download and compile Vim from source.
Assuming Homebrew is installed, run the following command to install Vim 8:
brew update
brew install vim
Note:This command will install Vim8 but it will not overwrite the default Vim. I don't like to overwrite the default one so I add an alias to the new installed version of Vim in the .bash_profile
file, like this:
### Replacing default vim/vi
alias vim='/usr/local/bin/vim'
alias vi='/usr/local/bin/vim'