Gvim setup for Competitive Coding

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 :slight_smile:

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

This link will help

1 Like

I don’t know how to setup those compilation flags? Can you help with that? @codeguptaji

just copy these commands in your .vimrc file

Okay :blush: