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 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82
|
#
# basic Syntaxhighliting for xml documents
# based on HTML Mode
sub XML_Base {
InsertString '<?xml version="1.0" encoding="ISO-8859-1"?>";';
LineNew; MoveLineStart;
}
colorize XML {
SyntaxParser = 'SIMPLE';
color {
{ 'Normal', 'Editor_Keywords' },
{ 'Command', 'Editor_Default' },
{ 'Comment', 'Lang_Comment' },
{ 'String', 'Lang_String' },
{ 'Symbol', 'Markup_Symbol' },
{ 'Tag', 'Markup_Tag' },
{ 'Special', 'Markup_Special' },
};
keyword "Editor_Keywords" {
"DOCTYPE", "PUBLIC",
};
h_state 0 { 'Normal' }
h_trans { 5, '<', '<!--', 'Comment' }
h_trans { 1, '<', '<', 'Command' }
h_trans { 2, '<', '&', 'Symbol' }
h_state 1 { 'Command' }
h_trans { 0, '>', '>', 'Command' }
h_trans { 3, '<', '\'', 'String' }
h_trans { 4, '<', '"', 'String' }
h_wtype { -1, -1, -1, 'i', 'a-zA-Z0-9_\-' }
h_state 2 { 'Symbol' }
h_trans { 0, '>', ';', 'Symbol' }
h_trans { 0, '-S', '#a-zA-Z0-9', 'Symbol' }
h_state 3 { 'String' }
h_trans { 1, '>', '\'', 'String' }
h_state 4 { 'String' }
h_trans { 1, '>', '"', 'String' }
h_state 5 { 'Comment' }
h_trans { 6, '>', '--', 'Comment' }
h_state 6 { 'Special' }
h_trans { 5, '>', '--', 'Comment' }
h_trans { 0, '>', '>', 'Comment' }
}
mode XML: PLAIN {
FileNameRx = /\.\c{XML}|{XSL}$/;
FirstLineRx = /\<\?xml/;
HilitOn = 1;
Colorizer = "XML";
MultiLineHilit = 1;
AutoHilitParen = 1;
AutoIndent = 1;
IndentMode = 'PLAIN';
TabSize = 2;
# limit XML-Depth in function-view
#RoutineRegexp = /^ {0,6}\<.+\>/;
RoutineRegexp = /^ *\<[^\/!].*[^\/]\>/;
SaveFolds = 2; # save fold info at end of line
CommentStart = " <!--";
CommentEnd = "-->";
}
eventmap XML {
abbrev '_xml' {
KillWordPrev; InsertString '<?xml version="1.0" encoding="ISO-8859-1"?>'; LineNew; MoveLineStart;
Fail;
}
}
|