mirror of
https://github.com/amix/vimrc
synced 2025-06-16 09:35:01 +08:00
Updated plugins
This commit is contained in:
@ -1,7 +1,7 @@
|
||||
let s:current_file = expand("<sfile>")
|
||||
|
||||
function! go#template#create() abort
|
||||
let l:go_template_use_pkg = get(g:, 'go_template_use_pkg', 0)
|
||||
let l:go_template_use_pkg = go#config#TemplateUsePkg()
|
||||
let l:root_dir = fnamemodify(s:current_file, ':h:h:h')
|
||||
|
||||
let cd = exists('*haslocaldir') && haslocaldir() ? 'lcd ' : 'cd '
|
||||
@ -19,9 +19,9 @@ function! go#template#create() abort
|
||||
if l:package_name == -1 && l:go_template_use_pkg != 1
|
||||
let l:filename = fnamemodify(expand("%"), ':t')
|
||||
if l:filename =~ "_test.go$"
|
||||
let l:template_file = get(g:, 'go_template_test_file', "hello_world_test.go")
|
||||
let l:template_file = go#config#TemplateTestFile()
|
||||
else
|
||||
let l:template_file = get(g:, 'go_template_file', "hello_world.go")
|
||||
let l:template_file = go#config#TemplateFile()
|
||||
endif
|
||||
let l:template_path = go#util#Join(l:root_dir, "templates", l:template_file)
|
||||
silent exe 'keepalt 0r ' . fnameescape(l:template_path)
|
||||
@ -40,13 +40,13 @@ function! go#template#create() abort
|
||||
endfunction
|
||||
|
||||
function! go#template#ToggleAutoCreate() abort
|
||||
if get(g:, "go_template_autocreate", 1)
|
||||
let g:go_template_autocreate = 0
|
||||
if go#config#TemplateAutocreate()
|
||||
call go#config#SetTemplateAutocreate(0)
|
||||
call go#util#EchoProgress("auto template create disabled")
|
||||
return
|
||||
end
|
||||
|
||||
let g:go_template_autocreate = 1
|
||||
call go#config#SetTemplateAutocreate(1)
|
||||
call go#util#EchoProgress("auto template create enabled")
|
||||
endfunction
|
||||
|
||||
|
Reference in New Issue
Block a user