mirror of
https://github.com/mattn/emmet-vim.git
synced 2025-12-09 03:54:47 +08:00
next/prev
This commit is contained in:
@@ -77,14 +77,18 @@ endif
|
|||||||
inoremap <plug>ZenCodingExpandAbbr <c-g>u<esc>:call <sid>zen_expand(0)<cr>a
|
inoremap <plug>ZenCodingExpandAbbr <c-g>u<esc>:call <sid>zen_expand(0)<cr>a
|
||||||
inoremap <plug>ZenCodingExpandWord <c-g>u<esc>:call <sid>zen_expand(1)<cr>a
|
inoremap <plug>ZenCodingExpandWord <c-g>u<esc>:call <sid>zen_expand(1)<cr>a
|
||||||
vnoremap <plug>ZenCodingExpandVisual :call <sid>zen_expand(2)<cr>
|
vnoremap <plug>ZenCodingExpandVisual :call <sid>zen_expand(2)<cr>
|
||||||
|
inoremap <plug>ZenCodingNext <esc>:call <sid>zen_nextprev(0)<cr>
|
||||||
|
inoremap <plug>ZenCodingPrev <esc>:call <sid>zen_nextprev(1)<cr>
|
||||||
|
|
||||||
let s:target = expand('<sfile>:h') =~ '[\\/]plugin$' ? '' : '<buffer>'
|
let s:target = expand('<sfile>:h') =~ '[\\/]plugin$' ? '' : '<buffer>'
|
||||||
|
|
||||||
if !exists('g:user_zen_expandword_key')
|
if !exists('g:user_zen_expandword_key')
|
||||||
let g:user_zen_expandword_key = '<c-z>.'
|
let g:user_zen_expandword_key = '<c-z>.'
|
||||||
endif
|
endif
|
||||||
if !hasmapto(g:user_zen_expandword_key, 'i')
|
if !hasmapto(g:user_zen_expandword_key, 'i')
|
||||||
exe "imap " . s:target . " " . g:user_zen_expandword_key . " <plug>ZenCodingExpandWord"
|
exe "imap " . s:target . " " . g:user_zen_expandword_key . " <plug>ZenCodingExpandWord"
|
||||||
endif
|
endif
|
||||||
|
|
||||||
if !exists('g:user_zen_expandabbr_key')
|
if !exists('g:user_zen_expandabbr_key')
|
||||||
let g:user_zen_expandabbr_key = '<c-z>,'
|
let g:user_zen_expandabbr_key = '<c-z>,'
|
||||||
endif
|
endif
|
||||||
@@ -95,6 +99,19 @@ if !hasmapto(g:user_zen_expandabbr_key, 'v')
|
|||||||
exe "vmap " . s:target . " " . g:user_zen_expandabbr_key . " <plug>ZenCodingExpandVisual"
|
exe "vmap " . s:target . " " . g:user_zen_expandabbr_key . " <plug>ZenCodingExpandVisual"
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
if !exists('g:user_zen_next_key')
|
||||||
|
let g:user_zen_next_key = '<c-z>n'
|
||||||
|
endif
|
||||||
|
if !hasmapto(g:user_zen_next_key, 'i')
|
||||||
|
exe "imap " . s:target . " " . g:user_zen_next_key . " <plug>ZenCodingNext"
|
||||||
|
endif
|
||||||
|
if !exists('g:user_zen_prev_key')
|
||||||
|
let g:user_zen_prev_key = '<c-z>N'
|
||||||
|
endif
|
||||||
|
if !hasmapto(g:user_zen_prev_key, 'i')
|
||||||
|
exe "imap " . s:target . " " . g:user_zen_prev_key . " <plug>ZenCodingPrev"
|
||||||
|
endif
|
||||||
|
|
||||||
if exists('s:zen_settings') && g:zencoding_debug == 0
|
if exists('s:zen_settings') && g:zencoding_debug == 0
|
||||||
finish
|
finish
|
||||||
endif
|
endif
|
||||||
@@ -1171,6 +1188,15 @@ function! s:zen_expand(mode) range
|
|||||||
endif
|
endif
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
|
function! s:zen_nextprev(flag)
|
||||||
|
if search('><\/\|\(""\)\|^\s*$', a:flag ? 'Wpb' : 'Wp') == 3
|
||||||
|
startinsert!
|
||||||
|
else
|
||||||
|
silent! normal! l
|
||||||
|
startinsert
|
||||||
|
endif
|
||||||
|
endfunction
|
||||||
|
|
||||||
function! ZenExpand(abbr, type, orig)
|
function! ZenExpand(abbr, type, orig)
|
||||||
let items = s:zen_parseIntoTree(a:abbr, a:type).child
|
let items = s:zen_parseIntoTree(a:abbr, a:type).child
|
||||||
let expand = ''
|
let expand = ''
|
||||||
|
|||||||
Reference in New Issue
Block a user