Skip to content

Commit

Permalink
Add golang configuration samples
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
calebhearth committed Jan 8, 2016
1 parent aca2d1f commit fe31b39
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
6 changes: 6 additions & 0 deletions vim/ftplugin/go.vim
@@ -0,0 +1,6 @@
let g:go_fmt_command = "goimports"

setlocal softtabstop=2
setlocal listchars=tab:\ \ ,trail:·,nbsp:·

compiler go
3 changes: 2 additions & 1 deletion vimrc.bundles
Expand Up @@ -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'
Expand Down

0 comments on commit fe31b39

Please sign in to comment.