73 lines
1.3 KiB
VimL
73 lines
1.3 KiB
VimL
XPTemplate priority=like
|
|
|
|
XPTvar $TRUE 1
|
|
XPTvar $FALSE 0
|
|
XPTvar $NULL NULL
|
|
|
|
|
|
" if () ** {
|
|
XPTvar $BRif ' '
|
|
|
|
" } ** else {
|
|
XPTvar $BRel \n
|
|
|
|
|
|
|
|
" int fun( ** arg ** )
|
|
" if ( ** condition ** )
|
|
XPTvar $SParg ''
|
|
|
|
" if ** (
|
|
XPTvar $SPcmd ' '
|
|
|
|
" a = a ** + ** 1
|
|
XPTvar $SPop ' '
|
|
|
|
XPTvar $VOID_LINE /* void */;
|
|
XPTvar $CURSOR_PH /* cursor */
|
|
|
|
XPT _if hidden
|
|
if`$SPcmd^(`$SParg^`condition^`$SParg^)`$BRif^{
|
|
`cursor^
|
|
}
|
|
|
|
XPT if wrap " if ( .. ) { .. }
|
|
`Include:_if^
|
|
|
|
XPT elif wrap " else if ( .. ) { .. }
|
|
else `Include:_if^
|
|
|
|
XPT else wrap " else { ... }
|
|
else`$BRif^{
|
|
`cursor^
|
|
}
|
|
|
|
XPT ifn alias=if " if (.. == $NULL) {..} else...
|
|
XSET condition=Embed('`a^`$SPop^==`$SPop^`$NULL^')
|
|
|
|
XPT ifnn alias=if " if (.. != $NULL) {..} else...
|
|
XSET condition=Embed('`a^`$SPop^!=`$SPop^`$NULL^')
|
|
|
|
XPT if0 alias=if " if (.. == 0) {..} else...
|
|
XSET condition=Embed('`a^`$SPop^==`$SPop^0')
|
|
|
|
XPT ifn0 alias=if " if (.. != 0) {..} else...
|
|
XSET condition=Embed('`a^`$SPop^!=`$SPop^0')
|
|
|
|
XPT ifee " if (..) {..} else if...
|
|
`:_if:^` `else_if...{{^`$BRel^`Include:elif^` `else_if...^`}}^
|
|
|
|
XPT switch wrap " switch (..) {case..}
|
|
switch (`$SParg^`var^`$SParg^)`$BRif^{
|
|
`Include:case^
|
|
}
|
|
..XPT
|
|
|
|
XPT case wrap " case ..:
|
|
case `constant^:
|
|
`cursor^
|
|
break;
|
|
|
|
XPT default " default ..:
|
|
default:
|
|
`cursor^
|