Skip to content

Instantly share code, notes, and snippets.

@brainary
Created April 3, 2022 17:57
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Embed
What would you like to do?
First attempt of syntax-highlighting of [x]it! on Nano
syntax "xit" "\.xit$"
tabgives " "
## Not matched - Errors
color ,red "^.*$"
## Headlines
# Version 5+
color bold,normal "^[a-zA-Z0-9][a-zA-Z0-9 ]*$"
# Version 4
#color normal "^[a-zA-Z0-9][a-zA-Z0-9 ]*$"
## Description
# Active
color normal start="^\[ \] .*$" end="(^\[(x|@|~)\]|^$)"
# Done
color brightblack start="^\[x\] .*$" end="(^\[( |@|~)\]|^$)"
# Ongoing
color normal start="^\[@\] .*$" end="(^\[( |x|~)\]|^$)"
# Obsolete
color brightblack start="^\[~\] .*$" end="(^\[( |x|@)\]|^$)"
## Priorities
color red "^\[( |x|@|~)\] (!*\.*|\.*!*) "
## Checkboxes
# Active
color brightcyan "^\[ \] "
# Done
color brightgreen "^\[x\] "
# Ongoing
color brightmagenta "^\[@\] "
# Obsolete
color brightblack "^\[~\] "
## Due Dates
color brightyellow "-> [0-9]{4}((-|/)(W[0-9]+|Q[0-9]|[0-9]{2}((-|/)([0-9]{2}))?))?"
## Tags
color cyan "#[A-Za-z0-9]+"
color cyan "#[A-Za-z0-9]+=[A-Za-z0-9]+"
color cyan "#[A-Za-z0-9]+=\"[^\"]+\""
color cyan "#[A-Za-z0-9]+='[^']+'"
## Errors Override
color ,red "^[ ]{1,3}[^ ]*$"
@jotaen
Copy link

jotaen commented Apr 3, 2022

For reference, the original discussion.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment