From 84503ff3cd902d4112e28b6435198196c7fb7f03 Mon Sep 17 00:00:00 2001 From: Pierre Massat Date: Sat, 7 Jan 2017 10:38:51 -0800 Subject: [PATCH] Add support for Go with defaults --- autoload/SpaceVim/plugins.vim | 1 + config/plugins/vim-go.vim | 18 ++++++++++++++++++ 2 files changed, 19 insertions(+) create mode 100644 config/plugins/vim-go.vim diff --git a/autoload/SpaceVim/plugins.vim b/autoload/SpaceVim/plugins.vim index 66b38d12e..f9d192fbd 100644 --- a/autoload/SpaceVim/plugins.vim +++ b/autoload/SpaceVim/plugins.vim @@ -191,6 +191,7 @@ let s:plugins.lang = [ \ ['isundil/vim-irssi-syntax', { 'on_ft' : 'irssi'}], \ ['lervag/vimtex', { 'on_ft' : 'tex'}], \ ['vimperator/vimperator.vim', { 'on_ft' : 'vimperator'}], + \ ['fatih/vim-go', { 'on_ft' : 'go'}], \ ] if g:spacevim_enable_javacomplete2_py call add(s:plugins.lang , ['wsdjeg/vim-javacomplete2', { 'on_ft' : ['java','jsp'], 'loadconf' : 1}]) diff --git a/config/plugins/vim-go.vim b/config/plugins/vim-go.vim new file mode 100644 index 000000000..25fff8d4a --- /dev/null +++ b/config/plugins/vim-go.vim @@ -0,0 +1,18 @@ +scriptencoding utf-8 +let g:go_highlight_functions = 1 +let g:go_highlight_methods = 1 +let g:go_highlight_structs = 1 +let g:go_highlight_operators = 1 +let g:go_highlight_build_constraints = 1 +let g:go_fmt_command = "goimports" +let g:syntastic_go_checkers = ['golint', 'govet', 'errcheck'] +let g:syntastic_mode_map = { 'mode': 'active', 'passive_filetypes': ['go'] } +au FileType go nmap s (go-implements) +au FileType go nmap i (go-info) +au FileType go nmap e (go-rename) +au FileType go nmap r (go-run) +au FileType go nmap b (go-build) +au FileType go nmap t (go-test) +au FileType go nmap gd (go-doc) +au FileType go nmap gv (go-doc-vertical) +au FileType go nmap co (go-coverage)