vim-templates
vim-templates copied to clipboard
How to handle the template depending on the filetype?
In files like file.blade.php the plugin ignore blade.php.template and takes it as just a php file In files with the filetype modified as (file.tsx -> typescriptreact) the same thing happens too. Trying to fix it I created a little function that reads the current filetype and executes the corresponding template
function! s:CreateNewFile(file)
call inputsave()
let l:input = input(a:file, '', 'file')
silent execute "!ad ".l:input
silent execute "e ".l:input
call inputrestore()
execute 'TemplateInit ' . &filetype
endfunction
El problema es que al crear un archivo directamente desde el shell (archivo vim) obviamente esto no funciona :(
For now I have only limited myself to blocking it with 'g: tmpl_auto initialize' but direct creation is very useful :(