I am trying to create some keybind "scripts" for specified file types in my .vimrc. Example :
au BufNewFile,BufRead *.cpp \ nnoremap <C-P> :!g++ % -o %.exe <CR>
Ideally I would like to name output file type just the name of the file without any extension. Example :
filename : test.cpp
output of compilation : test
Another example - I am working with assembly and compiling test.asm will produce among some others test.hex which I would love to use in another keybind as an argument passed to an emulator. Is this achieveable in .vimrc?