mirror of
https://github.com/mattn/emmet-vim.git
synced 2025-12-07 19:24:27 +08:00
install mapping to global.
This commit is contained in:
@@ -1,7 +1,7 @@
|
|||||||
"=============================================================================
|
"=============================================================================
|
||||||
" File: zencoding.vim
|
" File: zencoding.vim
|
||||||
" Author: Yasuhiro Matsumoto <mattn.jp@gmail.com>
|
" Author: Yasuhiro Matsumoto <mattn.jp@gmail.com>
|
||||||
" Last Change: 05-Nov-2010.
|
" Last Change: 10-Nov-2010.
|
||||||
" Version: 0.47
|
" Version: 0.47
|
||||||
" WebPage: http://github.com/mattn/zencoding-vim
|
" WebPage: http://github.com/mattn/zencoding-vim
|
||||||
" Description: vim plugins for HTML and CSS hi-speed coding.
|
" Description: vim plugins for HTML and CSS hi-speed coding.
|
||||||
@@ -87,7 +87,6 @@ if !exists('g:user_zen_leader_key')
|
|||||||
endif
|
endif
|
||||||
|
|
||||||
function! s:install_plugin()
|
function! s:install_plugin()
|
||||||
let target = expand('<sfile>:h') =~ '[\\/]plugin$' ? '' : '<buffer>'
|
|
||||||
for item in [
|
for item in [
|
||||||
\ {'mode': 'i', 'var': 'user_zen_expandabbr_key', 'key': ',', 'plug': 'ZenCodingExpandAbbr', 'func': '<c-g>u<esc>:call zencoding#expandAbbr(0)<cr>a'},
|
\ {'mode': 'i', 'var': 'user_zen_expandabbr_key', 'key': ',', 'plug': 'ZenCodingExpandAbbr', 'func': '<c-g>u<esc>:call zencoding#expandAbbr(0)<cr>a'},
|
||||||
\ {'mode': 'v', 'var': 'user_zen_expandabbr_key', 'key': ',', 'plug': 'ZenCodingExpandVisual', 'func': ':call zencoding#expandAbbr(2)<cr>'},
|
\ {'mode': 'v', 'var': 'user_zen_expandabbr_key', 'key': ',', 'plug': 'ZenCodingExpandVisual', 'func': ':call zencoding#expandAbbr(2)<cr>'},
|
||||||
@@ -125,11 +124,12 @@ function! s:install_plugin()
|
|||||||
exe 'let g:' . item.var . " = '" . g:user_zen_leader_key . item.key . "'"
|
exe 'let g:' . item.var . " = '" . g:user_zen_leader_key . item.key . "'"
|
||||||
endif
|
endif
|
||||||
if len(maparg(eval('g:' . item.var), item.mode)) == 0
|
if len(maparg(eval('g:' . item.var), item.mode)) == 0
|
||||||
exe item.mode . 'map ' . target . ' ' . eval('g:' . item.var) . ' <plug>' . item.plug
|
exe item.mode . 'map <unique> ' . eval('g:' . item.var) . ' <plug>' . item.plug
|
||||||
endif
|
endif
|
||||||
endfor
|
endfor
|
||||||
endfunction
|
endfunction
|
||||||
call s:install_plugin()
|
call s:install_plugin()
|
||||||
|
delfunction s:install_plugin
|
||||||
|
|
||||||
let &cpo = s:save_cpo
|
let &cpo = s:save_cpo
|
||||||
unlet s:save_cpo
|
unlet s:save_cpo
|
||||||
|
|||||||
Reference in New Issue
Block a user