Skip to content

Commit 4194449

Browse files
committed
Better configuration for Go-Vim
1 parent 9af9ba7 commit 4194449

File tree

1 file changed

+25
-0
lines changed

1 file changed

+25
-0
lines changed

.vimrc

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -458,6 +458,29 @@
458458

459459
" Plugins {
460460

461+
" GoLang {
462+
if count(g:spf13_bundle_groups, 'go')
463+
let g:go_highlight_functions = 1
464+
let g:go_highlight_methods = 1
465+
let g:go_highlight_structs = 1
466+
let g:go_highlight_operators = 1
467+
let g:go_highlight_build_constraints = 1
468+
let g:go_fmt_command = "goimports"
469+
let g:syntastic_go_checkers = ['golint', 'govet', 'errcheck']
470+
let g:syntastic_mode_map = { 'mode': 'active', 'passive_filetypes': ['go'] }
471+
au FileType go nmap <Leader>s <Plug>(go-implements)
472+
au FileType go nmap <Leader>i <Plug>(go-info)
473+
au FileType go nmap <Leader>e <Plug>(go-rename)
474+
au FileType go nmap <leader>r <Plug>(go-run)
475+
au FileType go nmap <leader>b <Plug>(go-build)
476+
au FileType go nmap <leader>t <Plug>(go-test)
477+
au FileType go nmap <Leader>gd <Plug>(go-doc)
478+
au FileType go nmap <Leader>gv <Plug>(go-doc-vertical)
479+
au FileType go nmap <leader>co <Plug>(go-coverage)
480+
endif
481+
" }
482+
483+
461484
" TextObj Sentence {
462485
if count(g:spf13_bundle_groups, 'writing')
463486
augroup textobj_sentence
@@ -1039,6 +1062,8 @@
10391062
endif
10401063
" }
10411064

1065+
1066+
10421067
" }
10431068

10441069
" GUI Settings {

0 commit comments

Comments
 (0)