mirror of
https://github.com/amix/vimrc
synced 2025-06-16 09:35:01 +08:00
Updated plugins
This commit is contained in:
@ -9,9 +9,7 @@ if exists("b:did_ftplugin")
|
||||
endif
|
||||
let b:did_ftplugin = 1
|
||||
|
||||
if !exists("g:go_auto_type_info")
|
||||
let g:go_auto_type_info = 0
|
||||
endif
|
||||
let b:undo_ftplugin = "setl fo< com< cms<"
|
||||
|
||||
setlocal formatoptions-=t
|
||||
|
||||
@ -22,42 +20,27 @@ setlocal noexpandtab
|
||||
|
||||
compiler go
|
||||
|
||||
if !exists("g:go_doc_keywordprg_enabled")
|
||||
let g:go_doc_keywordprg_enabled = 1
|
||||
endif
|
||||
if g:go_doc_keywordprg_enabled
|
||||
" keywordprg doesn't allow to use vim commands, override it
|
||||
nnoremap <buffer> <silent> K :GoDoc<cr>
|
||||
endif
|
||||
|
||||
|
||||
if !exists("g:go_def_mapping_enabled")
|
||||
let g:go_def_mapping_enabled = 1
|
||||
endif
|
||||
if g:go_def_mapping_enabled
|
||||
nnoremap <buffer> <silent> gd :GoDef<cr>
|
||||
endif
|
||||
|
||||
|
||||
let b:undo_ftplugin = "setl fo< com< cms<"
|
||||
|
||||
" Set gocode completion
|
||||
setlocal omnifunc=go#complete#Complete
|
||||
|
||||
" GoInfo automatic update
|
||||
if g:go_auto_type_info != 0
|
||||
setlocal updatetime=300
|
||||
au! CursorHold *.go nested call go#complete#Info()
|
||||
if get(g:, "go_doc_keywordprg_enabled", 1)
|
||||
" keywordprg doesn't allow to use vim commands, override it
|
||||
nnoremap <buffer> <silent> K :GoDoc<cr>
|
||||
endif
|
||||
|
||||
|
||||
" autoload settings
|
||||
if !exists('g:go_fmt_autosave')
|
||||
let g:go_fmt_autosave = 1
|
||||
if get(g:, "go_def_mapping_enabled", 1)
|
||||
nnoremap <buffer> <silent> gd :GoDef<cr>
|
||||
endif
|
||||
|
||||
if g:go_fmt_autosave
|
||||
autocmd BufWritePre <buffer> call go#fmt#Format(-1)
|
||||
if get(g:, "go_textobj_enabled", 1)
|
||||
onoremap <buffer> af :<c-u>call go#textobj#Function('a')<cr>
|
||||
xnoremap <buffer> af :<c-u>call go#textobj#Function('a')<cr>
|
||||
onoremap <buffer> if :<c-u>call go#textobj#Function('i')<cr>
|
||||
xnoremap <buffer> if :<c-u>call go#textobj#Function('i')<cr>
|
||||
endif
|
||||
|
||||
if get(g:, "go_auto_type_info", 0)
|
||||
setlocal updatetime=800
|
||||
endif
|
||||
|
||||
" vim:ts=4:sw=4:et
|
||||
|
Reference in New Issue
Block a user