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-08-02 14:48:32 +02:00
parent 64a81818ee
commit 61a22e9f3e
39 changed files with 1372 additions and 782 deletions

View File

@ -10,13 +10,13 @@ function! go#template#create()
let l:package_name = go#tool#PackageName()
" if we can't figure out any package name(no Go files or non Go package
" files) from the directory create the template
" files) from the directory create the template
if l:package_name == -1
let l:template_file = get(g:, 'go_template_file', "hello_world.go")
let l:template_path = go#util#Join(l:root_dir, "templates", l:template_file)
exe '0r ' . l:template_path
exe '0r ' . fnameescape(l:template_path)
$delete _
else
else
let l:content = printf("package %s", l:package_name)
call append(0, l:content)
$delete _
@ -28,4 +28,15 @@ function! go#template#create()
execute cd . fnameescape(dir)
endfunction
function! go#template#ToggleAutoCreate()
if get(g:, "go_template_autocreate", 1)
let g:go_template_autocreate = 0
call go#util#EchoProgress("auto template create disabled")
return
end
let g:go_template_autocreate = 1
call go#util#EchoProgress("auto template create enabled")
endfunction
" vim: sw=2 ts=2 et