eventmap SH {
    abbrev 'ifx' {
        KillWordPrev; InsertString 'if [  ]'; LineIndent; LineNew; 
        InsertString 'then'; LineIndent; LineNew; 
        InsertString 'fi'; LineIndent; 
        2:MoveUp; MoveLineEnd; 2:MoveLeft; 
        Fail; # do not insert typed character
    }
    abbrev 'fox' {
        KillWordPrev; InsertString 'for  in'; LineIndent; LineNew; 
        InsertString 'do'; LineIndent; LineNew; 
        InsertString 'done'; LineIndent; 
        2:MoveUp; MoveLineEnd; 3:MoveLeft; 
        Fail; # do not insert typed character
    }
    abbrev 'whx' { 
        KillWordPrev; InsertString 'while [  ]'; LineIndent; LineNew;
        InsertString 'do'; LineIndent; LineNew; 
        InsertString 'done'; LineIndent; 
        2:MoveUp; MoveLineEnd; 2:MoveLeft; 
        Fail;
    }
    abbrev 'cax' { 
        KillWordPrev; InsertString 'case  of'; LineIndent; LineNew;
        InsertString 'esac'; LineIndent; 
        MoveUp; MoveLineEnd; 3:MoveLeft; 
        Fail;
    }
    abbrev 'dox' {
        KillWordPrev; InsertString 'do'; LineIndent; 2:LineNew;
        InsertString 'done'; LineIndent; 
        MoveUp; LineIndent; MoveLineEnd;
        Fail;
    }
}

