Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/serialhex/nano-highlight.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorserialhex <serialhex@gmail.com>2018-02-06 03:31:15 +0300
committerGitHub <noreply@github.com>2018-02-06 03:31:15 +0300
commit99197470c87bf5e0ae43970e3547418bffb3e998 (patch)
tree3bac5b003fabf7469e67ffa9be0adb779eba96dd
parent573e9267dc4415a0fadb817f032dca84a675992f (diff)
parent34c68187da058aea734d7161cf6a8796b8ee90b9 (diff)
Merge pull request #37 from Piterden/feature/readme-tables
Feature/readme tables
-rw-r--r--README.md157
-rw-r--r--aptsrclist.nanorc6
-rw-r--r--dotenv.nanorc2
-rw-r--r--editorconfig.nanorc2
-rw-r--r--gen-nanorc.sh36
-rw-r--r--ini.nanorc4
-rw-r--r--js.nanorc2
-rw-r--r--php.nanorc2
8 files changed, 129 insertions, 82 deletions
diff --git a/README.md b/README.md
index 56710c2..2827786 100644
--- a/README.md
+++ b/README.md
@@ -4,15 +4,15 @@ nano-highlight
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
-if you just like the simplicity of using an extremely lightweight console editor, which is one of the biggest reasons
+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???
@@ -22,75 +22,86 @@ 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:
- ## my awesome ~/.nanorc file!!!
-
- ## spifftastic nano highlighting nano!!
- include "~/.nano/nanorc.nanorc"
-
- ## Ruby
- include "~/.nano/ruby.nanorc"
-
- ## C/C++
- include "~/.nano/c.nanorc"
-
- ## Python
- include "~/.nano/python.nanorc"
-
- ## Bourne shell scripts
- include "~/.nano/bash.nanorc"
-
- ## CSS
- include "~/.nano/css.nanorc"
-
- ## HTML
- include "~/.nano/html.nanorc"
-
- ## 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.
-
-[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:
-
-### 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
-apacheconf.nanorc conky.nanorc groff.nanorc mcchangelog.nanorc po.nanorc tab.nanorc
-aptsrclist.nanorc css.nanorc havp.nanorc mimetype.nanorc postgresql.nanorc tcl.nanorc
-asm.nanorc debian.nanorc html.nanorc mutt.nanorc pov.nanorc tex.nanorc
-bash.nanorc default.nanorc httpstatuscodes.nanorc named.nanorc privoxy.nanorc urls.nanorc
-c-file.nanorc delphi.nanorc info.nanorc nanorc.nanorc profile.nanorc vhost.nanorc
-changelog.nanorc desc.nanorc ini.nanorc nscd.nanorc python.nanorc xdefaults.nanorc
-changelogs.nanorc dotemacs.nanorc initng.nanorc others.nanorc rcfiles.nanorc xml.nanorc
-clike.nanorc dummy.nanorc initscript.nanorc paludis.nanorc rcfiles-new.nanorc xorg.nanorc
-c.nanorc ebuild.nanorc java.nanorc passwd.nanorc rsync.nanorc
-config2.nanorc ekghistory.nanorc js.nanorc patch.nanorc ruby.nanorc
-config3.nanorc etcportage.nanorc log-stuff.nanorc perl.nanorc shlike.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) ###
-[scopatz / nanorc]: https://github.com/scopatz/nanorc
-*his repo has since changed, see LICENSE for the new license these fall under*
-
-apacheconf.nanorc css.nanorc groff.nanorc man.nanorc patch.nanorc python.nanorc sh.nanorc
-asm.nanorc cython.nanorc html.nanorc markdown.nanorc perl.nanorc tex.nanorc c.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) ###
-
-markdown.nanorc txt2tags.nanorc
-
-### Files from [aaronhamilton / coffeescript-nano][] ###
-[aaronhamilton / coffeescript-nano]: https://github.com/aaronhamilton/coffeescript-nano
-coffee.nanorc
+```bash
+## my awesome ~/.nanorc file!!!
+
+## spifftastic nano highlighting nano!!
+include "~/.nano/nanorc.nanorc"
+
+## Ruby
+include "~/.nano/ruby.nanorc"
+
+## C/C++
+include "~/.nano/c.nanorc"
+
+## Python
+include "~/.nano/python.nanorc"
+
+## Bourne shell scripts
+include "~/.nano/bash.nanorc"
+
+## CSS
+include "~/.nano/css.nanorc"
+
+## HTML
+include "~/.nano/html.nanorc"
+
+## Markdown
+include "~/.nano/markdown.nanorc"
+```
+
+There are other spiffy things you can do in your `.nanorc` file, see [nanorc manpage](http://www.nano-editor.org/dist/v2.8/nanorc.5.html) online or your very own nanorc manpage for more details.
+
+OOH!!! That's spiffy!!! Thanks for all your hard work in making all these files!!!
+
+---
+
+Umm, yeah, about that, I didn't make *all* of them, here is the list of who did what with whom:
+
+### Files from [nanosyntax](http://code.google.com/p/nanosyntax/) (New BSD license)
+
+| | | | | |
+| --- | --- | --- | --- | --- |
+| apache2.nanorc | css.nanorc | httpstatuscodes.nanorc | nscd.nanorc | rcfiles-new.nanorc |
+| apacheconf.nanorc | debian.nanorc | info.nanorc | others.nanorc | rsync.nanorc |
+| aptsrclist.nanorc | default.nanorc | ini.nanorc | paludis.nanorc | ruby.nanorc |
+| asm.nanorc | delphi.nanorc | initng.nanorc | passwd.nanorc | shlike.nanorc |
+| bash.nanorc | desc.nanorc | initscript.nanorc | patch.nanorc | sh.nanorc |
+| c-file.nanorc | dotemacs.nanorc | java.nanorc | perl.nanorc | softcam.nanorc |
+| changelog.nanorc | dummy.nanorc | js.nanorc | php2.nanorc | sources_list.nanorc |
+| changelogs.nanorc | ebuild.nanorc | log-stuff.nanorc | php.nanorc | tab.nanorc |
+| clike.nanorc | ekghistory.nanorc | maincf.nanorc | plaudis.nanorc | tcl.nanorc |
+| c.nanorc | etcportage.nanorc | makefile.nanorc | po.nanorc | tex.nanorc |
+| config2.nanorc | etc-stuff.nanorc | man.nanorc | postgresql.nanorc | urls.nanorc |
+| config3.nanorc | etcxml.nanorc | mcchangelog.nanorc | pov.nanorc | vhost.nanorc |
+| configfiles.nanorc | gentoo.nanorc | mimetype.nanorc | privoxy.nanorc | xdefaults.nanorc |
+| config.nanorc | groff.nanorc | mutt.nanorc | profile.nanorc | xml.nanorc |
+| conf.nanorc | havp.nanorc | named.nanorc | python.nanorc | xorg.nanorc |
+| conky.nanorc | html.nanorc | nanorc.nanorc | rcfiles.nanorc | |
+
+### Files from [scopatz / nanorc](https://github.com/scopatz/nanorc) ('do whatever you want' licence)
+
+> *his repo has since changed, see LICENSE for the new license these fall under*
+
+| | | | | | |
+| --- | --- | --- | --- | --- | --- |
+| apacheconf.nanorc | css.nanorc | groff.nanorc | man.nanorc | patch.nanorc | python.nanorc |
+| asm.nanorc | cython.nanorc | html.nanorc | markdown.nanorc | perl.nanorc | tex.nanorc |
+| fortran.nanorc | java.nanorc | mutt.nanorc | php.nanorc | reST.nanorc | xml.nanorc |
+| gentoo.nanorc | lua.nanorc | nanorc.nanorc | pov.nanorc | ruby.nanorc | sh.nanorc |
+| c.nanorc | conf.nanorc | | | | |
+
+### Files found 'round the net (see the file for more info)
+
+| | |
+| --- | --- |
+| markdown.nanorc | txt2tags.nanorc |
+
+### Files from [aaronhamilton / coffeescript-nano](https://github.com/aaronhamilton/coffeescript-nano)
+
+| | |
+| --- | --- |
+| coffee.nanorc | |
## This is the end ##
diff --git a/aptsrclist.nanorc b/aptsrclist.nanorc
index 379cb36..406b49d 100644
--- a/aptsrclist.nanorc
+++ b/aptsrclist.nanorc
@@ -1,12 +1,12 @@
syntax "apt/sources.list" "sources\.list(\.old|~)?$"
## Component
-color brightmagenta "^deb(-src)? ((http|file|ftp):/[^ ]+|cdrom:\[[^\]]+\]/|cdrom:\[[a-zA-Z0-9\._\-\(\) ]+\]/) [^ ]+ .+$"
+color brightmagenta "^deb(-src)? ((https?|file|ftp):/[^ ]+|cdrom:\[[^\]]+\]/|cdrom:\[[a-zA-Z0-9\._\-\(\) ]+\]/) [^ ]+ .+$"
## Distribution
-color brightred "^deb(-src)? ((http|file|ftp):/[^ ]+|cdrom:\[[^\]]+\]/|cdrom:\[[a-zA-Z0-9\._\-\(\) ]+\]/) [^ ]+"
+color brightred "^deb(-src)? ((https?|file|ftp):/[^ ]+|cdrom:\[[^\]]+\]/|cdrom:\[[a-zA-Z0-9\._\-\(\) ]+\]/) [^ ]+"
## URI
-color brightgreen "(http|file|ftp):/[^ ]+"
+color brightgreen "(https?|file|ftp):/[^ ]+"
## CD-ROMs
# FIXME: [^\]] does not work.
diff --git a/dotenv.nanorc b/dotenv.nanorc
index 374cd17..dff22f6 100644
--- a/dotenv.nanorc
+++ b/dotenv.nanorc
@@ -1,5 +1,5 @@
# Supports `.env` files
-syntax "dotenv" "\/\.env(\.old|\.bak|~)?$"
+syntax "dotenv" "\/\.env(\.old|\.bak|.example|~)?$"
## Keys
color cyan "^\s*[A-Z0-9_]+"
diff --git a/editorconfig.nanorc b/editorconfig.nanorc
index c475df3..8d13df3 100644
--- a/editorconfig.nanorc
+++ b/editorconfig.nanorc
@@ -1,4 +1,4 @@
-syntax "editorconfig" "/\.editorconfig(\.old|\.bak|~)?$"
+syntax "editorconfig" "\.editorconfig(\.old|\.bak|~)?$"
## Values
color brightred "=.*$"
diff --git a/gen-nanorc.sh b/gen-nanorc.sh
new file mode 100644
index 0000000..84b1cc7
--- /dev/null
+++ b/gen-nanorc.sh
@@ -0,0 +1,36 @@
+#!/bin/bash
+## Generating correct `.nanorc` file.
+## You should to set right path starts from $HOME, ends with slash.
+## Also it needs blank (or not) ~/.nanorc file
+
+nano_highlight_path="$HOME/nano-highlight/"
+nanorc_path="$HOME/"
+
+if [[ ! -e "$nanorc_path".nanorc ]]; then
+ echo "You don't have .nanorc file."
+ echo -n "Do you wish to create it in '$nanorc_path' folder? (Y/n) "
+ read use_home
+ if echo "$use_home" | grep -iq "^[Nn]"; then
+ while [[ ! -n "$path" || ! -d "$path" ]]; do
+ echo -n "Please set the valid path. '$path' is not valid path. "
+ read path
+ done
+ nanorc_path=$path
+ fi
+ touch "$nanorc_path".nanorc
+ echo "'$nanorc_path.nanorc' file created."
+fi
+
+if [[ ! -d $nano_highlight_path ]]; then
+ while [[ ! -n "$folder" || ! -d "$HOME/$folder" ]]; do
+ echo "'$nano_highlight_path' is not a valid folder."
+ echo -n "Please set your nano-highlight path. $HOME/"
+ read folder
+ done
+ nano_highlight_path="$HOME/$folder/"
+fi
+
+> "$nanorc_path".nanorc
+for syntax in $(ls $nano_highlight_path*.nanorc); do
+ echo "include \"$syntax\"" >> "$nanorc_path".nanorc
+done
diff --git a/ini.nanorc b/ini.nanorc
index 5366a47..bfc0aca 100644
--- a/ini.nanorc
+++ b/ini.nanorc
@@ -1,4 +1,4 @@
-syntax "ini" "\.ini(\.old|~)?$"
+syntax "ini" "\.ini(\.old|\.bak|\.example|~)?$"
## Values
color brightred "=.*$"
@@ -19,4 +19,4 @@ color brightcyan "^\s*\[.*\]"
color cyan "^\s*[a-zA-Z0-9_\.]+"
## Comments
-color brightyellow ";.*$" \ No newline at end of file
+color brightyellow ";.*$"
diff --git a/js.nanorc b/js.nanorc
index 879672e..2d25e18 100644
--- a/js.nanorc
+++ b/js.nanorc
@@ -1,4 +1,4 @@
-syntax "javascript" "\.js$"
+syntax "javascript" "\.(mjs)|(js)|(json)$"
## Default
color white "^.+$"
diff --git a/php.nanorc b/php.nanorc
index 9f9df60..dfea9b4 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|protected|public|function|for|foreach|if|while|do|else|elseif|case|default|switch)\>"
+color brightyellow "\<(class|new|private|public|function|for|foreach|if|while|do|else|elseif|case|default|switch)\>"
## Basic control flow
color magenta "\<(goto|continue|break|return)\>"