From 7fbb9e81277c78b085960468c54cd04298ea24f9 Mon Sep 17 00:00:00 2001 From: Colin Rioux Date: Sat, 18 Feb 2017 10:47:37 -0500 Subject: [PATCH] Modified readme, added another syntax --- syntax_files/README.md | 34 +++++++++++++++++++++++++ syntax_files/gentoo-ebuild.yaml | 44 +++++++++++++++++++++++++++++++++ 2 files changed, 78 insertions(+) create mode 100644 syntax_files/README.md create mode 100644 syntax_files/gentoo-ebuild.yaml diff --git a/syntax_files/README.md b/syntax_files/README.md new file mode 100644 index 0000000..43f5493 --- /dev/null +++ b/syntax_files/README.md @@ -0,0 +1,34 @@ +# Micro Syntax Highlighting Files v2.0 +These are the new and improved syntax highlighting files for micro. They no longer follow a format similar to nano. +These files should be written in yaml, and can easily be converted from .nanorc or .micro to yaml. + +# Using with colorschemes + +Not all of these files have been converted to use micro's colorscheme feature. Most of them just hardcode the colors, which +can be problematic depending on the colorscheme you use. + +Here is a list of the files that have been converted to properly use colorschemes: + +* vi +* go +* c +* d +* markdown +* html +* lua +* swift +* rust +* java +* javascript +* pascal +* python +* ruby +* sh +* git +* tex +* solidity + +# License + +Because the nano syntax files I have modified are distributed under the GNU GPLv3 license, these files are also distributed +under that license. See [LICENSE](LICENSE). \ No newline at end of file diff --git a/syntax_files/gentoo-ebuild.yaml b/syntax_files/gentoo-ebuild.yaml new file mode 100644 index 0000000..abe744e --- /dev/null +++ b/syntax_files/gentoo-ebuild.yaml @@ -0,0 +1,44 @@ +filetype: ebuild + +detect: + filename: "\\.e(build|class)$" + +rules: + # All the standard portage functions + - identifier: "^src_(unpack|compile|install|test)|^pkg_(config|nofetch|setup|(pre|post)(inst|rm))" + # Highlight bash related syntax + - statement: "\\b(case|do|done|elif|else|esac|exit|fi|for|function|if|in|local|read|return|select|shift|then|time|until|while|continue|break)\\b" + - statement: "(\\{|\\}|\\(|\\)|\\;|\\]|\\[|`|\\\\|\\$|<|>|!|=|&|\\|)" + - statement: "-(e|d|f|r|g|u|w|x|L)\\b" + - statement: "-(eq|ne|gt|lt|ge|le|s|n|z)\\b" + # Highlight variables ... official portage ones in red, all others in bright red + - preproc: "\\$\\{?[a-zA-Z_0-9]+\\}?" + - special: "\\b(ARCH|HOMEPAGE|DESCRIPTION|IUSE|SRC_URI|LICENSE|SLOT|KEYWORDS|FILESDIR|WORKDIR|(P|R)?DEPEND|PROVIDE|DISTDIR|RESTRICT|USERLAND)\\b" + - special: "\\b(S|D|T|PV|PF|P|PN|A)\\b|\\bC(XX)?FLAGS\\b|\\bLDFLAGS\\b|\\bC(HOST|TARGET|BUILD)\\b" + # Highlight portage commands + - identifier: "\\buse(_(with|enable))?\\b [!a-zA-Z0-9_+ -]*|inherit.*" + - statement: "\\be(begin|end|conf|install|make|warn|infon?|error|log|patch|new(group|user))\\b" + - statement: "\\bdie\\b|\\buse(_(with|enable))?\\b|\\binherit\\b|\\bhas\\b|\\b(has|best)_version\\b|\\bunpack\\b" + - statement: "\\b(do|new)(ins|s?bin|doc|lib(\\.so|\\.a)|man|info|exe|initd|confd|envd|pam|menu|icon)\\b" + - statement: "\\bdo(python|sed|dir|hard|sym|html|jar|mo)\\b|\\bkeepdir|\b" + - statement: "prepall(docs|info|man|strip)|prep(info|lib|lib\\.(so|a)|man|strip)" + - statement: "\\b(doc|ins|exe)into\\b|\\bf(owners|perms)\\b|\\b(exe|ins|dir)opts\\b" + # Highlight common commands used in ebuilds + - type: "\\bmake\\b|\\b(cat|cd|chmod|chown|cp|echo|env|export|grep|let|ln|mkdir|mv|rm|sed|set|tar|touch|unset)\\b" + # Highlight comments (doesnt work that well) + - comment: + start: "#" + end: "$" + rules: [] + # Highlight strings (doesnt work that well) + - constant.string: + start: "\"" + end: "\"" + rules: + - constant.specialChar: "\\\\." + - constant.string: + start: "'" + end: "'" + rules: + - constant.specialChar: "\\\\." + \ No newline at end of file