Can anyone suggest to me how to setup Gvim for competitive coding in C++? How to compile with the flags on pressing function keys?
Here is my vimrc
set autoindent
filetype plugin indent on
let mapleader = “,”
nmap c ggVG"+y’’
nnoremap r :w:! printf “your output is\n*********\n” && g++ -o test %:r.cpp && ./test && printf “**********\n”
nnoremap f :w:! printf “your output from file is\n*************\n” && g++ -o test %:r.cpp && ./test < input.txt && printf “*************\n”
By pressing ,c ( , ==> leader key) ==> whole code will be copied to clipboard
By pressing ,r ==> compile and run
By pressing ,f ==> compile and run with taking input from my local txt file input.txt
1 Like
just copy these commands in your .vimrc file
Okay