From a0ef4815e9febbc47b780f0c3f9286b4a9ded4bb Mon Sep 17 00:00:00 2001 From: Andrea Dejan Grande Date: Sat, 27 Apr 2019 23:19:34 +0200 Subject: [PATCH 01/12] Create pug.nanorc --- pug.nanorc | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 pug.nanorc diff --git a/pug.nanorc b/pug.nanorc new file mode 100644 index 0000000..3b97519 --- /dev/null +++ b/pug.nanorc @@ -0,0 +1,19 @@ +syntax "Pug" "\.pug$" +# Elements +color yellow "^\s*([a-z0-9]+)" +# Main elements +color red "^\s*(html|head|body)" +# Parenthesis content +color blue "\((.*?)\)" +# Strings +color cyan "('[^']*')|(\"[^\"]*\")" +# Parenthesis, commas, equals +icolor green "\(" "\)" "\," "\=" +# Comments and spaces +color blue "//.*" +color blue start="/\*" end="\*/" +color ,green "[[:space:]]+$" +# Pipes +color yellow,magenta "\|" +# Doctype +color brightblack "^\s*(doctype)(.*)" From f6f67e5b4d74e95e9d0c2d63aaafb6afbb3d8f4b Mon Sep 17 00:00:00 2001 From: Andrea Dejan Grande Date: Sat, 27 Apr 2019 23:20:08 +0200 Subject: [PATCH 02/12] Create jade.nanorc --- jade.nanorc | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 jade.nanorc diff --git a/jade.nanorc b/jade.nanorc new file mode 100644 index 0000000..7913753 --- /dev/null +++ b/jade.nanorc @@ -0,0 +1,19 @@ +syntax "Jade" "\.jade$" +# Elements +color yellow "^\s*([a-z0-9]+)" +# Main elements +color red "^\s*(html|head|body)" +# Parenthesis content +color blue "\((.*?)\)" +# Strings +color cyan "('[^']*')|(\"[^\"]*\")" +# Parenthesis, commas, equals +icolor green "\(" "\)" "\," "\=" +# Comments and spaces +color blue "//.*" +color blue start="/\*" end="\*/" +color ,green "[[:space:]]+$" +# Pipes +color yellow,magenta "\|" +# Doctype +color brightblack "^\s*(doctype)(.*)" From 76f954e36d86e59615f9ffda42ecb23cf63f1426 Mon Sep 17 00:00:00 2001 From: Andrea Dejan Grande Date: Sat, 27 Apr 2019 23:24:07 +0200 Subject: [PATCH 03/12] Added jade.nanorc and pug.nanorc --- nanorc | 2 ++ 1 file changed, 2 insertions(+) diff --git a/nanorc b/nanorc index 47ae7a8..bd14c5e 100644 --- a/nanorc +++ b/nanorc @@ -32,6 +32,7 @@ include "~/.nano/html.j2.nanorc" include "~/.nano/ical.nanorc" include "~/.nano/ini.nanorc" include "~/.nano/inputrc.nanorc" +include "~/.nano/jade.nanorc" include "~/.nano/java.nanorc" include "~/.nano/javascript.nanorc" include "~/.nano/js.nanorc" @@ -60,6 +61,7 @@ include "~/.nano/po.nanorc" include "~/.nano/pov.nanorc" include "~/.nano/privoxy.nanorc" include "~/.nano/puppet.nanorc" +include "~/.nano/pug.nanorc" include "~/.nano/python.nanorc" include "~/.nano/reST.nanorc" include "~/.nano/rpmspec.nanorc" From 8d108e569f77db4031a5a5b6d2f9cdd64f773602 Mon Sep 17 00:00:00 2001 From: Andrea Dejan Grande Date: Sun, 28 Apr 2019 02:15:20 +0200 Subject: [PATCH 04/12] Added includes --- jade.nanorc | 2 ++ pug.nanorc | 2 ++ 2 files changed, 4 insertions(+) diff --git a/jade.nanorc b/jade.nanorc index 7913753..9d38cae 100644 --- a/jade.nanorc +++ b/jade.nanorc @@ -3,6 +3,8 @@ syntax "Jade" "\.jade$" color yellow "^\s*([a-z0-9]+)" # Main elements color red "^\s*(html|head|body)" +# Includes +color magenta "^\s*(include)" # Parenthesis content color blue "\((.*?)\)" # Strings diff --git a/pug.nanorc b/pug.nanorc index 3b97519..745b8c5 100644 --- a/pug.nanorc +++ b/pug.nanorc @@ -3,6 +3,8 @@ syntax "Pug" "\.pug$" color yellow "^\s*([a-z0-9]+)" # Main elements color red "^\s*(html|head|body)" +# Includes +color magenta "^\s*(include)" # Parenthesis content color blue "\((.*?)\)" # Strings From 966e51f3635d71363caf6eede27b866d5cf2b4b6 Mon Sep 17 00:00:00 2001 From: Andrea Dejan Grande Date: Sun, 28 Apr 2019 02:55:31 +0200 Subject: [PATCH 05/12] Added conditionals --- jade.nanorc | 8 +++++++- pug.nanorc | 8 +++++++- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/jade.nanorc b/jade.nanorc index 9d38cae..8f68d4d 100644 --- a/jade.nanorc +++ b/jade.nanorc @@ -4,7 +4,13 @@ color yellow "^\s*([a-z0-9]+)" # Main elements color red "^\s*(html|head|body)" # Includes -color magenta "^\s*(include)" +icolor magenta "^\s*(include)" +# Variables +color brightblue "^\s*(\-)\s(var)\s([a-z0-9]+)" +icolor magenta "^\s*(\-)\s(var)$" "^\s*(\-)\s(var)\s" +color white "^\s*(\-)" +# Conditionals +icolor magenta "^\s*(if|else|else if)$" "^\s*(if|else|else if)\s" # Parenthesis content color blue "\((.*?)\)" # Strings diff --git a/pug.nanorc b/pug.nanorc index 745b8c5..be85d9d 100644 --- a/pug.nanorc +++ b/pug.nanorc @@ -4,7 +4,13 @@ color yellow "^\s*([a-z0-9]+)" # Main elements color red "^\s*(html|head|body)" # Includes -color magenta "^\s*(include)" +icolor magenta "^\s*(include)" +# Variables +color brightblue "^\s*(\-)\s(var)\s([a-z0-9]+)" +icolor magenta "^\s*(\-)\s(var)$" "^\s*(\-)\s(var)\s" +color white "^\s*(\-)" +# Conditionals +icolor magenta "^\s*(if|else|else if)$" "^\s*(if|else|else if)\s" # Parenthesis content color blue "\((.*?)\)" # Strings From 5aaa682af67257116df3afcb61834e6ca0ae1dcd Mon Sep 17 00:00:00 2001 From: Andrea Dejan Grande Date: Sun, 28 Apr 2019 03:00:29 +0200 Subject: [PATCH 06/12] Shrinked parenthesis regex --- jade.nanorc | 4 ++-- pug.nanorc | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/jade.nanorc b/jade.nanorc index 8f68d4d..e918c9d 100644 --- a/jade.nanorc +++ b/jade.nanorc @@ -1,4 +1,4 @@ -syntax "Jade" "\.jade$" +syntax "Pug" "\.pug$" # Elements color yellow "^\s*([a-z0-9]+)" # Main elements @@ -12,7 +12,7 @@ color white "^\s*(\-)" # Conditionals icolor magenta "^\s*(if|else|else if)$" "^\s*(if|else|else if)\s" # Parenthesis content -color blue "\((.*?)\)" +color blue start="\(" end="\)" # Strings color cyan "('[^']*')|(\"[^\"]*\")" # Parenthesis, commas, equals diff --git a/pug.nanorc b/pug.nanorc index be85d9d..e918c9d 100644 --- a/pug.nanorc +++ b/pug.nanorc @@ -12,7 +12,7 @@ color white "^\s*(\-)" # Conditionals icolor magenta "^\s*(if|else|else if)$" "^\s*(if|else|else if)\s" # Parenthesis content -color blue "\((.*?)\)" +color blue start="\(" end="\)" # Strings color cyan "('[^']*')|(\"[^\"]*\")" # Parenthesis, commas, equals From 944dc422ab54a633863f8ed92d1f82a181992fe5 Mon Sep 17 00:00:00 2001 From: Andrea Dejan Grande Date: Sun, 28 Apr 2019 03:17:55 +0200 Subject: [PATCH 07/12] Added links --- jade.nanorc | 4 +++- pug.nanorc | 2 ++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/jade.nanorc b/jade.nanorc index e918c9d..032d9fa 100644 --- a/jade.nanorc +++ b/jade.nanorc @@ -1,4 +1,4 @@ -syntax "Pug" "\.pug$" +syntax "Jade" "\.jade$" # Elements color yellow "^\s*([a-z0-9]+)" # Main elements @@ -25,3 +25,5 @@ color ,green "[[:space:]]+$" color yellow,magenta "\|" # Doctype color brightblack "^\s*(doctype)(.*)" +# Links +icolor brightgreen "https?:\/\/(www\.)?[a-zA-Z0-9@%._\+~#=]{2,256}\.[a-z]{2,6}\b([-a-zA-Z0-9@:%_\+.~#?&//=]*)" "_blank" diff --git a/pug.nanorc b/pug.nanorc index e918c9d..f450836 100644 --- a/pug.nanorc +++ b/pug.nanorc @@ -25,3 +25,5 @@ color ,green "[[:space:]]+$" color yellow,magenta "\|" # Doctype color brightblack "^\s*(doctype)(.*)" +# Links +icolor brightgreen "https?:\/\/(www\.)?[a-zA-Z0-9@%._\+~#=]{2,256}\.[a-z]{2,6}\b([-a-zA-Z0-9@:%_\+.~#?&//=]*)" "_blank" From 40e9bbd4d3b48b4c37828b87d1f951c243ab223c Mon Sep 17 00:00:00 2001 From: Andrea Dejan Grande Date: Sun, 28 Apr 2019 03:31:07 +0200 Subject: [PATCH 08/12] Added HTML support --- jade.nanorc | 6 +++++- pug.nanorc | 6 +++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/jade.nanorc b/jade.nanorc index 032d9fa..e4bb6ea 100644 --- a/jade.nanorc +++ b/jade.nanorc @@ -18,9 +18,13 @@ color cyan "('[^']*')|(\"[^\"]*\")" # Parenthesis, commas, equals icolor green "\(" "\)" "\," "\=" # Comments and spaces -color blue "//.*" +color blue "\s+(//.*)" color blue start="/\*" end="\*/" color ,green "[[:space:]]+$" +# HTML-style conditional comments +color brightmagenta "" # HTML-style elements color yellow "<([^!].*)>" # Pipes diff --git a/pug.nanorc b/pug.nanorc index 3d7e6d9..16cda23 100644 --- a/pug.nanorc +++ b/pug.nanorc @@ -24,7 +24,8 @@ color ,green "[[:space:]]+$" # Unbuffered comments color brightblue "\s+(//-.*)" # HTML-style conditional comments -color brightmagenta "" # HTML-style elements color yellow "<([^!].*)>" # Pipes From c5a968e11aee9307bb9e381240d738b33c4775f1 Mon Sep 17 00:00:00 2001 From: Andrea Dejan Grande Date: Sun, 28 Apr 2019 03:57:23 +0200 Subject: [PATCH 11/12] Added cases --- jade.nanorc | 11 ++++++++--- pug.nanorc | 11 ++++++++--- 2 files changed, 16 insertions(+), 6 deletions(-) diff --git a/jade.nanorc b/jade.nanorc index e372fbe..46725b5 100644 --- a/jade.nanorc +++ b/jade.nanorc @@ -7,8 +7,12 @@ color red "^\s*(html|head|body)" icolor magenta "^\s*(include)" # Variables color brightblue "^\s*(\-)\s(var)\s([a-z0-9]+)" -icolor magenta "^\s*(\-)\s(var)$" "^\s*(\-)\s(var)\s" -color white "^\s*(\-)" +icolor magenta "^\s*-\s(var)$" "^\s*-\s(var)\s" +# Cases +color brightblue "^\s*(case)\s(.*)" +color cyan "^\s*(when)\s(.*)" +icolor magenta "^\s*(case|when|default)$" "^\s*(case|when|default)\s" +color brightred "^\s*-\s(break)$" "^\s*-\s(break)\s" # Conditionals icolor magenta "^\s*(if|else|else if)$" "^\s*(if|else|else if)\s" # Parenthesis content @@ -17,9 +21,10 @@ color blue start="\(" end="\)" color cyan "('[^']*')|(\"[^\"]*\")" # Parenthesis, commas, equals icolor green "\(" "\)" "\," "\=" -# Comments and spaces +# Comments, dashes and spaces color blue "\s+(//.*)" color blue start="/\*" end="\*/" +color white "^\s*(\-)" color ,green "[[:space:]]+$" # Unbuffered comments color brightblue "\s+(//-.*)" diff --git a/pug.nanorc b/pug.nanorc index 16cda23..cb16507 100644 --- a/pug.nanorc +++ b/pug.nanorc @@ -7,8 +7,12 @@ color red "^\s*(html|head|body)" icolor magenta "^\s*(include)" # Variables color brightblue "^\s*(\-)\s(var)\s([a-z0-9]+)" -icolor magenta "^\s*(\-)\s(var)$" "^\s*(\-)\s(var)\s" -color white "^\s*(\-)" +icolor magenta "^\s*-\s(var)$" "^\s*-\s(var)\s" +# Cases +color brightblue "^\s*(case)\s(.*)" +color cyan "^\s*(when)\s(.*)" +icolor magenta "^\s*(case|when|default)$" "^\s*(case|when|default)\s" +color brightred "^\s*-\s(break)$" "^\s*-\s(break)\s" # Conditionals icolor magenta "^\s*(if|else|else if)$" "^\s*(if|else|else if)\s" # Parenthesis content @@ -17,9 +21,10 @@ color blue start="\(" end="\)" color cyan "('[^']*')|(\"[^\"]*\")" # Parenthesis, commas, equals icolor green "\(" "\)" "\," "\=" -# Comments and spaces +# Comments, dashes and spaces color blue "\s+(//.*)" color blue start="/\*" end="\*/" +color white "^\s*(\-)" color ,green "[[:space:]]+$" # Unbuffered comments color brightblue "\s+(//-.*)" From d64254f33dc1f0f7576ef6d6053553e6b3e68777 Mon Sep 17 00:00:00 2001 From: Andrea Dejan Grande Date: Sun, 28 Apr 2019 04:01:57 +0200 Subject: [PATCH 12/12] Added each and for loops --- jade.nanorc | 4 ++++ pug.nanorc | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/jade.nanorc b/jade.nanorc index 46725b5..54fddd1 100644 --- a/jade.nanorc +++ b/jade.nanorc @@ -15,6 +15,10 @@ icolor magenta "^\s*(case|when|default)$" "^\s*(case|when|default)\s" color brightred "^\s*-\s(break)$" "^\s*-\s(break)\s" # Conditionals icolor magenta "^\s*(if|else|else if)$" "^\s*(if|else|else if)\s" +# For loops +icolor magenta "^\s*-\s(for)" +# Each +icolor magenta "^\s*(each)$" "^\s*(each)\s" # Parenthesis content color blue start="\(" end="\)" # Strings diff --git a/pug.nanorc b/pug.nanorc index cb16507..49d4ab4 100644 --- a/pug.nanorc +++ b/pug.nanorc @@ -15,6 +15,10 @@ icolor magenta "^\s*(case|when|default)$" "^\s*(case|when|default)\s" color brightred "^\s*-\s(break)$" "^\s*-\s(break)\s" # Conditionals icolor magenta "^\s*(if|else|else if)$" "^\s*(if|else|else if)\s" +# For loops +icolor magenta "^\s*-\s(for)" +# Each +icolor magenta "^\s*(each)$" "^\s*(each)\s" # Parenthesis content color blue start="\(" end="\)" # Strings