Fix: don't ignore g:user_emmet_complete_tag

"plugin/*.vim" files sourced at vim startup.
At vim startup no buffers exists,
so ":setlocal" command do nothing.
Move ":setlocal" command to  s:install_plugin() function.
This commit is contained in:
Cade-Forester
2015-02-26 18:31:08 +05:00
parent b5a94de150
commit ab5d0f026c

View File

@@ -90,10 +90,6 @@ if !exists('g:emmet_curl_command')
let g:emmet_curl_command = 'curl -s -L -A Mozilla/5.0'
endif
if exists('g:user_emmet_complete_tag') && g:user_emmet_complete_tag
setlocal omnifunc=emmet#completeTag
endif
if !exists('g:user_emmet_leader_key')
let g:user_emmet_leader_key = '<c-y>'
endif
@@ -148,6 +144,14 @@ function! s:install_plugin(mode, buffer)
exe item.mode . 'map ' . buffer . ' <unique> ' . key . ' <plug>(' . item.plug . ')'
endif
endfor
if exists('g:user_emmet_complete_tag') && g:user_emmet_complete_tag
if get(g:, 'user_emmet_install_global', 1)
set omnifunc=emmet#completeTag
else
setlocal omnifunc=emmet#completeTag
endif
endif
endfunction
command! -nargs=0 -bar EmmetInstall call <SID>install_plugin(get(g:, 'user_emmet_mode', 'a'), 1)