From 7e34eabb0e67263f4179ea5a5f177d539dee65f8 Mon Sep 17 00:00:00 2001 From: coolreader18 <33094578+coolreader18@users.noreply.github.com> Date: Thu, 25 Apr 2019 22:45:23 -0500 Subject: [PATCH 1/8] Add Elm syntax file --- runtime/syntax/elm.yaml | 38 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 runtime/syntax/elm.yaml diff --git a/runtime/syntax/elm.yaml b/runtime/syntax/elm.yaml new file mode 100644 index 00000000..db7f953b --- /dev/null +++ b/runtime/syntax/elm.yaml @@ -0,0 +1,38 @@ +filetype: elm + +detect: + filename: "\\.elm$" + +rules: + - statement: "\\b(as|alias|case|else|exposing|if|import|in|let|module|of|port|then|type|)\\b" + - statement: "(\\=|\\:|\\->)" + - type: "\\b([A-Z][A-Za-z\\d]*)\\b" + - identifier: "^([a-z][A-Za-z\\d]*)\\b" + - constant.string: + start: "\"\"\"" + end: "\"\"\"" + skip: "\\\\." + rules: + - constant.specialChar: "\\\\." + - constant.string: + start: "\"" + end: "\"" + skip: "\\\\." + rules: + - constant.specialChar: "\\\\." + - constant.string: + start: "'" + end: "'" + skip: "\\\\." + rules: + - constant.specialChar: "\\\\." + - comment: + start: "--" + end: "$" + rules: + - todo: "(TODO|XXX|FIXME):?" + - comment: + start: "\\{-" + end: "-\\}" + rules: + - todo: "(TODO|XXX|FIXME):?" From 957b3aaea74b8de5e48dd023aa80f62f04e09e4d Mon Sep 17 00:00:00 2001 From: corbuntus Date: Fri, 24 May 2019 20:12:45 +0200 Subject: [PATCH 2/8] Fix zyedidia#1330: Dlang character syntax highlighting --- runtime/syntax/d.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/runtime/syntax/d.yaml b/runtime/syntax/d.yaml index 10f69cac..db9fd695 100644 --- a/runtime/syntax/d.yaml +++ b/runtime/syntax/d.yaml @@ -27,6 +27,7 @@ rules: - constant.string: start: "'" end: "'" + skip: "\\\\." rules: - constant.specialChar: "\\\\." # Keywords From beea8d42d582acb908847871edac944d231fa5e6 Mon Sep 17 00:00:00 2001 From: Dull Bananas Date: Wed, 29 May 2019 21:17:56 -0700 Subject: [PATCH 3/8] Add detail --- runtime/help/options.md | 24 +++++++++++++----------- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a/runtime/help/options.md b/runtime/help/options.md index da502ab7..0a85d4ae 100644 --- a/runtime/help/options.md +++ b/runtime/help/options.md @@ -8,7 +8,7 @@ the config directory. Here are the options that you can set: -* `autoindent`: when creating a new line use the same indentation as the +* `autoindent`: when creating a new line, use the same indentation as the previous line. default value: `true` @@ -51,7 +51,8 @@ Here are the options that you can set: default value: `true` -* `eofnewline`: micro will automatically add a newline to the file. +* `eofnewline`: micro will automatically add a newline to the end of the file + when saving. default value: `false` @@ -67,11 +68,12 @@ Here are the options that you can set: default value: `true` * `fileformat`: this determines what kind of line endings micro will use for the - file. UNIX line endings are just `\n` (lf) whereas dos line endings are - `\r\n` (crlf). The two possible values for this option are `unix` and `dos`. - The fileformat will be automatically detected and displayed on the statusline - but this option is useful if you would like to change the line endings or if - you are starting a new file. + file. UNIX line endings are just `\n` (linefeed) whereas dos line endings are + `\r\n` (carriage return + linefeed). The two possible values for this option + are `unix` and `dos`. The fileformat will be automatically detected (when you + open an existing file) and displayed on the statusline, but this option is + useful if you would like to change the line endings or if you are starting a + new file. default value: `unix` @@ -87,7 +89,7 @@ Here are the options that you can set: * `indentchar`: sets the indentation character. - default value: ` ` + default value: ` ` (space) * `infobar`: enables the line at the bottom of the editor where messages are printed. This option is `global only`. @@ -96,8 +98,8 @@ Here are the options that you can set: * `keepautoindent`: when using autoindent, whitespace is added for you. This option determines if when you move to the next line without any insertions - the whitespace that was added should be deleted. By default the autoindent - whitespace is deleted if the line was left empty. + the whitespace that was added should be deleted to remove trailing whitespace. + By default, the autoindent whitespace is deleted if the line was left empty. default value: `false` @@ -198,7 +200,7 @@ Here are the options that you can set: default value: `false` -* `syntax`: turns syntax on or off. +* `syntax`: turns syntax highlighting on or off. default value: `true` From b2b933c6c1d6b0d9b8933b23a107f6acc25619d0 Mon Sep 17 00:00:00 2001 From: Akito13 Date: Mon, 1 Jul 2019 03:30:58 +0200 Subject: [PATCH 4/8] Additional file extensions * Added support for Nimscript files --- runtime/syntax/nim.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/runtime/syntax/nim.yaml b/runtime/syntax/nim.yaml index e766cad9..94b37ce4 100644 --- a/runtime/syntax/nim.yaml +++ b/runtime/syntax/nim.yaml @@ -1,7 +1,7 @@ filetype: nim detect: - filename: "\\.nim$" + filename: "\\.nim$|\\.nims$|nim.cfg" rules: - preproc: "[\\{\\|]\\b(atom|lit|sym|ident|call|lvalue|sideeffect|nosideeffect|param|genericparam|module|type|let|var|const|result|proc|method|iterator|converter|macro|template|field|enumfield|forvar|label|nk[a-zA-Z]+|alias|noalias)\\b[\\}\\|]" From 9bfc35656c500a3ed635f5d2b2a96c9449df8932 Mon Sep 17 00:00:00 2001 From: Jakob Nybo Nissen Date: Mon, 1 Jul 2019 12:47:16 +0200 Subject: [PATCH 5/8] Updated Julia number and string syntax highlighting --- runtime/syntax/julia.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/runtime/syntax/julia.yaml b/runtime/syntax/julia.yaml index c92a0ddf..73cbd5bf 100644 --- a/runtime/syntax/julia.yaml +++ b/runtime/syntax/julia.yaml @@ -21,9 +21,9 @@ rules: # parentheses - symbol.brackets: "([(){}]|\\[|\\])" # numbers - - constant.number: "\\b[0-9]+\\b" + - constant.number: "\\b([0-9]+(_[0-9]+)*|0x[0-9a-fA-F]+(_[0-9a-fA-F]+)*|0b[01]+(_[01]+)*|0o[0-7]+(_[0-7]+)*)\\b" - - constant.string: "\"(\\\\.|[^\"])*\"|'(\\\\.|[^'])*'" + - constant.string: "\"(\\\\.|[^\"])*\"|'(\\\\.|[^']){1}'" - constant.string: start: "\"\"\"" From 73093f9497f1f6db1407801a2f110b2ab4b67918 Mon Sep 17 00:00:00 2001 From: Antonino Siena Date: Sat, 6 Jul 2019 07:51:12 +0200 Subject: [PATCH 6/8] Added Ziglang syntax support (#1354) * Added Ziglang syntax support * Removed unused constant string markup * Added 'fn' as keyword * Added constant matching ending with numbers and proper hexadecimal matching * Added missing types * Added all keywords in alphabetical order --- runtime/syntax/zig.yaml | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 runtime/syntax/zig.yaml diff --git a/runtime/syntax/zig.yaml b/runtime/syntax/zig.yaml new file mode 100644 index 00000000..5c748626 --- /dev/null +++ b/runtime/syntax/zig.yaml @@ -0,0 +1,37 @@ +filetype: zig + +detect: + filename: "\\.zig$" + +rules: + # function definition + - identifier: "fn [a-z0-9_]+" + # Reserved words + - statement: "\\b(align|and|allowzero|anyerror|asm|async|await|break|cancel|catch|comptime|const|continue|defer|else|enum|errdefer|error|export|extern|false|fn|for|if|inline|nakedcc|noalias|null|or|orelse|packed|promise|pub|resume|return|linksection|stdcallcc|struct|suspend|switch|test|threadlocal|true|try|undefined|union|unreachable|use|var|volatile|while)\\b" + # builtin functions + - special: "@+[a-z_]+" + # Constants + - constant: "[A-Z][A-Z_]+([0-9]+)?" + # Numbers (hexadecimal + decimal) + - constant.number: "\\b(0x[A-F0-9]+|[0-9]+)\\b" + # Primitive Types / Derived Data Types + - type: "([A-Z][a-z]+|(i8|u8|i16|u16|i32|u32|i64|u64|i128|u128|isize|usize|c_short|c_ushort|c_int|c_uint|c_long|c_ulong|c_longlong|c_ulonglong|c_longdouble|c_void|f16|f32|f64|f128|bool|void|noreturn|type|anyerror|comptime_int|comptime_float))" + + - constant.string: + start: "\"" + end: "\"" + skip: "\\\\." + rules: + - constant.specialChar: "\\\\." + + - comment: + start: "//" + end: "$" + rules: + - todo: "(TODO|XXX|FIXME):?" + + - comment: + start: "/\\*" + end: "\\*/" + rules: + - todo: "(TODO|XXX|FIXME):?" From 3a4bdb0db6920fb3db544583ab10800401a07bb1 Mon Sep 17 00:00:00 2001 From: Patrick Weingaertner Date: Thu, 25 Jul 2019 23:22:15 +0200 Subject: [PATCH 7/8] add TODO to JS highlighting --- runtime/syntax/javascript.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/runtime/syntax/javascript.yaml b/runtime/syntax/javascript.yaml index dfce4272..244ad811 100644 --- a/runtime/syntax/javascript.yaml +++ b/runtime/syntax/javascript.yaml @@ -20,7 +20,7 @@ rules: - statement: "\\b(for|function|class|extends|get|if|import|from|in|of|instanceof|let|new|return|set)\\b" - statement: "\\b(super|switch|this|throw|try|typeof|var|void|while|with|yield)\\b" # reserved but unassigned - - error: "\\b(enum|implements|interface|package|private|protected|public)" + - error: "\\b(enum|implements|interface|package|private|protected|public|TODO)" - constant: "\\b(null|undefined|NaN)\\b" - constant: "\\b(true|false)\\b" - type: "\\b(Array|Boolean|Date|Enumerator|Error|Function|Math)\\b" From c11af1c19ca9187a2382f711d3f4162d865268b8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Patrick=20Weing=C3=A4rtner?= Date: Fri, 26 Jul 2019 04:57:53 +0200 Subject: [PATCH 8/8] ( #1358 ) add vue single-file component syntax highlighting (#1359) * add vue single-file component syntax highlighting * remove unnecessary new line --- runtime/syntax/vue.yaml | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 runtime/syntax/vue.yaml diff --git a/runtime/syntax/vue.yaml b/runtime/syntax/vue.yaml new file mode 100644 index 00000000..4c1c3040 --- /dev/null +++ b/runtime/syntax/vue.yaml @@ -0,0 +1,24 @@ +filetype: vue + +detect: + filename: "\\.vue$" + +rules: + - default: + start: "" + end: "" + rules: + - include: "html5" + + - default: + start: "" + end: "" + rules: + - include: "javascript" + + - default: + start: "" + end: "" + rules: + - include: "css" + \ No newline at end of file