From bd77065261b46a9f9d3a1a45f7f0449fecba5b65 Mon Sep 17 00:00:00 2001 From: Denis Efremov Date: Wed, 31 May 2017 04:32:26 +0300 Subject: Create yaml.nanorc --- yaml.nanorc | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 yaml.nanorc diff --git a/yaml.nanorc b/yaml.nanorc new file mode 100644 index 0000000..35d8fdb --- /dev/null +++ b/yaml.nanorc @@ -0,0 +1,36 @@ +# Supports `YAML` files +syntax "YAML" "\.ya?ml$" +header "^(---|===)" "%YAML" + +## Keys +color magenta "^\s*[\$A-Za-z0-9_-]+\:" +color brightmagenta "^\s*@[\$A-Za-z0-9_-]+\:" + +## Values +color white ":\s.+$" +## Booleans +color brightcyan " (TRUE|true|FALSE|false|[Yy][Ee]?[Ss]?|[Nn][Oo]?)$" +## Numbers +color brightred " [[:digit:]]+(\.[[:digit:]]+)?" +## Arrays +color red "\[" "\]" ":\s+[|>]" "^\s*- " +## Reserved +color green "(^| )!!(binary|bool|float|int|map|null|omap|seq|set|str) " + +## Comments +color brightwhite "#.*$" + +## Errors +color ,red ":\w.+$" +color ,red ":'.+$" +color ,red ":".+$" +color ,red "\s+$" + +## Non closed quote +color ,red "['\"][^['\"]]*$" + +## Closed quotes +color yellow "['\"].*['\"]" + +## Equal sign +color brightgreen ":( |$)" -- cgit v1.2.3 From 4d14a3a62572ce840098a6ad050f61bde25d7c1d Mon Sep 17 00:00:00 2001 From: Denis Efremov Date: Thu, 1 Jun 2017 10:56:30 +0300 Subject: Update yaml.nanorc Take it from there https://makandracards.com/makandra/24809-yaml-keys-like-yes-or-no-evaluate-to-true-and-false --- yaml.nanorc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/yaml.nanorc b/yaml.nanorc index 35d8fdb..b474a35 100644 --- a/yaml.nanorc +++ b/yaml.nanorc @@ -9,7 +9,7 @@ color brightmagenta "^\s*@[\$A-Za-z0-9_-]+\:" ## Values color white ":\s.+$" ## Booleans -color brightcyan " (TRUE|true|FALSE|false|[Yy][Ee]?[Ss]?|[Nn][Oo]?)$" +color brightcyan " (y|Y|yes|Yes|YES|n|N|no|No|NO|true|True|TRUE|false|False|FALSE|on|On|ON|off|Off|OFF)$" ## Numbers color brightred " [[:digit:]]+(\.[[:digit:]]+)?" ## Arrays -- cgit v1.2.3 From 6010442f8069c5f01f99415fe1b21e8584e814da Mon Sep 17 00:00:00 2001 From: serialhex Date: Thu, 1 Jun 2017 09:21:25 -0400 Subject: Case insensitive regex https://www.nano-editor.org/dist/v2.8/nanorc.5.html search for `icolor` --- yaml.nanorc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/yaml.nanorc b/yaml.nanorc index b474a35..36c0b5b 100644 --- a/yaml.nanorc +++ b/yaml.nanorc @@ -9,7 +9,7 @@ color brightmagenta "^\s*@[\$A-Za-z0-9_-]+\:" ## Values color white ":\s.+$" ## Booleans -color brightcyan " (y|Y|yes|Yes|YES|n|N|no|No|NO|true|True|TRUE|false|False|FALSE|on|On|ON|off|Off|OFF)$" +icolor brightcyan " (y|yes|n|no|true|false|on|off)$" ## Numbers color brightred " [[:digit:]]+(\.[[:digit:]]+)?" ## Arrays -- cgit v1.2.3 From 510c4cb7f545ab5b56f10cd6aaa4ede7f26605d7 Mon Sep 17 00:00:00 2001 From: serialhex Date: Thu, 1 Jun 2017 09:30:12 -0400 Subject: Small formatting change --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index bfe320e..d73d4b0 100644 --- a/README.md +++ b/README.md @@ -57,7 +57,7 @@ OOH!!! that's spiffy!! thanks for all your hard work in making all these files umm, yeah, about that, i didnt make *all* of them, here is the list of who did what with whom: -### files from [nanosyntax][] (New BSD license)### +### files from [nanosyntax][] (New BSD license) ### [nanosyntax]: http://code.google.com/p/nanosyntax/ apache2.nanorc conf.nanorc gentoo.nanorc man.nanorc plaudis.nanorc sources_list.nanorc -- cgit v1.2.3 From e951795a32b00fef714364f0d4a8f5a166fffa5c Mon Sep 17 00:00:00 2001 From: serialhex Date: Thu, 1 Jun 2017 09:35:21 -0400 Subject: Update link to latest `nanorc` manpage, and grammar. --- README.md | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/README.md b/README.md index d73d4b0..56710c2 100644 --- a/README.md +++ b/README.md @@ -1,24 +1,24 @@ nano-highlight ============== -a spiffy collection of nano syntax highlighting files +A spiffy collection of nano syntax highlighting files ----------------------------------------------------- -*most* (ok, prettymuch all) of these have been stol\*COUGH\* politely included in this repository. proper +*Most* (ok, prettymuch all) of these have been stol\*COUGH\* politely included in this repository. Proper attribution follows at the end of it all... Unless otherwise specified, all files are under the [unlicense](http://unlicense.org/) WTF do i need these stupid things for??? ---------------------------------------- -well, if EMACS or vi are too much of a **PITA** for you to learn, and all the other text editors you've used are -likewise annoying for some reason (yes i'm looking at you Kate & Gedit) then nano is probably your best option! (or +Well, if EMACS or vi are too much of a **PITA** for you to learn, and all the other text editors you've used are +likewise annoying for some reason (yes i'm looking at you Kate & Gedit) then nano is probably your best option! (Or if you just like the simplicity of using an extremely lightweight console editor, which is one of the biggest reasons why __*I*__ use it) -so HTF do i use these things??? +So HTF do i use these things??? ------------------------------- -one of the easiest ways is like this: +One of the easiest ways is like this: `git clone git://github.com/serialhex/nano-highlight.git ~/.nano` then simply add the different \*.nanorc files that you want to use to your `~/.nanorc` file. for example, this is mine: @@ -48,16 +48,16 @@ then simply add the different \*.nanorc files that you want to use to your `~/.n ## Markdown include "~/.nano/markdown.nanorc"` -there are other spiffy things you can do in your `.nanorc` file, see [nanorc manpage][] online or your very own nanorc manpage for more details. +There are other spiffy things you can do in your `.nanorc` file, see [nanorc manpage][] online or your very own nanorc manpage for more details. -[nanorc manpage]: http://www.nano-editor.org/dist/v2.2/nanorc.5.html +[nanorc manpage]: http://www.nano-editor.org/dist/v2.8/nanorc.5.html OOH!!! that's spiffy!! thanks for all your hard work in making all these files!! ---------------------------------------------------------------------------------- -umm, yeah, about that, i didnt make *all* of them, here is the list of who did what with whom: +Umm, yeah, about that, i didnt make *all* of them, here is the list of who did what with whom: -### files from [nanosyntax][] (New BSD license) ### +### Files from [nanosyntax][] (New BSD license) ### [nanosyntax]: http://code.google.com/p/nanosyntax/ apache2.nanorc conf.nanorc gentoo.nanorc man.nanorc plaudis.nanorc sources_list.nanorc @@ -75,7 +75,7 @@ config3.nanorc etcportage.nanorc log-stuff.nanorc perl.nanorc configfiles.nanorc etc-stuff.nanorc maincf.nanorc php2.nanorc sh.nanorc config.nanorc etcxml.nanorc makefile.nanorc php.nanorc softcam.nanorc -### files from [scopatz / nanorc][] ('do whatever you want' licence) ### +### Files from [scopatz / nanorc][] ('do whatever you want' licence) ### [scopatz / nanorc]: https://github.com/scopatz/nanorc *his repo has since changed, see LICENSE for the new license these fall under* @@ -84,14 +84,14 @@ asm.nanorc cython.nanorc html.nanorc markdown.nanorc perl.nanorc fortran.nanorc java.nanorc mutt.nanorc php.nanorc reST.nanorc xml.nanorc conf.nanorc gentoo.nanorc lua.nanorc nanorc.nanorc pov.nanorc ruby.nanorc -### files found 'round the net (see the file for more info) ### +### Files found 'round the net (see the file for more info) ### markdown.nanorc txt2tags.nanorc -### files from [aaronhamilton / coffeescript-nano][] ### +### Files from [aaronhamilton / coffeescript-nano][] ### [aaronhamilton / coffeescript-nano]: https://github.com/aaronhamilton/coffeescript-nano coffee.nanorc -## this is the end ## +## This is the end ## -that's it, have fun & dont hurt yourself!! +That's it, have fun & dont hurt yourself!! -- cgit v1.2.3 From 883988ccafec476a91987349fc712523c3484553 Mon Sep 17 00:00:00 2001 From: Ketrel Date: Mon, 24 Jul 2017 12:08:45 -0400 Subject: Update php.nanorc Added protected as a structure keyword for use in classes (along with private and public) --- php.nanorc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/php.nanorc b/php.nanorc index dfea9b4..9f9df60 100644 --- a/php.nanorc +++ b/php.nanorc @@ -10,7 +10,7 @@ color white "\<[a-z_]*\(" color green "\<(var|float|global|double|bool|char|int|enum|const)\>" ## Structures -color brightyellow "\<(class|new|private|public|function|for|foreach|if|while|do|else|elseif|case|default|switch)\>" +color brightyellow "\<(class|new|private|protected|public|function|for|foreach|if|while|do|else|elseif|case|default|switch)\>" ## Basic control flow color magenta "\<(goto|continue|break|return)\>" -- cgit v1.2.3