aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMark Lodato2021-02-23 20:57:53 -0500
committerWolfgang Müller2021-03-17 17:38:29 +0100
commitf5db8a897f1eb01db88ee5579d7c5fff780afed0 (patch)
tree933d6720d2a39e690002f11c525e7175cb9864ea
parent06b6b7013141553ba88e279622709101f500fa86 (diff)
downloadvim-beancount-f5db8a897f1eb01db88ee5579d7c5fff780afed0.tar.gz
add commodity directive
-rw-r--r--syntax/beancount.vim4
1 files changed, 3 insertions, 1 deletions
diff --git a/syntax/beancount.vim b/syntax/beancount.vim
index 3b3233c..03caf8c 100644
--- a/syntax/beancount.vim
+++ b/syntax/beancount.vim
@@ -26,7 +26,7 @@ syn match beanFlag "\v[*!&#?%PSTCURM]\s\@=" contained
" Most directives start with a date.
syn match beanDate "^\v\d{4}[-/]\d{2}[-/]\d{2}" skipwhite
- \ nextgroup=beanOpen,beanTxn,beanClose,beanNote,beanBalance,beanEvent,beanPad,beanPrice
+ \ nextgroup=beanOpen,beanTxn,beanClose,beanCommodity,beanNote,beanBalance,beanEvent,beanPad,beanPrice
" Options and events have two string arguments. The first, we are matching as
" beanOptionTitle and the second as a regular string.
syn region beanOption matchgroup=beanKeyword start="^option" end="$"
@@ -43,6 +43,8 @@ syn region beanOpen matchgroup=beanKeyword start="open" end="$" keepend
\ contained contains=beanAccount,beanCurrency,beanComment
syn region beanClose matchgroup=beanKeyword start="close" end="$" keepend
\ contained contains=beanAccount,beanComment
+syn region beanCommodity matchgroup=beanKeyword start="commodity" end="$" keepend
+ \ contained contains=beanCurrency,beanComment
syn region beanNote matchgroup=beanKeyword start="\vnote|document" end="$"
\ keepend contains=beanAccount,beanString,beanComment contained
syn region beanBalance matchgroup=beanKeyword start="balance" end="$" contained