File: ab_c.fte

package info (click to toggle)
fte 0.46b5-4.2
  • links: PTS
  • area: main
  • in suites: slink
  • size: 2,844 kB
  • ctags: 5,183
  • sloc: cpp: 39,445; ansic: 2,415; perl: 567; makefile: 71; sh: 30
file content (42 lines) | stat: -rw-r--r-- 1,349 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
# c language templates

eventmap C {
    # these work well for default indentation settings
    # changes may be necessary if you use different indentation
    
    # typical usage would be typing ifx and <space>.
    # useful command here is <A+Enter> which adds 
    # a new line after the current one, and indents it properly.
    # in cmode defined as LineAdd; LineIndent;
    abbrev 'ifx' {
        KillWordPrev; InsertString 'if () {'; LineIndent; LineNew; 
        InsertString '}'; LineIndent; 
        MoveUp; MoveLineEnd; 3:MoveLeft; 
        Fail; # do not insert typed character
    }
    abbrev 'whx' { 
        KillWordPrev; InsertString 'while () {'; LineIndent; LineNew;
        InsertString '}'; LineIndent; 
        MoveUp; MoveLineEnd; 3:MoveLeft;
        Fail;
    }
    abbrev 'swx' { 
        KillWordPrev; InsertString 'switch () {'; LineIndent; LineNew;
        InsertString '}'; LineIndent; 
        MoveUp; MoveLineEnd; 3:MoveLeft; 
        Fail;
    }
    abbrev 'cax' {
        KillWordPrev; InsertString 'case :'; LineIndent; LineNew;
        InsertString 'break;'; LineIndent;
        MoveUp; MoveLineEnd; MovePrev;
        Fail;
    }
    abbrev 'dex' {
        KillWordPrev; InsertString 'default:'; LineIndent; 2:LineNew;
        InsertString 'break;'; LineIndent;
        MoveUp; LineIndent;
        Fail;
    }
}