Merge branch 'master' into master

This commit is contained in:
Dull Bananas 2019-11-15 18:46:13 -07:00 committed by GitHub
commit 166e227c9f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
8 changed files with 117 additions and 14 deletions

View File

@ -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`

View File

@ -27,6 +27,7 @@ rules:
- constant.string:
start: "'"
end: "'"
skip: "\\\\."
rules:
- constant.specialChar: "\\\\."
# Keywords

38
runtime/syntax/elm.yaml Normal file
View File

@ -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):?"

View File

@ -23,6 +23,7 @@ rules:
# reserved but unassigned
- error: "\\b(enum|implements|interface|package|private|protected|public|TODO)"
- constant: "\\b(globalThis|Infinity|null|undefined|NaN)\\b"
- constant: "\\b(null|undefined|NaN)\\b"
- constant: "\\b(true|false)\\b"
- type: "\\b(Array|Boolean|Date|Enumerator|Error|Function|Math|Map|Set|WeakMap|WeakSet)\\b"
- type: "\\b(Number|Object|RegExp|String)\\b"

View File

@ -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: "\"\"\""

View File

@ -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[\\}\\|]"

24
runtime/syntax/vue.yaml Normal file
View File

@ -0,0 +1,24 @@
filetype: vue
detect:
filename: "\\.vue$"
rules:
- default:
start: "<template.*?>"
end: "</template.*?>"
rules:
- include: "html5"
- default:
start: "<script.*?>"
end: "</script.*?>"
rules:
- include: "javascript"
- default:
start: "<style.*?>"
end: "</style.*?>"
rules:
- include: "css"

37
runtime/syntax/zig.yaml Normal file
View File

@ -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):?"