neosnippet.vim/autoload/vim_snippets.vim
2015-04-11 12:44:14 +09:00

12 lines
278 B
VimL

" For honza-snippets function.
function! vim_snippets#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