mirror of
https://github.com/amix/vimrc
synced 2025-06-16 01:25:00 +08:00
Updated plugins
This commit is contained in:
@ -7,7 +7,7 @@ let s:c = g:snipMate
|
||||
try
|
||||
call tlib#input#List('mi', '', [])
|
||||
catch /.*/
|
||||
echoe "you're missing tlib. See install instructions at ".expand('<sfile>:h:h').'/README.rst'
|
||||
echoe "you're missing tlib. See install instructions at ".expand('<sfile>:h:h').'/README.md'
|
||||
endtry
|
||||
|
||||
" match $ which doesn't follow a \
|
||||
@ -121,8 +121,9 @@ endfunction
|
||||
fun! s:ProcessSnippet(snip)
|
||||
let snippet = a:snip
|
||||
|
||||
if exists('g:snipmate_content_visual')
|
||||
let visual = g:snipmate_content_visual | unlet g:snipmate_content_visual
|
||||
if exists('b:snipmate_content_visual')
|
||||
let visual = b:snipmate_content_visual
|
||||
unlet b:snipmate_content_visual
|
||||
else
|
||||
let visual = ''
|
||||
endif
|
||||
@ -167,6 +168,18 @@ fun! s:ProcessSnippet(snip)
|
||||
let i += 1
|
||||
endw
|
||||
|
||||
" Add ${0} tab stop if found
|
||||
if snippet =~ s:d . '{0'
|
||||
let snippet = substitute(snippet, s:d.'{0', '${'.i, '')
|
||||
let s = matchstr(snippet, s:d.'{'.i.':\zs.\{-}\ze}')
|
||||
if s != ''
|
||||
let snippet = substitute(snippet, s:d.'0', '$'.i, 'g')
|
||||
let snippet = substitute(snippet, s:d.i, s.'&', 'g')
|
||||
endif
|
||||
else
|
||||
let snippet .= '${'.i.'}'
|
||||
endif
|
||||
|
||||
if &et " Expand tabs to spaces if 'expandtab' is set.
|
||||
return substitute(snippet, '\t', repeat(' ', &sts ? &sts : &sw), 'g')
|
||||
endif
|
||||
|
Reference in New Issue
Block a user