mirror of
https://github.com/scopatz/nanorc
synced 2025-02-20 00:00:05 +01:00
Improved and separated ledger and beancount syntaxes
This commit is contained in:
parent
1aa64a86cf
commit
cf786ed5a2
20
beancount.nanorc
Normal file
20
beancount.nanorc
Normal file
@ -0,0 +1,20 @@
|
|||||||
|
syntax "Beancount" "(^|\.|/)beancount|bnct|bc$"
|
||||||
|
|
||||||
|
# directives
|
||||||
|
color red "^([0-9]{4}-[0-9]{2}-[0-9]{2} | )?[a-z-]+( |: )"
|
||||||
|
# dates
|
||||||
|
color blue "^[0-9]{4}-[0-9]{2}-[0-9]{2}"
|
||||||
|
# tags
|
||||||
|
color green "#\S+"
|
||||||
|
# links
|
||||||
|
color blue "\^\S+"
|
||||||
|
# accounts
|
||||||
|
color cyan "(\t| )\b\w*-?\w*(:\w*-?\w*){1,}\b"
|
||||||
|
# currencies and stocks
|
||||||
|
color cyan "\b[A-Z]+\b"
|
||||||
|
# double quotes and transaction flags
|
||||||
|
color red "[*!@\"]"
|
||||||
|
# text within double quotes
|
||||||
|
color pink "\"(.*?)\""
|
||||||
|
# comments
|
||||||
|
color brightblack "(^|\s);.*"
|
@ -1,10 +1,17 @@
|
|||||||
syntax "Ledger" "(^|\.|/)ledger|ldgr|beancount|bnct$"
|
syntax "Ledger" "(^|\.|/)ledger|ldgr|lg$"
|
||||||
|
|
||||||
color brightmagenta "^([0-9]{4}(/|-)[0-9]{2}(/|-)[0-9]{2}|[=~]) .*"
|
# descriptions
|
||||||
color blue "^[0-9]{4}(/|-)[0-9]{2}(/|-)[0-9]{2}"
|
color brightmagenta "^(([0-9]{4}(/|-|.))?[0-9]{2}(/|-|.)[0-9]{2}|[=~]) .*"
|
||||||
|
# dates
|
||||||
|
color blue "^([0-9]{4}(\/|-|.))?[0-9]{2}(\/|-|.)[0-9]{2}"
|
||||||
|
# balance
|
||||||
color brightyellow "^~ .*"
|
color brightyellow "^~ .*"
|
||||||
color brightblue "^= .*"
|
color brightblue "^= .*"
|
||||||
color cyan "^[[:space:]]+(![[:space:]]+)?\(?[A-Za-z ]+(:[A-Za-z ]+)*\)?"
|
# accounts
|
||||||
color cyan "^[[:space:]]+(![[:space:]]+)?\(?[A-Za-z_-]+(:[A-Za-z_-]+)*\)?"
|
color cyan "(\t| )\b\w*\ ?\w*(:\w*\ ?\w*\w*){1,}\b"
|
||||||
color red "[*!]"
|
# double quotes and transaction flags
|
||||||
color brightblack "^[[:space:]]*;.*"
|
color red "[*!@\"]"
|
||||||
|
# text within double quotes
|
||||||
|
color pink "\"(.*?)\""
|
||||||
|
# comments
|
||||||
|
color brightblack "(^|\s)(;|#|%|\|).*"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user