Improve snipMate compatibility init

This commit is contained in:
Shougo Matsushita 2013-11-21 18:16:10 +09:00
parent 7b1f900912
commit 4f35262ae1
2 changed files with 14 additions and 14 deletions

View File

@ -771,20 +771,6 @@ function! s:skip_next_auto_completion() "{{{
let neosnippet.trigger = 0
endfunction"}}}
if g:neosnippet#enable_snipmate_compatibility
" For snipMate function.
function! Filename(...)
let filename = expand('%:t:r')
if filename == ''
return a:0 == 2 ? a:2 : ''
elseif a:0 == 0 || a:1 == ''
return filename
else
return substitute(a:1, '$1', filename, 'g')
endif
endfunction
endif
let &cpo = s:save_cpo
unlet s:save_cpo

View File

@ -113,6 +113,20 @@ function! s:initialize_others() "{{{
endif
call neosnippet#mappings#_clear_select_mode_mappings()
if g:neosnippet#enable_snipmate_compatibility "{{{
" For snipMate function.
function! Filename(...)
let filename = expand('%:t:r')
if filename == ''
return a:0 == 2 ? a:2 : ''
elseif a:0 == 0 || a:1 == ''
return filename
else
return substitute(a:1, '$1', filename, 'g')
endif
endfunction
endif"}}}
endfunction"}}}
function! s:on_insert_leave() "{{{