Syntax highlight and correctly format/manipulate lists

Adds support for syntax highlighting and formatting both ordered and
unordered lists (excluding unordered lists delimited with `*`, as they
conflict with headings and are generally not recommended).

e.g.

    1. Foo
    2. Bar
       1) Biz
       2) Baz

    - Foo
      - Bar
    + Biz
      + Baz
This commit is contained in:
Alex Vear
2020-02-15 02:12:12 +00:00
parent b24dfe0762
commit d671e862e4
3 changed files with 11 additions and 1 deletions

View File

@@ -85,6 +85,13 @@ highlight def link orgTodo Todo
highlight def link orgTag Type
" Lists
syntax match orgUnorderedListMarker "^\s*[-+]\s\+" keepend contains=@Spell
syntax match orgOrderedListMarker "^\s*\d\+[.)]\s\+" keepend contains=@Spell
highlight def link orgUnorderedListMarker Statement
highlight def link orgOrderedListMarker orgUnorderedListMarker
" Timestamps
syntax match orgTimestampActive /<\d\{4}-\d\{2}-\d\{2}.\{-}>/ keepend
syntax match orgTimestampInactive /\[\d\{4}-\d\{2}-\d\{2}.\{-}\]/ keepend