From 4ab01ff80d0f7eedf228fb5275fa29df0f6d54f8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Beno=C3=AEt=20Laurent?= Date: Sat, 9 May 2015 22:00:50 +0200 Subject: [PATCH 2/2] Use named colors in highlighting configuration for markup languages. --- rc/asciidoc.kak | 39 +++++++++++++++++++++++++++------------ rc/markdown.kak | 18 +++++++++--------- share/kak/kakrc | 14 ++++++++++++++ 3 files changed, 50 insertions(+), 21 deletions(-) diff --git a/rc/asciidoc.kak b/rc/asciidoc.kak index 33168192..af7e42e5 100644 --- a/rc/asciidoc.kak +++ b/rc/asciidoc.kak @@ -1,17 +1,32 @@ +# http://asciidoc.org/ +# ‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾ + +# Detection +# ‾‾‾‾‾‾‾‾‾ + hook global BufCreate .*\.asciidoc %{ set buffer filetype asciidoc } -addhl -group / group asciidoc -addhl -group /asciidoc regex (\A|\n\n)[^\n]+\n={2,}\h*\n\h*$ 0:blue -addhl -group /asciidoc regex (\A|\n\n)[^\n]+\n-{2,}\h*\n\h*$ 0:cyan -addhl -group /asciidoc regex (\A|\n\n)[^\n]+\n~{2,}\h*\n\h*$ 0:green -addhl -group /asciidoc regex (\A|\n\n)[^\n]+\n\^{2,}\h*\n\h*$ 0:yellow -addhl -group /asciidoc regex ^\h+([-\*])\h+[^\n]*(\n\h+[^-\*]\S+[^\n]*)*$ 0:yellow 1:cyan -addhl -group /asciidoc regex ^([-=~]+)\n[^\n\h].*?\n\1$ 0:magenta -addhl -group /asciidoc regex (? 0:cyan +addhl -group /markdown/content regex ^\h+([-\*])\h+[^\n]*(\n\h+[^-\*]\S+[^\n]*)*$ 0:list 1:bullet +addhl -group /markdown/content regex ^([-=~]+)\n[^\n\h].*?\n\1$ 0:block +addhl -group /markdown/content regex (? 0:link addhl -group /markdown/content regex ^\h*(>\h*)+ 0:comment addhl -group /markdown/content regex \H\K\h\h$ 0:PrimarySelection diff --git a/share/kak/kakrc b/share/kak/kakrc index 2e93a925..7acb21cf 100644 --- a/share/kak/kakrc +++ b/share/kak/kakrc @@ -1,4 +1,6 @@ # define color scheme +# +# For Code face value red face type yellow face identifier green @@ -10,6 +12,18 @@ face attribute green face comment cyan face meta magenta +# For markup +face title blue +face header cyan +face bold red +face italic yellow +face mono green +face block magenta +face meta blue +face link cyan +face bullet cyan +face list yellow + def -shell-params runtime %{ %sh{ while [ $# -gt 0 ]; do echo "source '${kak_runtime}/$1'"