Pauli's software -> Vedit resources -> C Tools -> C123.VTM keywords

C123.VTM Keywords

Here is the list of keywords expanded by the C123.VTM template editing macro. Indent style "1" is used in these examples. The keywords are expanded when you type a space after typing the text in the left column (except for ';' in for statement, which is expanded immediatelly). Cursor position is indicated as '_'.

when you type... it expands to...
if _ if (_) {

}
ife _ if (_) {

} else {

}
if( _ if (_)
do _ do {

} while (_);
while _ while (_) {

}
for _ for (_) {

}
;_
(inside for statement)
for (v=a; v<_; v++) {

}
switch _ switch (_) {
  case :

    break;
  case :

    break;
  default :

}
case _   case _:

    break;
printf _ printf("_");
cprintf _ cprintf("_");
sprintf _ sprintf(_, "", );
#de _ #define
#in _ #include <_>
#inc _ #include "_"

The three indenting styles

One of three indenting styles can be selected (option "C Macro setup" -> "Indent" in the C-User menu):

style option example
1 ('{' at same line) if (x>1) {
  foo();
}
2 ('{' at next line) if (x>1)
{
  foo();
}
3 ('{' at next line,
 indented)
if (x>1)
  {
  foo();
  }

In addition, you can select if spaces are added between the keyword and opening parentheses, inside the parentheses, both, or neither. The examples above has the first option enabled.