mirror of
https://github.com/zyedidia/micro.git
synced 2026-03-16 13:57:07 +09:00
Add nix language syntax (#2024)
* Create nix.yaml Add nix language syntax * Add nix-linter
This commit is contained in:
@@ -86,6 +86,7 @@ function preinit()
|
||||
makeLinter("swiftc", "swift", "xcrun", {"swiftc", "%f"}, "%f:%l:%c:.+: %m", {"darwin"}, true)
|
||||
makeLinter("swiftc", "swift", "swiftc", {"%f"}, "%f:%l:%c:.+: %m", {"linux"}, true)
|
||||
makeLinter("yaml", "yaml", "yamllint", {"--format", "parsable", "%f"}, "%f:%l:%c:.+ %m")
|
||||
makeLinter("nix-linter", "nix", "nix-linter", {"%f"}, "%m at %f:%l:%c", {"linux"}, true)
|
||||
|
||||
config.MakeCommand("lint", function(bp, args)
|
||||
bp:Save()
|
||||
|
||||
27
runtime/syntax/nix.yaml
Normal file
27
runtime/syntax/nix.yaml
Normal file
@@ -0,0 +1,27 @@
|
||||
filetype: nix
|
||||
|
||||
detect:
|
||||
filename: "\\.nix$"
|
||||
|
||||
rules:
|
||||
- special: "\\b(Ellipsis|null|self|super|true|false|abort)\\b"
|
||||
- statement: "\\b(let|in|with|import|rec|inherit)\\b"
|
||||
- symbol.operator: "([~^.:;,+*|=!\\%@]|<|>|/|-|&)"
|
||||
- symbol.brackets: "([(){}]|\\[|\\])"
|
||||
|
||||
- constant.number: "\\b[0-9](_?[0-9])*(\\.([0-9](_?[0-9])*)?)?(e[0-9](_?[0-9])*)?\\b"
|
||||
|
||||
- constant.string:
|
||||
start: "\""
|
||||
end: "\""
|
||||
rules: []
|
||||
|
||||
- constant.string:
|
||||
start: "''"
|
||||
end: "''"
|
||||
rules: []
|
||||
|
||||
- comment:
|
||||
start: "#"
|
||||
end: "$"
|
||||
rules: []
|
||||
Reference in New Issue
Block a user