Add golang configuration samples

Add suggested Go configuration for Vim into the `ftplugin` folder and
the vim-go plugin. We may use this as a template for adding further
language-specific settings in the future for languages that aren't
universally used by the team.

* `fatih/vim-go`: The de-facto Golang Vim plugin.
* `softtabstop=2`: As a side effect of setting how "large" a tab is in
  insert mode, Vim is able to delete tabs with the backspace key in
  Insert mode.
* `compiler go`: Necessary for plugins using the `make` command, such as
  vim-dispatch.
* `listchars=tab:\ \ `: Don't highlight tabs as "»·" as if they were
  problem characters in go files. Also recommended for *sh files and any
  others which which should also be using tabs.
* `go_fmt_command = "goimports"`: Tell vim-go to use the `goimports`
  command rather than `gofmt`, which attempts to find dependencies and
  adds them to your import statement.
This commit is contained in:
Caleb Thompson 2015-11-13 09:29:46 -06:00
parent aca2d1fb29
commit fe31b3943b
No known key found for this signature in database
GPG key ID: 1621ADC2A0ACE70A
2 changed files with 8 additions and 1 deletions

6
vim/ftplugin/go.vim Normal file
View file

@ -0,0 +1,6 @@
let g:go_fmt_command = "goimports"
setlocal softtabstop=2
setlocal listchars=tab:\ \ ,trail,nbsp
compiler go

View file

@ -28,8 +28,9 @@ call plug#begin('~/.vim/bundle')
" Define bundles via Github repos
Plug 'christoomey/vim-run-interactive'
Plug 'kchmck/vim-coffee-script'
Plug 'ctrlpvim/ctrlp.vim'
Plug 'fatih/vim-go'
Plug 'kchmck/vim-coffee-script'
Plug 'pbrisbin/vim-mkdir'
Plug 'scrooloose/syntastic'
Plug 'slim-template/vim-slim'