1
0
mirror of https://github.com/scopatz/nanorc synced 2024-11-22 16:45:40 +01:00

Merge pull request #220 from AndreaDejanGrande/master

Jade and Pug support
This commit is contained in:
Anthony Scopatz 2019-04-28 08:32:31 -04:00 committed by GitHub
commit 37775bf3ea
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 92 additions and 0 deletions

45
jade.nanorc Normal file
View File

@ -0,0 +1,45 @@
syntax "Jade" "\.jade$"
# Elements
color yellow "^\s*([a-z0-9]+)"
# Main elements
color red "^\s*(html|head|body)"
# Includes
icolor magenta "^\s*(include)"
# Variables
color brightblue "^\s*(\-)\s(var)\s([a-z0-9]+)"
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"
# For loops
icolor magenta "^\s*-\s(for)"
# Each
icolor magenta "^\s*(each)$" "^\s*(each)\s"
# Parenthesis content
color blue start="\(" end="\)"
# Strings
color cyan "('[^']*')|(\"[^\"]*\")"
# Parenthesis, commas, equals
icolor green "\(" "\)" "\," "\="
# Comments, dashes and spaces
color blue "\s+(//.*)"
color blue start="/\*" end="\*/"
color white "^\s*(\-)"
color ,green "[[:space:]]+$"
# Unbuffered comments
color brightblue "\s+(//-.*)"
# HTML-style conditional comments
color brightmagenta start="<!" end="!>"
color brightmagenta "<!\[endif\]-->"
# HTML-style elements
color yellow "<([^!].*)>"
# Pipes
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"

2
nanorc
View File

@ -32,6 +32,7 @@ include "~/.nano/html.j2.nanorc"
include "~/.nano/ical.nanorc" include "~/.nano/ical.nanorc"
include "~/.nano/ini.nanorc" include "~/.nano/ini.nanorc"
include "~/.nano/inputrc.nanorc" include "~/.nano/inputrc.nanorc"
include "~/.nano/jade.nanorc"
include "~/.nano/java.nanorc" include "~/.nano/java.nanorc"
include "~/.nano/javascript.nanorc" include "~/.nano/javascript.nanorc"
include "~/.nano/js.nanorc" include "~/.nano/js.nanorc"
@ -60,6 +61,7 @@ include "~/.nano/po.nanorc"
include "~/.nano/pov.nanorc" include "~/.nano/pov.nanorc"
include "~/.nano/privoxy.nanorc" include "~/.nano/privoxy.nanorc"
include "~/.nano/puppet.nanorc" include "~/.nano/puppet.nanorc"
include "~/.nano/pug.nanorc"
include "~/.nano/python.nanorc" include "~/.nano/python.nanorc"
include "~/.nano/reST.nanorc" include "~/.nano/reST.nanorc"
include "~/.nano/rpmspec.nanorc" include "~/.nano/rpmspec.nanorc"

45
pug.nanorc Normal file
View File

@ -0,0 +1,45 @@
syntax "Pug" "\.pug$"
# Elements
color yellow "^\s*([a-z0-9]+)"
# Main elements
color red "^\s*(html|head|body)"
# Includes
icolor magenta "^\s*(include)"
# Variables
color brightblue "^\s*(\-)\s(var)\s([a-z0-9]+)"
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"
# For loops
icolor magenta "^\s*-\s(for)"
# Each
icolor magenta "^\s*(each)$" "^\s*(each)\s"
# Parenthesis content
color blue start="\(" end="\)"
# Strings
color cyan "('[^']*')|(\"[^\"]*\")"
# Parenthesis, commas, equals
icolor green "\(" "\)" "\," "\="
# Comments, dashes and spaces
color blue "\s+(//.*)"
color blue start="/\*" end="\*/"
color white "^\s*(\-)"
color ,green "[[:space:]]+$"
# Unbuffered comments
color brightblue "\s+(//-.*)"
# HTML-style conditional comments
color brightmagenta start="<!" end="!>"
color brightmagenta "<!\[endif\]-->"
# HTML-style elements
color yellow "<([^!].*)>"
# Pipes
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"