home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 5 Edit / 05-Edit.zip / fte0827.zip / config / ab_c.fte < prev    next >
Text File  |  1999-05-16  |  1KB  |  43 lines

  1. # c language templates
  2.  
  3. eventmap C {
  4.     # these work well for default indentation settings
  5.     # changes may be necessary if you use different indentation
  6.     
  7.     # typical usage would be typing ifx and <space>.
  8.     # useful command here is <A+Enter> which adds 
  9.     # a new line after the current one, and indents it properly.
  10.     # in cmode defined as LineAdd; LineIndent;
  11.     abbrev 'ifx' {
  12.         KillWordPrev; InsertString 'if () {'; LineIndent; LineNew; 
  13.         InsertString '}'; LineIndent; 
  14.         MoveUp; MoveLineEnd; 3:MoveLeft; 
  15.         Fail; # do not insert typed character
  16.     }
  17.     abbrev 'whx' { 
  18.         KillWordPrev; InsertString 'while () {'; LineIndent; LineNew;
  19.         InsertString '}'; LineIndent; 
  20.         MoveUp; MoveLineEnd; 3:MoveLeft;
  21.         Fail;
  22.     }
  23.     abbrev 'swx' { 
  24.         KillWordPrev; InsertString 'switch () {'; LineIndent; LineNew;
  25.         InsertString '}'; LineIndent; 
  26.         MoveUp; MoveLineEnd; 3:MoveLeft; 
  27.         Fail;
  28.     }
  29.     abbrev 'cax' {
  30.         KillWordPrev; InsertString 'case :'; LineIndent; LineNew;
  31.         InsertString 'break;'; LineIndent;
  32.         MoveUp; MoveLineEnd; MovePrev;
  33.         Fail;
  34.     }
  35.     abbrev 'dex' {
  36.         KillWordPrev; InsertString 'default:'; LineIndent; 2:LineNew;
  37.         InsertString 'break;'; LineIndent;
  38.         MoveUp; LineIndent;
  39.         Fail;
  40.     }
  41. }
  42.  
  43.