I insert the name of my file into its skeleton when i open it with this command into my ~/.vimrc file :
function! HPPFile()
silent! 0r $HOME/.vim/templates/skeleton.hpp
%s/FileName/\=expand("%:t:r")/g
%s/FILENAME/\U\=expand("%:t:r")\E/g
endfunction
autocmd BufNewFile *.hpp call HPPFile()
the first expansion line works well %s/FileName/\=expand("%:t:r")/g : all instances of FileName get replaced by the file name
but the second expansion line doesn't works %s/FILENAME/\U\=expand("%:t:r")\E/g -> it seems i cannot use both the uppercase substitution and the expand action
I've tried some variations but without chance, how could i do that ?