1 /* neatvi configuration file */
3 /* the alternate keymap (^F and ^E in insert mode to switch) */
6 /* right-to-left characters (used only in dircontexts[] and dirmarks[]) */
7 #define CR2L "ءآأؤإئابةتثجحخدذرزسشصضطظعغـفقكلمنهوىييپچژکگی؛،»«؟ًٌٍَُِّْ"
8 /* neutral characters (used only in dircontexts[] and dirmarks[]) */
9 #define CNEUT "-!\"#$%&'()*+,./:;<=>?@^_`{|}~ "
11 /* direction context patterns; specifies the direction of a whole line */
12 static struct dircontext
{
17 {+1, "^[a-zA-Z_0-9]"},
20 /* direction marks; the direction of a few words in a line */
21 static struct dirmark
{
22 int ctx
; /* the direction context for this mark; 0 means any */
23 int dir
; /* the direction of the matched text */
24 int grp
; /* the nested subgroup; 0 means no groups */
27 {+0, +1, 1, "\\\\\\*\\[([^]]+)\\]"},
28 {+1, -1, 0, "[" CR2L
"][" CNEUT CR2L
"]*[" CR2L
"]"},
29 {-1, +1, 0, "[a-zA-Z0-9_][^" CR2L
"\\\\`$']*[a-zA-Z0-9_]"},
30 {+0, +1, 0, "$([^$]+)\\$"},
31 {+0, +1, 1, "\\\\[a-zA-Z0-9_]+\\{([^}]+)\\}"},
32 {-1, +1, 0, "\\\\[^ \t" CR2L
"]+"},
35 /* character placeholders */
36 static struct placeholder
{
37 char *s
; /* the source character */
38 char *d
; /* the placeholder */
39 int wid
; /* the width of the placeholder */
53 /* map file names to file types */
54 static struct filetype
{
55 char *ft
; /* file type */
56 char *pat
; /* file name pattern */
59 {"tr", "\\.(ms|tr|roff)$"},
62 /* syntax highlighting patterns */
63 static struct highlight
{
64 char *ft
; /* the filetype of this pattern */
65 int att
; /* attributes of the matched region */
66 int grp
; /* regular expression subgroup to highlight */
67 char *pat
; /* regular expression */
69 {"c", 5, 0, "\\<(signed|unsigned|char|short|int|long|float|double|void|struct|enum|union|typedef)\\>"},
70 {"c", 5, 0, "\\<(static|extern|register)\\>"},
71 {"c", 5, 0, "\\<(return|for|while|if|else|do|sizeof|goto|switch|case|default|break|continue)\\>"},
72 {"c", 2 | SYN_IT
, 0, "//.*$"},
73 {"c", 2 | SYN_IT
, 0, "/\\*([^*]|\\*[^/])*\\*/"},
74 {"c", 6, 0, "^#[ \t]*[a-zA-Z0-9_]+"},
75 {"c", SYN_BD
, 1, "([a-zA-Z][a-zA-Z0-9_]+)\\("},
76 {"c", 4, 0, "\"([^\"]|\\\\\")*\""},
77 {"c", 4, 0, "'([^\\]|\\\\.)'"},
79 {"tr", SYN_BD
, 0, "^\\.SH.*$"},
80 {"tr", 4, 0, "^\\.[a-zA-Z0-9]{2}.*$"},