File: ab_perl.fte

package info (click to toggle)
fte 0.50.2b6-20110708-2
  • links: PTS, VCS
  • area: main
  • in suites: buster, stretch
  • size: 3,768 kB
  • ctags: 6,761
  • sloc: cpp: 47,985; ansic: 2,795; sh: 112; makefile: 71; perl: 29
file content (47 lines) | stat: -rw-r--r-- 1,558 bytes parent folder | download | duplicates (11)
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
43
44
45
46
47
# perl language templates

eventmap PERL {
    # 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;
%if(BSD_BRACE)
        InsertString 'if ()'; MoveLeft; SavePos; MoveRight; LineIndent; LineNew;
        InsertString '{'; LineIndent; LineNew;
%endif
%if(1TBS_BRACE)
        InsertString 'if () {'; 3:MoveLeft; SavePos; 3:MoveRight; LineIndent; LineNew; 
%endif
        InsertString '}'; LineIndent; 
        MoveSavedPos; Fail; # do not insert typed character
    }
    abbrev 'whx' { 
        KillWordPrev;
%if(BSD_BRACE)
        InsertString 'while ()'; MoveLeft; SavePos; MoveRight; LineIndent; LineNew;
        InsertString '{'; LineIndent; LineNew;
%endif
%if(1TBS_BRACE)
        InsertString 'while () {'; 3:MoveLeft; SavePos; 3:MoveRight; LineIndent; LineNew; 
%endif
        InsertString '}'; LineIndent; 
        MoveSavedPos; Fail;
    }
    abbrev 'unx' { 
        KillWordPrev;
%if(BSD_BRACE)
        InsertString 'unless ()'; MoveLeft; SavePos; MoveRight; LineIndent; LineNew;
        InsertString '{'; LineIndent; LineNew;
%endif
%if(1TBS_BRACE)
        InsertString 'unless () {'; 3:MoveLeft; SavePos; 3:MoveRight; LineIndent; LineNew; 
%endif
        InsertString '}'; LineIndent; 
        MoveSavedPos; Fail;
    }
}