1
0
mirror of https://github.com/amix/vimrc synced 2025-06-16 01:25:00 +08:00

Updated plugins

This commit is contained in:
amix
2016-02-20 13:13:10 +00:00
parent 795a8fb80d
commit e81e42ec4d
214 changed files with 5916 additions and 1107 deletions

View File

@ -17,6 +17,7 @@ let s:packages = [
\ "github.com/golang/lint/golint",
\ "github.com/kisielk/errcheck",
\ "github.com/jstemmer/gotags",
\ "github.com/klauspost/asmfmt/cmd/asmfmt",
\ ]
" These commands are available on any filetypes
@ -119,6 +120,23 @@ endfunction
" Autocommands
" ============================================================================
"
function! s:echo_go_info()
if !exists('v:completed_item') || empty(v:completed_item)
return
endif
let item = v:completed_item
if !has_key(item, "info")
return
endif
if empty(item.info)
return
endif
redraws! | echo "vim-go: " | echohl Function | echon item.info | echohl None
endfunction
augroup vim-go
autocmd!
@ -128,11 +146,22 @@ augroup vim-go
autocmd CursorHold *.go nested call go#complete#Info()
endif
" code formatting on save
" Echo the identifier information when completion is done. Useful to see
" the signature of a function, etc...
if exists('##CompleteDone')
autocmd CompleteDone *.go nested call s:echo_go_info()
endif
" Go code formatting on save
if get(g:, "go_fmt_autosave", 1)
autocmd BufWritePre *.go call go#fmt#Format(-1)
endif
" Go asm formatting on save
if get(g:, "go_asmfmt_autosave", 1)
autocmd BufWritePre *.s call go#asmfmt#Format()
endif
" run gometalinter on save
if get(g:, "go_metalinter_autosave", 0)
autocmd BufWritePost *.go call go#lint#Gometa(1)