" ======================================================================== " Programming in C " ======================================================================== " " Ysbl insert statement block ab Ysbl {o}O " " Ydef insert "#define" at start of line ab Ydef 0i#define " " Yinc insert "#include" at start of line ab Yinc 0i#include " " Yelse insert else clause of if statement with following if statement ab Yelif else if () {o}k$2hi " " Yelse insert else clause of if statement ab Yelse else {o}O " " Yfor insert "for" statement ab Yfor for (;;) {o}kwa " " Yif insert "if" statement ab Yif if () {o}k$2hi " " Ywhile insert "while" statement ab Ywhile while () do {o}k$5hi " " Ymain insert "main" routine ab Ymain main (argc,argv) oint argc;ochar *argv;o{o}O " " insert brackets for statement list map o{o}O " " Insert mode: Typing an opening curly bracket will insert a pair of " curly brackets and move the cursor before the closing curly bracket: ":inoremap { {}i " Insert mode: Typing a closing curly bracket will jump after the next closing " curly bracket (this assumes that curly brackets are always inserted as a pair.) ":inoremap } /}/e+1i