in linux i used something like
autocmd FileType cpp nmap <buffer> <F5> :w<bar>!g++ -o %:r % && ./%:r<CR>
but since windows uses back slashes i thought i should try something like
autocmd FileType cpp nmap <buffer> <F5> :w<bar>!g++ -o %:r % && .\\%:r<CR>
or
autocmd FileType cpp nmap <buffer> <F5> :w<bar>!g++ -o %:r % && ./\%:r<CR>
but none of them seem to give desired results .can someone who understands vim scripts better help me figure this out . I've also tried other combinations but nothing seems to work .rather than gamble some more thought I might ask
so the solution i ended up going with, was to not put any preceding backslashes . See the idea was to run a command terminal command like
.\hellofor program called hello i assumed its the linux equivalent of./hellofor any executable. turns out ahello.exefile gets created when one compiles so the solution is just to callhello.exewith by just typinghelloin terminaltherefore my final command was with no slashes at all
autocmd FileType cpp nmap <buffer> <F5> :w<bar>!g++ -o %:r % && %:r<CR>as for a regular expression that creates the previous desired result. Thats still a mystery to me .cheers