kakoune/rc/asciidoc.kak

33 lines
1.2 KiB
Plaintext
Raw Normal View History

# http://asciidoc.org/
# ‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾
# Detection
# ‾‾‾‾‾‾‾‾‾
hook global BufCreate .*\.asciidoc %{ set buffer filetype asciidoc }
# Highlighters
# ‾‾‾‾‾‾‾‾‾‾‾‾
2014-06-12 22:52:23 +02:00
addhl -group / group asciidoc
addhl -group /asciidoc regex (\A|\n\n)[^\n]+\n={2,}\h*\n\h*$ 0:title
addhl -group /asciidoc regex (\A|\n\n)[^\n]+\n-{2,}\h*\n\h*$ 0:header
addhl -group /asciidoc regex (\A|\n\n)[^\n]+\n~{2,}\h*\n\h*$ 0:header
addhl -group /asciidoc regex (\A|\n\n)[^\n]+\n\^{2,}\h*\n\h*$ 0:header
addhl -group /asciidoc regex ^\h+([-\*])\h+[^\n]*(\n\h+[^-\*]\S+[^\n]*)*$ 0:list 1:bullet
addhl -group /asciidoc regex ^([-=~]+)\n[^\n\h].*?\n\1$ 0:block
addhl -group /asciidoc regex (?<!\w)\+[^\n]+?\+(?!\w) 0:mono
addhl -group /asciidoc regex (?<!\w)_[^\n]+?_(?!\w) 0:italic
addhl -group /asciidoc regex (?<!\w)\*[^\n]+?\*(?!\w) 0:bold
addhl -group /asciidoc regex ^:[-\w]+: 0:meta
# Commands
# ‾‾‾‾‾‾‾‾
# Initialization
# ‾‾‾‾‾‾‾‾‾‾‾‾‾‾
#
hook global WinSetOption filetype=asciidoc %{ addhl ref asciidoc }
hook global WinSetOption filetype=(?!asciidoc).* %{ rmhl asciidoc }