2015-01-28 12:51:16 +00:00
|
|
|
" For honza-snippets function.
|
2016-02-08 12:48:14 +00:00
|
|
|
function! vim_snippets#Filename(...) abort
|
2015-01-28 12:51:16 +00:00
|
|
|
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
|