You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
40 lines
844 B
VimL
40 lines
844 B
VimL
10 years ago
|
" Copyright 2013 The Go Authors. All rights reserved.
|
||
|
" Use of this source code is governed by a BSD-style
|
||
|
" license that can be found in the LICENSE file.
|
||
|
"
|
||
|
" go.vim: Vim filetype plugin for Go.
|
||
|
|
||
|
if exists("b:did_ftplugin")
|
||
|
finish
|
||
|
endif
|
||
|
let b:did_ftplugin = 1
|
||
|
|
||
|
let b:undo_ftplugin = "setl fo< com< cms<"
|
||
|
|
||
|
setlocal formatoptions-=t
|
||
|
|
||
|
setlocal comments=s1:/*,mb:*,ex:*/,://
|
||
|
setlocal commentstring=//\ %s
|
||
|
|
||
|
setlocal noexpandtab
|
||
|
|
||
|
compiler go
|
||
|
|
||
|
" Set gocode completion
|
||
|
setlocal omnifunc=go#complete#Complete
|
||
|
|
||
|
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
|
||
|
|
||
|
if get(g:, "go_def_mapping_enabled", 1)
|
||
|
nnoremap <buffer> <silent> gd :GoDef<cr>
|
||
|
endif
|
||
|
|
||
|
if get(g:, "go_auto_type_info", 0)
|
||
|
setlocal updatetime=800
|
||
|
endif
|
||
|
|
||
|
" vim:ts=4:sw=4:et
|