From acaa77a1da7d2ea071eb52121442aff51b665ad2 Mon Sep 17 00:00:00 2001 From: Andrey Orst Date: Tue, 2 Apr 2019 15:07:38 +0300 Subject: [PATCH 01/56] add initial org mode syntax highlighting script, based on markdown.kak --- rc/filetype/org.kak | 63 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 63 insertions(+) create mode 100644 rc/filetype/org.kak diff --git a/rc/filetype/org.kak b/rc/filetype/org.kak new file mode 100644 index 0000000000..a1c3d15189 --- /dev/null +++ b/rc/filetype/org.kak @@ -0,0 +1,63 @@ +# http://daringfireball.net/projects/org +# ‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾ + +# Detection +# ‾‾‾‾‾‾‾‾‾ + +hook global BufCreate .*[.]org %{ + set-option buffer filetype org +} + +# Highlighters +# ‾‾‾‾‾‾‾‾‾‾‾‾ + +add-highlighter shared/org regions +add-highlighter shared/org/inline default-region regions +add-highlighter shared/org/inline/text default-region group + +#+BEGIN_SRC c + +#+END_SRC +evaluate-commands %sh{ + languages=" + c cabal clojure coffee cpp css cucumber d diff dockerfile fish gas go + haml haskell html ini java javascript json julia kak kickstart latex + lisp lua makefile org moon objc perl pug python ragel ruby rust + sass scala scss sh swift toml tupfile typescript yaml sql + " + for lang in ${languages}; do + printf 'add-highlighter shared/org/%s region ^(\h*)#\+(?i)BEGIN_SRC(?I)\h+%s\b ^(\h*)#\+(?i)END_SRC regions\n' "${lang}" "${lang}" + printf 'add-highlighter shared/org/%s/ default-region fill meta\n' "${lang}" + done +} + +add-highlighter shared/org/codeblock region ^(\h*)(?i)#\+BEGIN_EXAMPLE\h* ^(\h*)(?i)#\+END_EXAMPLE\h*$ fill meta + +add-highlighter shared/org/listblock region ^\h*[-*]\s ^\h*((?=[-*])|$) regions +add-highlighter shared/org/listblock/marker region \A [-*]\s fill bullet +add-highlighter shared/org/listblock/content default-region ref org/inline + +# Setext-style header +# add-highlighter shared/org/inline/text/ regex (\A|\n\n)[^\n]+\n={2,}\h*\n\h*$ 0:title +# add-highlighter shared/org/inline/text/ regex (\A|\n\n)[^\n]+\n-{2,}\h*\n\h*$ 0:header + +# Atx-style header +# add-highlighter shared/org/inline/text/ regex ^#[^\n]* 0:header + +add-highlighter shared/org/inline/text/intalic regex \W*/([^\s].+[^\s])/\W 1:default,default+i +add-highlighter shared/org/inline/text/verbatim regex \W*=([^\s].+[^\s])=\W 1:meta +add-highlighter shared/org/inline/text/code regex \W*~([^\s].+[^\s])~\W 1:mono +# add-highlighter shared/org/inline/text/ regex \s*\+[^\s][^\n+]+[^\s]\+\s 0:default,default+s +add-highlighter shared/org/inline/text/underlined regex \W*_([^\s].+[^\s])_\W 1:default,default+u +add-highlighter shared/org/inline/text/bold regex \W*\*([^\s].+[^\s])\*\W 1:default,default+b +add-highlighter shared/org/inline/text/ regex \[[^\n]+\]\] 0:link +# add-highlighter shared/org/inline/text/ regex ^\h*(>\h*)+ 0:comment + +# Initialization +# ‾‾‾‾‾‾‾‾‾‾‾‾‾‾ + +hook -group org-highlight global WinSetOption filetype=org %{ + add-highlighter window/org ref org + hook -once -always window WinSetOption filetype=.* %{ remove-highlighter window/org } +} + From 3c9b85b6112830e595046f7e5edae987e4e531cf Mon Sep 17 00:00:00 2001 From: Andrey Orst Date: Wed, 3 Apr 2019 16:00:39 +0300 Subject: [PATCH 02/56] fix src_blocks, add list highlighting --- rc/filetype/org.kak | 45 ++++++++++++++++++++++----------------------- 1 file changed, 22 insertions(+), 23 deletions(-) diff --git a/rc/filetype/org.kak b/rc/filetype/org.kak index a1c3d15189..8d578b3537 100644 --- a/rc/filetype/org.kak +++ b/rc/filetype/org.kak @@ -15,41 +15,40 @@ add-highlighter shared/org regions add-highlighter shared/org/inline default-region regions add-highlighter shared/org/inline/text default-region group -#+BEGIN_SRC c - -#+END_SRC evaluate-commands %sh{ - languages=" - c cabal clojure coffee cpp css cucumber d diff dockerfile fish gas go - haml haskell html ini java javascript json julia kak kickstart latex - lisp lua makefile org moon objc perl pug python ragel ruby rust - sass scala scss sh swift toml tupfile typescript yaml sql - " - for lang in ${languages}; do - printf 'add-highlighter shared/org/%s region ^(\h*)#\+(?i)BEGIN_SRC(?I)\h+%s\b ^(\h*)#\+(?i)END_SRC regions\n' "${lang}" "${lang}" - printf 'add-highlighter shared/org/%s/ default-region fill meta\n' "${lang}" - done + languages=" + c cabal clojure coffee cpp css cucumber d diff dockerfile fish gas go + haml haskell html ini java javascript json julia kak kickstart latex + lisp lua makefile org moon objc perl pug python ragel ruby rust + sass scala scss sh swift toml tupfile typescript yaml sql + " + for lang in ${languages}; do + printf "%s\n" "add-highlighter shared/org/${lang} region '#\\+BEGIN_SRC\\h+${lang}\\b' '#\\+END_SRC' regions" + printf "%s\n" "add-highlighter shared/org/${lang}/ default-region fill meta" + [ "${lang}" = kak ] && ref=kakrc || ref="${lang}" + printf "%s\n" "add-highlighter shared/org/${lang}/inner region \\A#\\+BEGIN_SRC[^\n]*\\K '(?=#\\+END_SRC)' ref ${ref}" + done } -add-highlighter shared/org/codeblock region ^(\h*)(?i)#\+BEGIN_EXAMPLE\h* ^(\h*)(?i)#\+END_EXAMPLE\h*$ fill meta +add-highlighter shared/org/codeblock region ^(\h*)(?i)#\+BEGIN_SRC(\h+|\n) ^(\h*)(?i)#\+END_SRC\h*$ fill meta +add-highlighter shared/org/exampleblock region ^(\h*)(?i)#\+BEGIN_EXAMPLE(\h+|\n) ^(\h*)(?i)#\+END_EXAMPLE\h*$ fill meta -add-highlighter shared/org/listblock region ^\h*[-*]\s ^\h*((?=[-*])|$) regions -add-highlighter shared/org/listblock/marker region \A [-*]\s fill bullet -add-highlighter shared/org/listblock/content default-region ref org/inline +# Unordered list items start with `-', `+', or `*' +add-highlighter shared/org/inline/text/unordered-lists regex ^(?:\h*)([-+]) 1:bullet +add-highlighter shared/org/inline/text/star-list regex ^(?:\h+)([*]) 1:bullet -# Setext-style header -# add-highlighter shared/org/inline/text/ regex (\A|\n\n)[^\n]+\n={2,}\h*\n\h*$ 0:title -# add-highlighter shared/org/inline/text/ regex (\A|\n\n)[^\n]+\n-{2,}\h*\n\h*$ 0:header +# Ordered list items start with a numeral followed by either a period or a right parenthesis, such as `1.' or `1)' +add-highlighter shared/org/inline/text/ordered-lists regex ^(?:\h*)(\d+[.)]) 1:bullet -# Atx-style header -# add-highlighter shared/org/inline/text/ regex ^#[^\n]* 0:header +# Headings +add-highlighter shared/org/inline/text/ regex ^[*]+\h+[^\n]* 0:header add-highlighter shared/org/inline/text/intalic regex \W*/([^\s].+[^\s])/\W 1:default,default+i add-highlighter shared/org/inline/text/verbatim regex \W*=([^\s].+[^\s])=\W 1:meta add-highlighter shared/org/inline/text/code regex \W*~([^\s].+[^\s])~\W 1:mono # add-highlighter shared/org/inline/text/ regex \s*\+[^\s][^\n+]+[^\s]\+\s 0:default,default+s add-highlighter shared/org/inline/text/underlined regex \W*_([^\s].+[^\s])_\W 1:default,default+u -add-highlighter shared/org/inline/text/bold regex \W*\*([^\s].+[^\s])\*\W 1:default,default+b +add-highlighter shared/org/inline/text/bold regex \W*\*([^\s*].+[^\s])\*\W 1:default,default+b add-highlighter shared/org/inline/text/ regex \[[^\n]+\]\] 0:link # add-highlighter shared/org/inline/text/ regex ^\h*(>\h*)+ 0:comment From 7cf7dee94da3bfcb96d6f44da597860bf287f7b6 Mon Sep 17 00:00:00 2001 From: Andrey Orst Date: Wed, 3 Apr 2019 16:02:35 +0300 Subject: [PATCH 03/56] case-isensetive src blocks --- rc/filetype/org.kak | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/rc/filetype/org.kak b/rc/filetype/org.kak index 8d578b3537..ce4adb0f6f 100644 --- a/rc/filetype/org.kak +++ b/rc/filetype/org.kak @@ -23,10 +23,10 @@ evaluate-commands %sh{ sass scala scss sh swift toml tupfile typescript yaml sql " for lang in ${languages}; do - printf "%s\n" "add-highlighter shared/org/${lang} region '#\\+BEGIN_SRC\\h+${lang}\\b' '#\\+END_SRC' regions" + printf "%s\n" "add-highlighter shared/org/${lang} region '#\\+(?i)BEGIN_SRC(?I)\\h+${lang}\\b' '#\\+(?i)END_SRC' regions" printf "%s\n" "add-highlighter shared/org/${lang}/ default-region fill meta" [ "${lang}" = kak ] && ref=kakrc || ref="${lang}" - printf "%s\n" "add-highlighter shared/org/${lang}/inner region \\A#\\+BEGIN_SRC[^\n]*\\K '(?=#\\+END_SRC)' ref ${ref}" + printf "%s\n" "add-highlighter shared/org/${lang}/inner region \\A#\\+(?i)BEGIN_SRC(?I)[^\\n]*\\K '(?=#\\+(?i)END_SRC)' ref ${ref}" done } From 654ef9cdcb4b50eebd6fa655c0a8f78ebcc98948 Mon Sep 17 00:00:00 2001 From: Andrey Orst Date: Wed, 3 Apr 2019 16:03:09 +0300 Subject: [PATCH 04/56] remove unnedeed slashes --- rc/filetype/org.kak | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/rc/filetype/org.kak b/rc/filetype/org.kak index ce4adb0f6f..9d8163cd1d 100644 --- a/rc/filetype/org.kak +++ b/rc/filetype/org.kak @@ -23,10 +23,10 @@ evaluate-commands %sh{ sass scala scss sh swift toml tupfile typescript yaml sql " for lang in ${languages}; do - printf "%s\n" "add-highlighter shared/org/${lang} region '#\\+(?i)BEGIN_SRC(?I)\\h+${lang}\\b' '#\\+(?i)END_SRC' regions" + printf "%s\n" "add-highlighter shared/org/${lang} region '#\+(?i)BEGIN_SRC(?I)\h+${lang}\b' '#\+(?i)END_SRC' regions" printf "%s\n" "add-highlighter shared/org/${lang}/ default-region fill meta" [ "${lang}" = kak ] && ref=kakrc || ref="${lang}" - printf "%s\n" "add-highlighter shared/org/${lang}/inner region \\A#\\+(?i)BEGIN_SRC(?I)[^\\n]*\\K '(?=#\\+(?i)END_SRC)' ref ${ref}" + printf "%s\n" "add-highlighter shared/org/${lang}/inner region \A#\+(?i)BEGIN_SRC(?I)[^\n]*\K '(?=#\+(?i)END_SRC)' ref ${ref}" done } From 3afb5267a8f83d924d4a9c06128b0497b8efdc02 Mon Sep 17 00:00:00 2001 From: Andrey Orst Date: Thu, 4 Apr 2019 09:26:54 +0300 Subject: [PATCH 05/56] update regexes for inline formatting --- rc/filetype/org.kak | 54 +++++++++++++++++++++++++++++---------------- 1 file changed, 35 insertions(+), 19 deletions(-) diff --git a/rc/filetype/org.kak b/rc/filetype/org.kak index 9d8163cd1d..b82514345b 100644 --- a/rc/filetype/org.kak +++ b/rc/filetype/org.kak @@ -1,5 +1,5 @@ -# http://daringfireball.net/projects/org -# ‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾ +# https://orgmode.org/ - your life in plain text +# ‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾ # Detection # ‾‾‾‾‾‾‾‾‾ @@ -19,38 +19,54 @@ evaluate-commands %sh{ languages=" c cabal clojure coffee cpp css cucumber d diff dockerfile fish gas go haml haskell html ini java javascript json julia kak kickstart latex - lisp lua makefile org moon objc perl pug python ragel ruby rust + lisp emacs-lisp scheme lua makefile org moon objc perl pug python ragel ruby rust sass scala scss sh swift toml tupfile typescript yaml sql " for lang in ${languages}; do printf "%s\n" "add-highlighter shared/org/${lang} region '#\+(?i)BEGIN_SRC(?I)\h+${lang}\b' '#\+(?i)END_SRC' regions" printf "%s\n" "add-highlighter shared/org/${lang}/ default-region fill meta" - [ "${lang}" = kak ] && ref=kakrc || ref="${lang}" + case ${lang} in + kak) ref="kakrc" ;; + emacs-lisp) ref="lisp" ;; + *) ref="${lang}" ;; + esac printf "%s\n" "add-highlighter shared/org/${lang}/inner region \A#\+(?i)BEGIN_SRC(?I)[^\n]*\K '(?=#\+(?i)END_SRC)' ref ${ref}" done } -add-highlighter shared/org/codeblock region ^(\h*)(?i)#\+BEGIN_SRC(\h+|\n) ^(\h*)(?i)#\+END_SRC\h*$ fill meta -add-highlighter shared/org/exampleblock region ^(\h*)(?i)#\+BEGIN_EXAMPLE(\h+|\n) ^(\h*)(?i)#\+END_EXAMPLE\h*$ fill meta +# Comment +add-highlighter shared/org/comment region (^|\h)\K#[^+] $ fill comment + +# No-language SRC block +add-highlighter shared/org/src_block region ^(\h*)(?i)#\+BEGIN_SRC(\h+|\n) ^(\h*)(?i)#\+END_SRC\h*$ fill meta + +# Example block +add-highlighter shared/org/example_block region ^(\h*)(?i)#\+BEGIN_EXAMPLE(\h+|\n) ^(\h*)(?i)#\+END_EXAMPLE\h*$ fill mono + +# Small example block +add-highlighter shared/org/inline/text/example regex ^(\h*)[:]\h+[^\n]* 0:mono # Unordered list items start with `-', `+', or `*' -add-highlighter shared/org/inline/text/unordered-lists regex ^(?:\h*)([-+]) 1:bullet -add-highlighter shared/org/inline/text/star-list regex ^(?:\h+)([*]) 1:bullet +add-highlighter shared/org/inline/text/unordered-lists regex ^(?:\h*)([-+])\h+ 1:bullet +# But `*' list must be indented with at least single space, if not it is treated as a heading +add-highlighter shared/org/inline/text/star-list regex ^(?:\h+)([*])\h+ 1:bullet # Ordered list items start with a numeral followed by either a period or a right parenthesis, such as `1.' or `1)' -add-highlighter shared/org/inline/text/ordered-lists regex ^(?:\h*)(\d+[.)]) 1:bullet +add-highlighter shared/org/inline/text/ordered-lists regex ^(?:\h*)(\d+[.)])\h+ 1:bullet # Headings -add-highlighter shared/org/inline/text/ regex ^[*]+\h+[^\n]* 0:header - -add-highlighter shared/org/inline/text/intalic regex \W*/([^\s].+[^\s])/\W 1:default,default+i -add-highlighter shared/org/inline/text/verbatim regex \W*=([^\s].+[^\s])=\W 1:meta -add-highlighter shared/org/inline/text/code regex \W*~([^\s].+[^\s])~\W 1:mono -# add-highlighter shared/org/inline/text/ regex \s*\+[^\s][^\n+]+[^\s]\+\s 0:default,default+s -add-highlighter shared/org/inline/text/underlined regex \W*_([^\s].+[^\s])_\W 1:default,default+u -add-highlighter shared/org/inline/text/bold regex \W*\*([^\s*].+[^\s])\*\W 1:default,default+b -add-highlighter shared/org/inline/text/ regex \[[^\n]+\]\] 0:link -# add-highlighter shared/org/inline/text/ regex ^\h*(>\h*)+ 0:comment +add-highlighter shared/org/inline/text/heading regex "^[*]+\h+[^\n]+" 0:header +add-highlighter shared/org/inline/text/italic regex "\s([/][^\s/].*?[^\s/]*?[/])\W" 1:default,default+i +add-highlighter shared/org/inline/text/verbatim regex "\s([=][^\s=].*?[^\s=]*?[=])\W" 1:meta +add-highlighter shared/org/inline/text/code regex "\s([~][^\s~].*?[^\s~]*?[~])\W" 1:mono +add-highlighter shared/org/inline/text/math regex "\s([$][^\s].*?[^\s]*?[$])\W" 1:mono +add-highlighter shared/org/inline/text/underlined regex "\s([_][^\s_].*?[^\s_]*?[_])\W" 1:default,default+u +add-highlighter shared/org/inline/text/bold regex "\s([*][^\s*].*?[^\s*]*?[*])\W" 1:default,default+b +add-highlighter shared/org/inline/text/link regex "\[[^\n]+\]\]" 0:link +add-highlighter shared/org/inline/text/option regex "(?i)#\+[a-z]\w*\b" 0:meta + +# Strikethrough highlighter is disabled because Kakoune doesn't support strikethrough attribute +# add-highlighter shared/org/inline/text/strikethrough regex "\W*\+[^\s][^\n+]+[^\s]\+\W" 0:default,default+s # Initialization # ‾‾‾‾‾‾‾‾‾‾‾‾‾‾ From e806a34d616f6389989cefd967d6a65fe0f6b259 Mon Sep 17 00:00:00 2001 From: Andrey Orst Date: Thu, 4 Apr 2019 19:55:15 +0300 Subject: [PATCH 06/56] use builtin faces for bold, italics, and underline. use add underline face to themes --- colors/base16.kak | 5 +++-- colors/default.kak | 5 +++-- colors/desertex.kak | 19 ++++++++++--------- colors/github.kak | 5 +++-- colors/gruvbox.kak | 1 + colors/lucius.kak | 5 +++-- colors/palenight.kak | 19 ++++++++++--------- colors/red-phoenix.kak | 5 +++-- colors/reeder.kak | 1 + colors/solarized-dark-termcolors.kak | 1 + colors/solarized-dark.kak | 1 + colors/solarized-light-termcolors.kak | 1 + colors/solarized-light.kak | 1 + colors/tomorrow-night.kak | 5 +++-- colors/zenburn.kak | 5 +++-- rc/filetype/org.kak | 12 ++++++------ 16 files changed, 53 insertions(+), 38 deletions(-) diff --git a/colors/base16.kak b/colors/base16.kak index 677d35b75b..3311552cd0 100644 --- a/colors/base16.kak +++ b/colors/base16.kak @@ -36,8 +36,9 @@ evaluate-commands %sh{ echo " face global title blue face global header ${cyan_light} - face global bold ${orange_light} - face global italic ${orange_dark} + face global bold ${orange_light}+b + face global italic ${orange_dark}+i + face global underline ${magenta_dark}+u face global mono ${green_dark} face global block ${orange_dark} face global link blue diff --git a/colors/default.kak b/colors/default.kak index eb101049ee..32bcaa87f7 100644 --- a/colors/default.kak +++ b/colors/default.kak @@ -17,8 +17,9 @@ face global builtin default+b # For markup face global title blue face global header cyan -face global bold red -face global italic yellow +face global bold red+b +face global italic yellow+i +face global underline blue+u face global mono green face global block magenta face global link cyan diff --git a/colors/desertex.kak b/colors/desertex.kak index b30efbf67d..f5b6314770 100644 --- a/colors/desertex.kak +++ b/colors/desertex.kak @@ -15,15 +15,16 @@ face global comment rgb:7ccd7c+i face global meta rgb:ee799f # Markup -face global title blue -face global header cyan -face global bold red -face global italic yellow -face global mono green -face global block magenta -face global link cyan -face global bullet cyan -face global list yellow +face global title blue +face global header cyan +face global bold red+b +face global italic yellow+i +face global underline blue+u +face global mono green +face global block magenta +face global link cyan +face global bullet cyan +face global list yellow # Builtin # fg,bg+attributes diff --git a/colors/github.kak b/colors/github.kak index f685553b3e..85d9c0b86d 100644 --- a/colors/github.kak +++ b/colors/github.kak @@ -20,8 +20,9 @@ face global builtin default+b ## markup face global title blue face global header cyan -face global bold red -face global italic yellow +face global bold red+b +face global italic yellow+i +face global underline blue+u face global mono green face global block magenta face global link cyan diff --git a/colors/gruvbox.kak b/colors/gruvbox.kak index d2613e4624..38e97aa17e 100644 --- a/colors/gruvbox.kak +++ b/colors/gruvbox.kak @@ -42,6 +42,7 @@ evaluate-commands %sh{ face global header ${orange} face global bold ${fg}+b face global italic ${fg}+i + face global underline ${fg}+u face global mono ${fg4} face global block ${aqua} face global link ${blue}+u diff --git a/colors/lucius.kak b/colors/lucius.kak index 7bba885dfe..59dc5c0d4c 100644 --- a/colors/lucius.kak +++ b/colors/lucius.kak @@ -40,8 +40,9 @@ evaluate-commands %sh{ # and markup face global title ${lucius_light_blue} face global header ${lucius_light_green} - face global bold ${lucius_blue} - face global italic ${lucius_green} + face global bold ${lucius_blue}+b + face global italic ${lucius_light_grey}+i + face global underline ${lucius_green}+u face global mono ${lucius_light_green} face global block ${lucius_light_blue} face global link ${lucius_light_green} diff --git a/colors/palenight.kak b/colors/palenight.kak index a7fff18c88..a0c47c7267 100644 --- a/colors/palenight.kak +++ b/colors/palenight.kak @@ -41,15 +41,16 @@ evaluate-commands %sh{ face global meta $yellow # Markup - face global title $blue - face global header $cyan - face global bold $red - face global italic $yellow - face global mono $green - face global block $purple - face global link $cyan - face global bullet $cyan - face global list $yellow + face global title $blue + face global header $cyan + face global bold $red+b + face global italic $yellow+i + face global underline $blue+u + face global mono $green + face global block $purple + face global link $cyan + face global bullet $cyan + face global list $yellow # Builtin face global Default $white,$black diff --git a/colors/red-phoenix.kak b/colors/red-phoenix.kak index 9573edfb4b..172228924b 100644 --- a/colors/red-phoenix.kak +++ b/colors/red-phoenix.kak @@ -51,8 +51,9 @@ evaluate-commands %sh{ echo " face global title blue face global header ${orange1} - face global bold ${orange2} - face global italic ${orange3} + face global bold ${orange2}+b + face global italic ${orange3}+i + face global underline ${orange3}+u face global mono ${yellow1} face global block ${tan1} face global link blue diff --git a/colors/reeder.kak b/colors/reeder.kak index a4fd06a6fe..f683ace370 100644 --- a/colors/reeder.kak +++ b/colors/reeder.kak @@ -40,6 +40,7 @@ evaluate-commands %sh{ face global header ${orange}+b face global bold default+b face global italic default+i + face global underline default+u face global mono ${green_light} face global block ${green} face global link ${orange} diff --git a/colors/solarized-dark-termcolors.kak b/colors/solarized-dark-termcolors.kak index ffb891f449..ffa91bb00e 100644 --- a/colors/solarized-dark-termcolors.kak +++ b/colors/solarized-dark-termcolors.kak @@ -20,6 +20,7 @@ face global title blue+b face global header blue face global bold bright-blue+b face global italic bright-blue+i +face global underline bright-blue+u face global mono bright-cyan face global block cyan face global link bright-cyan diff --git a/colors/solarized-dark.kak b/colors/solarized-dark.kak index cf1314f63d..41a94e16f7 100644 --- a/colors/solarized-dark.kak +++ b/colors/solarized-dark.kak @@ -38,6 +38,7 @@ evaluate-commands %sh{ face global header ${blue} face global bold ${base0}+b face global italic ${base0}+i + face global underline ${base0}+u face global mono ${base1} face global block ${cyan} face global link ${base1} diff --git a/colors/solarized-light-termcolors.kak b/colors/solarized-light-termcolors.kak index 07ded5a04f..0ccf5cc128 100644 --- a/colors/solarized-light-termcolors.kak +++ b/colors/solarized-light-termcolors.kak @@ -20,6 +20,7 @@ face global title blue+b face global header blue face global bold bright-green+b face global italic bright-green+i +face global underline bright-green+u face global mono bright-cyan face global block cyan face global link bright-green diff --git a/colors/solarized-light.kak b/colors/solarized-light.kak index 9402742a51..a2ea9b3c85 100644 --- a/colors/solarized-light.kak +++ b/colors/solarized-light.kak @@ -38,6 +38,7 @@ evaluate-commands %sh{ face global header ${blue} face global bold ${base01}+b face global italic ${base01}+i + face global underline ${base01}+u face global mono ${base1} face global block ${cyan} face global link ${base01} diff --git a/colors/tomorrow-night.kak b/colors/tomorrow-night.kak index 20a254801d..3c6d6bc624 100644 --- a/colors/tomorrow-night.kak +++ b/colors/tomorrow-night.kak @@ -41,8 +41,9 @@ evaluate-commands %sh{ echo " face global title blue face global header ${aqua} - face global bold ${yellow} - face global italic ${orange} + face global bold ${yellow}+b + face global italic ${orange}+i + face global underline ${blue}+u face global mono ${green_dark} face global block ${orange} face global link blue diff --git a/colors/zenburn.kak b/colors/zenburn.kak index a27c83201b..7c724568f0 100644 --- a/colors/zenburn.kak +++ b/colors/zenburn.kak @@ -47,8 +47,9 @@ evaluate-commands %sh{ # and markup face global title ${zenkeyword} face global header ${zenconstant} - face global bold ${zenstorageClass} - face global italic ${zenfunction} + face global bold ${zenstorageClass}+b + face global italic ${zenfunction}+i + face global underline ${zenvariable}+u face global mono ${zennumber} face global block ${zenstatement} face global link ${zenstring} diff --git a/rc/filetype/org.kak b/rc/filetype/org.kak index b82514345b..91280b3c39 100644 --- a/rc/filetype/org.kak +++ b/rc/filetype/org.kak @@ -55,15 +55,15 @@ add-highlighter shared/org/inline/text/star-list regex ^(?:\h+)([*])\h+ 1:bullet add-highlighter shared/org/inline/text/ordered-lists regex ^(?:\h*)(\d+[.)])\h+ 1:bullet # Headings -add-highlighter shared/org/inline/text/heading regex "^[*]+\h+[^\n]+" 0:header -add-highlighter shared/org/inline/text/italic regex "\s([/][^\s/].*?[^\s/]*?[/])\W" 1:default,default+i +add-highlighter shared/org/inline/text/heading regex "^[*]+\h+[^\n]+" 0:header +add-highlighter shared/org/inline/text/italic regex "\s([/][^\s/].*?[^\s/]*?[/])\W" 1:italic add-highlighter shared/org/inline/text/verbatim regex "\s([=][^\s=].*?[^\s=]*?[=])\W" 1:meta add-highlighter shared/org/inline/text/code regex "\s([~][^\s~].*?[^\s~]*?[~])\W" 1:mono add-highlighter shared/org/inline/text/math regex "\s([$][^\s].*?[^\s]*?[$])\W" 1:mono -add-highlighter shared/org/inline/text/underlined regex "\s([_][^\s_].*?[^\s_]*?[_])\W" 1:default,default+u -add-highlighter shared/org/inline/text/bold regex "\s([*][^\s*].*?[^\s*]*?[*])\W" 1:default,default+b -add-highlighter shared/org/inline/text/link regex "\[[^\n]+\]\]" 0:link -add-highlighter shared/org/inline/text/option regex "(?i)#\+[a-z]\w*\b" 0:meta +add-highlighter shared/org/inline/text/underlined regex "\s([_][^\s_].*?[^\s_]*?[_])\W" 1:underline +add-highlighter shared/org/inline/text/bold regex "\s([*][^\s*].*?[^\s*]*?[*])\W" 1:bold +add-highlighter shared/org/inline/text/link regex "\[[^\n]+\]\]" 0:link +add-highlighter shared/org/inline/text/option regex "(?i)#\+[a-z]\w*\b" 0:meta # Strikethrough highlighter is disabled because Kakoune doesn't support strikethrough attribute # add-highlighter shared/org/inline/text/strikethrough regex "\W*\+[^\s][^\n+]+[^\s]\+\W" 0:default,default+s From d26192fbc72246f7a1b3ece644d9abfa71b543fc Mon Sep 17 00:00:00 2001 From: Andrey Orst Date: Thu, 4 Apr 2019 20:04:18 +0300 Subject: [PATCH 07/56] add strikethrough highlighter for org. add strikethrough face to themes --- colors/base16.kak | 1 + colors/default.kak | 1 + colors/desertex.kak | 21 +++++++++++---------- colors/github.kak | 1 + colors/gruvbox.kak | 21 +++++++++++---------- colors/lucius.kak | 1 + colors/palenight.kak | 21 +++++++++++---------- colors/red-phoenix.kak | 1 + colors/reeder.kak | 21 +++++++++++---------- colors/solarized-dark-termcolors.kak | 1 + colors/solarized-dark.kak | 1 + colors/solarized-light-termcolors.kak | 1 + colors/solarized-light.kak | 1 + colors/tomorrow-night.kak | 1 + colors/zenburn.kak | 1 + rc/filetype/org.kak | 22 ++++++++++------------ 16 files changed, 65 insertions(+), 52 deletions(-) diff --git a/colors/base16.kak b/colors/base16.kak index 3311552cd0..fd0d668b04 100644 --- a/colors/base16.kak +++ b/colors/base16.kak @@ -39,6 +39,7 @@ evaluate-commands %sh{ face global bold ${orange_light}+b face global italic ${orange_dark}+i face global underline ${magenta_dark}+u + face global strikethrough ${cyan_light} face global mono ${green_dark} face global block ${orange_dark} face global link blue diff --git a/colors/default.kak b/colors/default.kak index 32bcaa87f7..573217043a 100644 --- a/colors/default.kak +++ b/colors/default.kak @@ -20,6 +20,7 @@ face global header cyan face global bold red+b face global italic yellow+i face global underline blue+u +face global strikethrough green face global mono green face global block magenta face global link cyan diff --git a/colors/desertex.kak b/colors/desertex.kak index f5b6314770..a56fd2167f 100644 --- a/colors/desertex.kak +++ b/colors/desertex.kak @@ -15,16 +15,17 @@ face global comment rgb:7ccd7c+i face global meta rgb:ee799f # Markup -face global title blue -face global header cyan -face global bold red+b -face global italic yellow+i -face global underline blue+u -face global mono green -face global block magenta -face global link cyan -face global bullet cyan -face global list yellow +face global title blue +face global header cyan +face global bold red+b +face global italic yellow+i +face global underline blue+u +face global strikethrough green +face global mono green +face global block magenta +face global link cyan +face global bullet cyan +face global list yellow # Builtin # fg,bg+attributes diff --git a/colors/github.kak b/colors/github.kak index 85d9c0b86d..f03496f06e 100644 --- a/colors/github.kak +++ b/colors/github.kak @@ -23,6 +23,7 @@ face global header cyan face global bold red+b face global italic yellow+i face global underline blue+u +face global strikethrough green face global mono green face global block magenta face global link cyan diff --git a/colors/gruvbox.kak b/colors/gruvbox.kak index 38e97aa17e..2a07154fcf 100644 --- a/colors/gruvbox.kak +++ b/colors/gruvbox.kak @@ -38,16 +38,17 @@ evaluate-commands %sh{ face global builtin ${fg}+b # Markdown highlighting - face global title ${green}+b - face global header ${orange} - face global bold ${fg}+b - face global italic ${fg}+i - face global underline ${fg}+u - face global mono ${fg4} - face global block ${aqua} - face global link ${blue}+u - face global bullet ${yellow} - face global list ${fg} + face global title ${green}+b + face global header ${orange} + face global bold ${fg}+b + face global italic ${fg}+i + face global underline ${fg}+u + face global strikethrough ${fg} + face global mono ${fg4} + face global block ${aqua} + face global link ${blue}+u + face global bullet ${yellow} + face global list ${fg} face global Default ${fg},${bg} face global PrimarySelection ${fg},${blue}+fg diff --git a/colors/lucius.kak b/colors/lucius.kak index 59dc5c0d4c..f51abf1264 100644 --- a/colors/lucius.kak +++ b/colors/lucius.kak @@ -43,6 +43,7 @@ evaluate-commands %sh{ face global bold ${lucius_blue}+b face global italic ${lucius_light_grey}+i face global underline ${lucius_green}+u + face global strikethrough ${lucius_dark_blue} face global mono ${lucius_light_green} face global block ${lucius_light_blue} face global link ${lucius_light_green} diff --git a/colors/palenight.kak b/colors/palenight.kak index a0c47c7267..a080aa8e09 100644 --- a/colors/palenight.kak +++ b/colors/palenight.kak @@ -41,16 +41,17 @@ evaluate-commands %sh{ face global meta $yellow # Markup - face global title $blue - face global header $cyan - face global bold $red+b - face global italic $yellow+i - face global underline $blue+u - face global mono $green - face global block $purple - face global link $cyan - face global bullet $cyan - face global list $yellow + face global title $blue + face global header $cyan + face global bold $red+b + face global italic $yellow+i + face global underline $blue+u + face global strikethrough $green + face global mono $green + face global block $purple + face global link $cyan + face global bullet $cyan + face global list $yellow # Builtin face global Default $white,$black diff --git a/colors/red-phoenix.kak b/colors/red-phoenix.kak index 172228924b..675b146938 100644 --- a/colors/red-phoenix.kak +++ b/colors/red-phoenix.kak @@ -54,6 +54,7 @@ evaluate-commands %sh{ face global bold ${orange2}+b face global italic ${orange3}+i face global underline ${orange3}+u + face global strikethrough ${orange1} face global mono ${yellow1} face global block ${tan1} face global link blue diff --git a/colors/reeder.kak b/colors/reeder.kak index f683ace370..459c961b55 100644 --- a/colors/reeder.kak +++ b/colors/reeder.kak @@ -36,16 +36,17 @@ evaluate-commands %sh{ face global builtin default+b # and markup - face global title ${orange}+b - face global header ${orange}+b - face global bold default+b - face global italic default+i - face global underline default+u - face global mono ${green_light} - face global block ${green} - face global link ${orange} - face global bullet ${brown_dark} - face global list ${black} + face global title ${orange}+b + face global header ${orange}+b + face global bold default+b + face global italic default+i + face global underline default+u + face global strikethrough default + face global mono ${green_light} + face global block ${green} + face global link ${orange} + face global bullet ${brown_dark} + face global list ${black} # and built in faces face global Default ${black_light},${white} diff --git a/colors/solarized-dark-termcolors.kak b/colors/solarized-dark-termcolors.kak index ffa91bb00e..db491550ac 100644 --- a/colors/solarized-dark-termcolors.kak +++ b/colors/solarized-dark-termcolors.kak @@ -21,6 +21,7 @@ face global header blue face global bold bright-blue+b face global italic bright-blue+i face global underline bright-blue+u +face global strikethrough bright-blue face global mono bright-cyan face global block cyan face global link bright-cyan diff --git a/colors/solarized-dark.kak b/colors/solarized-dark.kak index 41a94e16f7..6e685b16c5 100644 --- a/colors/solarized-dark.kak +++ b/colors/solarized-dark.kak @@ -39,6 +39,7 @@ evaluate-commands %sh{ face global bold ${base0}+b face global italic ${base0}+i face global underline ${base0}+u + face global strikethrough ${base0} face global mono ${base1} face global block ${cyan} face global link ${base1} diff --git a/colors/solarized-light-termcolors.kak b/colors/solarized-light-termcolors.kak index 0ccf5cc128..03dfa55036 100644 --- a/colors/solarized-light-termcolors.kak +++ b/colors/solarized-light-termcolors.kak @@ -21,6 +21,7 @@ face global header blue face global bold bright-green+b face global italic bright-green+i face global underline bright-green+u +face global strikethrough bright-green face global mono bright-cyan face global block cyan face global link bright-green diff --git a/colors/solarized-light.kak b/colors/solarized-light.kak index a2ea9b3c85..899d0b3240 100644 --- a/colors/solarized-light.kak +++ b/colors/solarized-light.kak @@ -39,6 +39,7 @@ evaluate-commands %sh{ face global bold ${base01}+b face global italic ${base01}+i face global underline ${base01}+u + face global strikethrough ${base01} face global mono ${base1} face global block ${cyan} face global link ${base01} diff --git a/colors/tomorrow-night.kak b/colors/tomorrow-night.kak index 3c6d6bc624..5f3bc04a28 100644 --- a/colors/tomorrow-night.kak +++ b/colors/tomorrow-night.kak @@ -44,6 +44,7 @@ evaluate-commands %sh{ face global bold ${yellow}+b face global italic ${orange}+i face global underline ${blue}+u + face global strikethrough ${red} face global mono ${green_dark} face global block ${orange} face global link blue diff --git a/colors/zenburn.kak b/colors/zenburn.kak index 7c724568f0..b6ddb970a7 100644 --- a/colors/zenburn.kak +++ b/colors/zenburn.kak @@ -50,6 +50,7 @@ evaluate-commands %sh{ face global bold ${zenstorageClass}+b face global italic ${zenfunction}+i face global underline ${zenvariable}+u + face global strikethrough ${zenfunction} face global mono ${zennumber} face global block ${zenstatement} face global link ${zenstring} diff --git a/rc/filetype/org.kak b/rc/filetype/org.kak index 91280b3c39..8b3fa25e43 100644 --- a/rc/filetype/org.kak +++ b/rc/filetype/org.kak @@ -55,18 +55,16 @@ add-highlighter shared/org/inline/text/star-list regex ^(?:\h+)([*])\h+ 1:bullet add-highlighter shared/org/inline/text/ordered-lists regex ^(?:\h*)(\d+[.)])\h+ 1:bullet # Headings -add-highlighter shared/org/inline/text/heading regex "^[*]+\h+[^\n]+" 0:header -add-highlighter shared/org/inline/text/italic regex "\s([/][^\s/].*?[^\s/]*?[/])\W" 1:italic -add-highlighter shared/org/inline/text/verbatim regex "\s([=][^\s=].*?[^\s=]*?[=])\W" 1:meta -add-highlighter shared/org/inline/text/code regex "\s([~][^\s~].*?[^\s~]*?[~])\W" 1:mono -add-highlighter shared/org/inline/text/math regex "\s([$][^\s].*?[^\s]*?[$])\W" 1:mono -add-highlighter shared/org/inline/text/underlined regex "\s([_][^\s_].*?[^\s_]*?[_])\W" 1:underline -add-highlighter shared/org/inline/text/bold regex "\s([*][^\s*].*?[^\s*]*?[*])\W" 1:bold -add-highlighter shared/org/inline/text/link regex "\[[^\n]+\]\]" 0:link -add-highlighter shared/org/inline/text/option regex "(?i)#\+[a-z]\w*\b" 0:meta - -# Strikethrough highlighter is disabled because Kakoune doesn't support strikethrough attribute -# add-highlighter shared/org/inline/text/strikethrough regex "\W*\+[^\s][^\n+]+[^\s]\+\W" 0:default,default+s +add-highlighter shared/org/inline/text/heading regex "^[*]+\h+[^\n]+" 0:header +add-highlighter shared/org/inline/text/italic regex "\s([/][^\s/].*?[^\s/]*?[/])\W" 1:italic +add-highlighter shared/org/inline/text/strikethrough regex "\s([+][^\s+].*?[^\s+]*?[+])\W" 1:strikethrough +add-highlighter shared/org/inline/text/verbatim regex "\s([=][^\s=].*?[^\s=]*?[=])\W" 1:meta +add-highlighter shared/org/inline/text/code regex "\s([~][^\s~].*?[^\s~]*?[~])\W" 1:mono +add-highlighter shared/org/inline/text/math regex "\s([$][^\s].*?[^\s]*?[$])\W" 1:mono +add-highlighter shared/org/inline/text/underlined regex "\s([_][^\s_].*?[^\s_]*?[_])\W" 1:underline +add-highlighter shared/org/inline/text/bold regex "\s([*][^\s*].*?[^\s*]*?[*])\W" 1:bold +add-highlighter shared/org/inline/text/link regex "\[[^\n]+\]\]" 0:link +add-highlighter shared/org/inline/text/option regex "(?i)#\+[a-z]\w*\b" 0:meta # Initialization # ‾‾‾‾‾‾‾‾‾‾‾‾‾‾ From f561fdfeb8b427470a85e3ff1ee4e18be40bf015 Mon Sep 17 00:00:00 2001 From: Andrey Orst Date: Wed, 10 Apr 2019 13:16:27 +0300 Subject: [PATCH 08/56] add more blocks --- rc/filetype/org.kak | 61 +++++++++++++++++++++++++++++---------------- 1 file changed, 40 insertions(+), 21 deletions(-) diff --git a/rc/filetype/org.kak b/rc/filetype/org.kak index 8b3fa25e43..113bb4fdac 100644 --- a/rc/filetype/org.kak +++ b/rc/filetype/org.kak @@ -16,16 +16,21 @@ add-highlighter shared/org/inline default-region regions add-highlighter shared/org/inline/text default-region group evaluate-commands %sh{ - languages=" - c cabal clojure coffee cpp css cucumber d diff dockerfile fish gas go - haml haskell html ini java javascript json julia kak kickstart latex - lisp emacs-lisp scheme lua makefile org moon objc perl pug python ragel ruby rust - sass scala scss sh swift toml tupfile typescript yaml sql - " + languages="arch-linux asciidoc cabal c cpp objc clojure + cmake coffee css cucumber dart diff d dockerfile + elixir elm etc exherbo fish gas git go haml haskell + hbs html i3 ini java javascript json julia justrc + kickstart latex lisp lua mail makefile markdown + mercurial moon nim ocaml org perl php pony protobuf + pug python ragel restructuredtext ruby rust sass + scala scheme scss sh sql swift systemd taskpaper + toml troff tupfile void-linux yaml" + for lang in ${languages}; do printf "%s\n" "add-highlighter shared/org/${lang} region '#\+(?i)BEGIN_SRC(?I)\h+${lang}\b' '#\+(?i)END_SRC' regions" printf "%s\n" "add-highlighter shared/org/${lang}/ default-region fill meta" case ${lang} in + # here we need to declare all workarounds for Org-mode supported languages kak) ref="kakrc" ;; emacs-lisp) ref="lisp" ;; *) ref="${lang}" ;; @@ -34,17 +39,25 @@ evaluate-commands %sh{ done } +# No-language SRC block +add-highlighter shared/org/src_block region ^(\h*)(?i)#\+BEGIN_SRC(\h+|\n) ^(\h*)(?i)#\+END_SRC\h*$ fill meta + # Comment add-highlighter shared/org/comment region (^|\h)\K#[^+] $ fill comment -# No-language SRC block -add-highlighter shared/org/src_block region ^(\h*)(?i)#\+BEGIN_SRC(\h+|\n) ^(\h*)(?i)#\+END_SRC\h*$ fill meta +# Table +add-highlighter shared/org/table region (^|\h)\K[|][^+] $ fill string -# Example block -add-highlighter shared/org/example_block region ^(\h*)(?i)#\+BEGIN_EXAMPLE(\h+|\n) ^(\h*)(?i)#\+END_EXAMPLE\h*$ fill mono + +# Various blocks +evaluate-commands %sh{ + blocks="EXAMPLE QUOTE EXPORT CENTER VERSE" + join() { sep=$2; eval set -- $1; IFS="$sep"; echo "$*"; } + printf "%s\n" "add-highlighter shared/org/block region -match-capture ^\h*(?i)#\+BEGIN_($(join "${blocks}" '|'))(\h+|\n) ^\h*(?i)#\+END_($(join "${blocks}" '|'))\h*$ fill meta" +} # Small example block -add-highlighter shared/org/inline/text/example regex ^(\h*)[:]\h+[^\n]* 0:mono +add-highlighter shared/org/inline/text/example regex ^(\h*)[:]\h+[^\n]* 0:meta # Unordered list items start with `-', `+', or `*' add-highlighter shared/org/inline/text/unordered-lists regex ^(?:\h*)([-+])\h+ 1:bullet @@ -55,16 +68,22 @@ add-highlighter shared/org/inline/text/star-list regex ^(?:\h+)([*])\h+ 1:bullet add-highlighter shared/org/inline/text/ordered-lists regex ^(?:\h*)(\d+[.)])\h+ 1:bullet # Headings -add-highlighter shared/org/inline/text/heading regex "^[*]+\h+[^\n]+" 0:header -add-highlighter shared/org/inline/text/italic regex "\s([/][^\s/].*?[^\s/]*?[/])\W" 1:italic -add-highlighter shared/org/inline/text/strikethrough regex "\s([+][^\s+].*?[^\s+]*?[+])\W" 1:strikethrough -add-highlighter shared/org/inline/text/verbatim regex "\s([=][^\s=].*?[^\s=]*?[=])\W" 1:meta -add-highlighter shared/org/inline/text/code regex "\s([~][^\s~].*?[^\s~]*?[~])\W" 1:mono -add-highlighter shared/org/inline/text/math regex "\s([$][^\s].*?[^\s]*?[$])\W" 1:mono -add-highlighter shared/org/inline/text/underlined regex "\s([_][^\s_].*?[^\s_]*?[_])\W" 1:underline -add-highlighter shared/org/inline/text/bold regex "\s([*][^\s*].*?[^\s*]*?[*])\W" 1:bold -add-highlighter shared/org/inline/text/link regex "\[[^\n]+\]\]" 0:link -add-highlighter shared/org/inline/text/option regex "(?i)#\+[a-z]\w*\b" 0:meta +add-highlighter shared/org/inline/text/heading regex "^[*]+\h+[^\n]+" 0:header + +# Options +add-highlighter shared/org/inline/text/option regex "(?i)#\+[a-z]\w*\b" 0:module + + +# Markup +add-highlighter shared/org/inline/text/italic regex "\s([/][^\s/].*?[^\s/]*?[/])\W" 1:italic +add-highlighter shared/org/inline/text/strikethrough regex "\s([+][^\s+].*?[^\s+]*?[+])\W" 1:strikethrough +add-highlighter shared/org/inline/text/verbatim regex "\s([=][^\s=].*?[^\s=]*?[=])\W" 1:meta +add-highlighter shared/org/inline/text/code regex "\s([~][^\s~].*?[^\s~]*?[~])\W" 1:mono +add-highlighter shared/org/inline/text/inline-math regex "\s([$][^\s$].*?[^\s$]*?[$])\W" 1:mono +add-highlighter shared/org/inline/text/math regex "\s([$]{2}[^\s].*?[^\s]*?[$]{2})\W" 1:mono +add-highlighter shared/org/inline/text/underlined regex "\s([_][^\s_].*?[^\s_]*?[_])\W" 1:underline +add-highlighter shared/org/inline/text/bold regex "\s([*][^\s*].*?[^\s*]*?[*])\W" 1:bold +add-highlighter shared/org/inline/text/link regex "\[[^\n]+\]\]" 0:link # Initialization # ‾‾‾‾‾‾‾‾‾‾‾‾‾‾ From ffac0013cf2c4b64382c8b62e463102d0a32ed35 Mon Sep 17 00:00:00 2001 From: Andrey Orst Date: Thu, 11 Apr 2019 15:15:45 +0300 Subject: [PATCH 09/56] provide indentation copying rules for lists --- rc/filetype/org.kak | 21 +++++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-) diff --git a/rc/filetype/org.kak b/rc/filetype/org.kak index 113bb4fdac..90a47fc53e 100644 --- a/rc/filetype/org.kak +++ b/rc/filetype/org.kak @@ -48,7 +48,6 @@ add-highlighter shared/org/comment region (^|\h)\K#[^+] $ fill comment # Table add-highlighter shared/org/table region (^|\h)\K[|][^+] $ fill string - # Various blocks evaluate-commands %sh{ blocks="EXAMPLE QUOTE EXPORT CENTER VERSE" @@ -61,6 +60,7 @@ add-highlighter shared/org/inline/text/example regex ^(\h*)[:]\h+[^\n]* 0:meta # Unordered list items start with `-', `+', or `*' add-highlighter shared/org/inline/text/unordered-lists regex ^(?:\h*)([-+])\h+ 1:bullet + # But `*' list must be indented with at least single space, if not it is treated as a heading add-highlighter shared/org/inline/text/star-list regex ^(?:\h+)([*])\h+ 1:bullet @@ -68,11 +68,10 @@ add-highlighter shared/org/inline/text/star-list regex ^(?:\h+)([*])\h+ 1:bullet add-highlighter shared/org/inline/text/ordered-lists regex ^(?:\h*)(\d+[.)])\h+ 1:bullet # Headings -add-highlighter shared/org/inline/text/heading regex "^[*]+\h+[^\n]+" 0:header +add-highlighter shared/org/inline/text/heading regex "^[*]+\h+[^\n]+" 0:header # Options -add-highlighter shared/org/inline/text/option regex "(?i)#\+[a-z]\w*\b" 0:module - +add-highlighter shared/org/inline/text/option regex "(?i)#\+[a-z]\w*\b" 0:module # Markup add-highlighter shared/org/inline/text/italic regex "\s([/][^\s/].*?[^\s/]*?[/])\W" 1:italic @@ -85,6 +84,16 @@ add-highlighter shared/org/inline/text/underlined regex "\s([_][^\s_].*?[^\s_ add-highlighter shared/org/inline/text/bold regex "\s([*][^\s*].*?[^\s*]*?[*])\W" 1:bold add-highlighter shared/org/inline/text/link regex "\[[^\n]+\]\]" 0:link +# Commands +# ‾‾‾‾‾‾‾‾ + +define-command -hidden org-indent-on-new-line %{ + evaluate-commands -draft -itersel %{ + # follow list item indentation and amount of leading whitespaces + try %{ execute-keys -draft '^\h*([-+]|\h+[*]|\d[.)])s^\h*([+-]|\h+[*][^*]|\d[.)])\h*y/^\nPxHr' } + } +} + # Initialization # ‾‾‾‾‾‾‾‾‾‾‾‾‾‾ @@ -93,3 +102,7 @@ hook -group org-highlight global WinSetOption filetype=org %{ hook -once -always window WinSetOption filetype=.* %{ remove-highlighter window/org } } +hook global WinSetOption filetype=org %{ + hook window InsertChar \n -group org-indent org-indent-on-new-line + hook -once -always window WinSetOption filetype=.* %{ remove-hooks window org-.+ } +} From 51ce3a1823cd7f140da41589c2196003f5c0c59c Mon Sep 17 00:00:00 2001 From: Andrey Orst Date: Thu, 11 Apr 2019 15:26:18 +0300 Subject: [PATCH 10/56] discard list indentation in case no text entered --- rc/filetype/org.kak | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/rc/filetype/org.kak b/rc/filetype/org.kak index 90a47fc53e..a83a2b1cac 100644 --- a/rc/filetype/org.kak +++ b/rc/filetype/org.kak @@ -90,7 +90,8 @@ add-highlighter shared/org/inline/text/link regex "\[[^\n]+\]\]" define-command -hidden org-indent-on-new-line %{ evaluate-commands -draft -itersel %{ # follow list item indentation and amount of leading whitespaces - try %{ execute-keys -draft '^\h*([-+]|\h+[*]|\d[.)])s^\h*([+-]|\h+[*][^*]|\d[.)])\h*y/^\nPxHr' } + try %{ execute-keys -draft 'ks\S^\h*([-+]|\h+[*]|\d[.)])s^\h*([+-]|\h+[*][^*]|\d[.)])\h*y/^\nPxHr' } + try %{ execute-keys -draft -itersel 'ks\h+$d' } } } From 32bb5772f5bec592bc6ab377693fac22bd2e6882 Mon Sep 17 00:00:00 2001 From: Andrey Orst Date: Thu, 11 Apr 2019 17:37:36 +0300 Subject: [PATCH 11/56] add emacs-lisp --- rc/filetype/org.kak | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/rc/filetype/org.kak b/rc/filetype/org.kak index a83a2b1cac..587bf19245 100644 --- a/rc/filetype/org.kak +++ b/rc/filetype/org.kak @@ -20,8 +20,8 @@ evaluate-commands %sh{ cmake coffee css cucumber dart diff d dockerfile elixir elm etc exherbo fish gas git go haml haskell hbs html i3 ini java javascript json julia justrc - kickstart latex lisp lua mail makefile markdown - mercurial moon nim ocaml org perl php pony protobuf + kickstart latex emacs-lisp lisp lua mail makefile markdown + mercurial moon nim ocaml perl php pony protobuf pug python ragel restructuredtext ruby rust sass scala scheme scss sh sql swift systemd taskpaper toml troff tupfile void-linux yaml" From 00cff94ad96965c75076d8ddb96d2df8ac294410 Mon Sep 17 00:00:00 2001 From: Andrey Orst Date: Thu, 11 Apr 2019 17:37:59 +0300 Subject: [PATCH 12/56] fix table being detected mid line --- rc/filetype/org.kak | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rc/filetype/org.kak b/rc/filetype/org.kak index 587bf19245..ef1136b7a4 100644 --- a/rc/filetype/org.kak +++ b/rc/filetype/org.kak @@ -46,7 +46,7 @@ add-highlighter shared/org/src_block region ^(\h*)(?i)#\+BEGIN_SRC(\h+|\n) ^(\h* add-highlighter shared/org/comment region (^|\h)\K#[^+] $ fill comment # Table -add-highlighter shared/org/table region (^|\h)\K[|][^+] $ fill string +add-highlighter shared/org/table region ^\h*[|][^+] $ fill string # Various blocks evaluate-commands %sh{ From da8bb68795076de6efb807fd03b88f0a28ce91e0 Mon Sep 17 00:00:00 2001 From: Andrey Orst Date: Thu, 11 Apr 2019 17:38:33 +0300 Subject: [PATCH 13/56] fix wrapping search --- rc/filetype/org.kak | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rc/filetype/org.kak b/rc/filetype/org.kak index ef1136b7a4..1b6e96ee61 100644 --- a/rc/filetype/org.kak +++ b/rc/filetype/org.kak @@ -90,7 +90,7 @@ add-highlighter shared/org/inline/text/link regex "\[[^\n]+\]\]" define-command -hidden org-indent-on-new-line %{ evaluate-commands -draft -itersel %{ # follow list item indentation and amount of leading whitespaces - try %{ execute-keys -draft 'ks\S^\h*([-+]|\h+[*]|\d[.)])s^\h*([+-]|\h+[*][^*]|\d[.)])\h*y/^\nPxHr' } + try %{ execute-keys -draft 'ks\S^\h*([-+]|\h+[*]|\d[.)])s^\h*([+-]|\h+[*][^*]|\d[.)])\h*y/^\nPxHr' } try %{ execute-keys -draft -itersel 'ks\h+$d' } } } From fcbc44d566491ef19416155afa5e0379911fca7d Mon Sep 17 00:00:00 2001 From: Andrey Orst Date: Thu, 11 Apr 2019 18:50:42 +0300 Subject: [PATCH 14/56] rework highlighters to support singel newlinesd matching --- rc/filetype/org.kak | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/rc/filetype/org.kak b/rc/filetype/org.kak index 1b6e96ee61..60f649bf10 100644 --- a/rc/filetype/org.kak +++ b/rc/filetype/org.kak @@ -71,18 +71,20 @@ add-highlighter shared/org/inline/text/ordered-lists regex ^(?:\h*)(\d+[.)])\h+ add-highlighter shared/org/inline/text/heading regex "^[*]+\h+[^\n]+" 0:header # Options -add-highlighter shared/org/inline/text/option regex "(?i)#\+[a-z]\w*\b" 0:module +add-highlighter shared/org/inline/text/option regex "(?i)#\+[a-z]\w*\b[^\n]*" 0:module # Markup -add-highlighter shared/org/inline/text/italic regex "\s([/][^\s/].*?[^\s/]*?[/])\W" 1:italic -add-highlighter shared/org/inline/text/strikethrough regex "\s([+][^\s+].*?[^\s+]*?[+])\W" 1:strikethrough -add-highlighter shared/org/inline/text/verbatim regex "\s([=][^\s=].*?[^\s=]*?[=])\W" 1:meta -add-highlighter shared/org/inline/text/code regex "\s([~][^\s~].*?[^\s~]*?[~])\W" 1:mono -add-highlighter shared/org/inline/text/inline-math regex "\s([$][^\s$].*?[^\s$]*?[$])\W" 1:mono -add-highlighter shared/org/inline/text/math regex "\s([$]{2}[^\s].*?[^\s]*?[$]{2})\W" 1:mono -add-highlighter shared/org/inline/text/underlined regex "\s([_][^\s_].*?[^\s_]*?[_])\W" 1:underline -add-highlighter shared/org/inline/text/bold regex "\s([*][^\s*].*?[^\s*]*?[*])\W" 1:bold -add-highlighter shared/org/inline/text/link regex "\[[^\n]+\]\]" 0:link +add-highlighter shared/org/inline/text/italic regex "(^|\s)([/]\S+?[\w\S\h]*?([\n]{1})?[\w\S\h]*?\S+?[/])\W" 2:italic +add-highlighter shared/org/inline/text/strikethrough regex "(^|\s)([+]\S+?[\w\S\h]*?([\n]{1})?[\w\S\h]*?\S+?[+])\W" 2:strikethrough +add-highlighter shared/org/inline/text/verbatim regex "(^|\s)([=]\S+?[\w\S\h]*?([\n]{1})?[\w\S\h]*?\S+?[=])\W" 2:meta +add-highlighter shared/org/inline/text/code regex "(^|\s)([~]\S+?[\w\S\h]*?([\n]{1})?[\w\S\h]*?\S+?[~])\W" 2:mono +add-highlighter shared/org/inline/text/inline-math regex "(^|\s)([$]\S+?[\w\S\h]*?([\n]{1})?[\w\S\h]*?\S+?[$])\W" 2:mono +add-highlighter shared/org/inline/text/math regex "(^|\s)([$]{2}\S+?[\w\S\h]*?([\n]{1})?[\w\S\h]*?\S+?[$]{2})\W" 2:mono +add-highlighter shared/org/inline/text/underlined regex "(^|\s)([_]\S+?[\w\S\h]*?([\n]{1})?[\w\S\h]*?\S+?[_])\W" 2:underline +add-highlighter shared/org/inline/text/bold regex "(^|\s)([*]\S+?[\w\S\h]*?([\n]{1})?[\w\S\h]*?\S+?[*])\W" 2:bold +add-highlighter shared/org/inline/text/date regex "(?:^|\s)([\[][^\s][^\n]*?[^\s]*?[\]])\W" 0:variable +add-highlighter shared/org/inline/text/link regex "(?:^|\s)([\[]{2}[^\n]*?[\]]{2})\W" 0:link +add-highlighter shared/org/inline/text/properties regex "^\h*([:][^\s][^\n]*?[^\s]*?[:])\W" 1:keyword # Commands # ‾‾‾‾‾‾‾‾ From b8f54f066bd873205c6f1699b69a35b0c473a5a3 Mon Sep 17 00:00:00 2001 From: Andrey Orst Date: Thu, 11 Apr 2019 19:05:52 +0300 Subject: [PATCH 15/56] add highlighting for title and requisites --- rc/filetype/org.kak | 26 ++++++++++++++------------ 1 file changed, 14 insertions(+), 12 deletions(-) diff --git a/rc/filetype/org.kak b/rc/filetype/org.kak index 60f649bf10..3ba30ac946 100644 --- a/rc/filetype/org.kak +++ b/rc/filetype/org.kak @@ -71,20 +71,22 @@ add-highlighter shared/org/inline/text/ordered-lists regex ^(?:\h*)(\d+[.)])\h+ add-highlighter shared/org/inline/text/heading regex "^[*]+\h+[^\n]+" 0:header # Options -add-highlighter shared/org/inline/text/option regex "(?i)#\+[a-z]\w*\b[^\n]*" 0:module +add-highlighter shared/org/inline/text/option regex "(?i)#\+[a-z]\w*\b[^\n]*" 0:module +add-highlighter shared/org/inline/text/title regex "(?i)#\+title:([^\n]+)" 0:module 1:meta +add-highlighter shared/org/inline/text/requisites regex "(?i)#\+(?:author|email):([^\n]+)" 0:module 1:keyword # Markup -add-highlighter shared/org/inline/text/italic regex "(^|\s)([/]\S+?[\w\S\h]*?([\n]{1})?[\w\S\h]*?\S+?[/])\W" 2:italic -add-highlighter shared/org/inline/text/strikethrough regex "(^|\s)([+]\S+?[\w\S\h]*?([\n]{1})?[\w\S\h]*?\S+?[+])\W" 2:strikethrough -add-highlighter shared/org/inline/text/verbatim regex "(^|\s)([=]\S+?[\w\S\h]*?([\n]{1})?[\w\S\h]*?\S+?[=])\W" 2:meta -add-highlighter shared/org/inline/text/code regex "(^|\s)([~]\S+?[\w\S\h]*?([\n]{1})?[\w\S\h]*?\S+?[~])\W" 2:mono -add-highlighter shared/org/inline/text/inline-math regex "(^|\s)([$]\S+?[\w\S\h]*?([\n]{1})?[\w\S\h]*?\S+?[$])\W" 2:mono -add-highlighter shared/org/inline/text/math regex "(^|\s)([$]{2}\S+?[\w\S\h]*?([\n]{1})?[\w\S\h]*?\S+?[$]{2})\W" 2:mono -add-highlighter shared/org/inline/text/underlined regex "(^|\s)([_]\S+?[\w\S\h]*?([\n]{1})?[\w\S\h]*?\S+?[_])\W" 2:underline -add-highlighter shared/org/inline/text/bold regex "(^|\s)([*]\S+?[\w\S\h]*?([\n]{1})?[\w\S\h]*?\S+?[*])\W" 2:bold -add-highlighter shared/org/inline/text/date regex "(?:^|\s)([\[][^\s][^\n]*?[^\s]*?[\]])\W" 0:variable -add-highlighter shared/org/inline/text/link regex "(?:^|\s)([\[]{2}[^\n]*?[\]]{2})\W" 0:link -add-highlighter shared/org/inline/text/properties regex "^\h*([:][^\s][^\n]*?[^\s]*?[:])\W" 1:keyword +add-highlighter shared/org/inline/text/italic regex "(^|\h)([/]\S+?[\w\S\h]*?([\n]{1})?[\w\S\h]*?\S+?[/])\W" 2:italic +add-highlighter shared/org/inline/text/strikethrough regex "(^|\h)([+]\S+?[\w\S\h]*?([\n]{1})?[\w\S\h]*?\S+?[+])\W" 2:strikethrough +add-highlighter shared/org/inline/text/verbatim regex "(^|\h)([=]\S+?[\w\S\h]*?([\n]{1})?[\w\S\h]*?\S+?[=])\W" 2:meta +add-highlighter shared/org/inline/text/code regex "(^|\h)([~]\S+?[\w\S\h]*?([\n]{1})?[\w\S\h]*?\S+?[~])\W" 2:mono +add-highlighter shared/org/inline/text/inline-math regex "(^|\h)([$]\S+?[\w\S\h]*?([\n]{1})?[\w\S\h]*?\S+?[$])\W" 2:mono +add-highlighter shared/org/inline/text/math regex "(^|\h)([$]{2}\S+?[\w\S\h]*?([\n]{1})?[\w\S\h]*?\S+?[$]{2})\W" 2:mono +add-highlighter shared/org/inline/text/underlined regex "(^|\h)([_]\S+?[\w\S\h]*?([\n]{1})?[\w\S\h]*?\S+?[_])\W" 2:underline +add-highlighter shared/org/inline/text/bold regex "(^|\h)([*]\S+?[\w\S\h]*?([\n]{1})?[\w\S\h]*?\S+?[*])\W" 2:bold +add-highlighter shared/org/inline/text/date regex "(?:^|\h)([\[][^\s][^\n]*?[^\s]*?[\]])\W" 0:variable +add-highlighter shared/org/inline/text/link regex "(?:^|\h)([\[]{2}[^\n]*?[\]]{2})\W" 0:link +add-highlighter shared/org/inline/text/drawer regex "^\h*([:][^\s][^\n]*?[^\s]*?[:])\W" 1:keyword # Commands # ‾‾‾‾‾‾‾‾ From 5bb8ecf7cec910533cf1cc4b69a327393f85bc3f Mon Sep 17 00:00:00 2001 From: Andrey Orst Date: Thu, 11 Apr 2019 19:19:19 +0300 Subject: [PATCH 16/56] fix end of src block was highlighted along with the code inside it --- rc/filetype/org.kak | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/rc/filetype/org.kak b/rc/filetype/org.kak index 3ba30ac946..2175c52e2b 100644 --- a/rc/filetype/org.kak +++ b/rc/filetype/org.kak @@ -27,7 +27,7 @@ evaluate-commands %sh{ toml troff tupfile void-linux yaml" for lang in ${languages}; do - printf "%s\n" "add-highlighter shared/org/${lang} region '#\+(?i)BEGIN_SRC(?I)\h+${lang}\b' '#\+(?i)END_SRC' regions" + printf "%s\n" "add-highlighter shared/org/${lang} region '#\+(?i)BEGIN_SRC(?I)\h+${lang}\b' '(?i)#\+END_SRC' regions" printf "%s\n" "add-highlighter shared/org/${lang}/ default-region fill meta" case ${lang} in # here we need to declare all workarounds for Org-mode supported languages @@ -35,7 +35,7 @@ evaluate-commands %sh{ emacs-lisp) ref="lisp" ;; *) ref="${lang}" ;; esac - printf "%s\n" "add-highlighter shared/org/${lang}/inner region \A#\+(?i)BEGIN_SRC(?I)[^\n]*\K '(?=#\+(?i)END_SRC)' ref ${ref}" + printf "%s\n" "add-highlighter shared/org/${lang}/inner region \A#\+(?i)BEGIN_SRC(?I)\h+[^\n]+\K '(?i)(?=#\+END_SRC)' ref ${ref}" done } From 9a22a535bbb84fe77e8231f64cf3957e08f3f664 Mon Sep 17 00:00:00 2001 From: Andrey Orst Date: Thu, 11 Apr 2019 19:23:12 +0300 Subject: [PATCH 17/56] turn math blocks to region highlighter --- rc/filetype/org.kak | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rc/filetype/org.kak b/rc/filetype/org.kak index 2175c52e2b..fcff672100 100644 --- a/rc/filetype/org.kak +++ b/rc/filetype/org.kak @@ -81,13 +81,13 @@ add-highlighter shared/org/inline/text/strikethrough regex "(^|\h)([+]\S+?[\w\S\ add-highlighter shared/org/inline/text/verbatim regex "(^|\h)([=]\S+?[\w\S\h]*?([\n]{1})?[\w\S\h]*?\S+?[=])\W" 2:meta add-highlighter shared/org/inline/text/code regex "(^|\h)([~]\S+?[\w\S\h]*?([\n]{1})?[\w\S\h]*?\S+?[~])\W" 2:mono add-highlighter shared/org/inline/text/inline-math regex "(^|\h)([$]\S+?[\w\S\h]*?([\n]{1})?[\w\S\h]*?\S+?[$])\W" 2:mono -add-highlighter shared/org/inline/text/math regex "(^|\h)([$]{2}\S+?[\w\S\h]*?([\n]{1})?[\w\S\h]*?\S+?[$]{2})\W" 2:mono add-highlighter shared/org/inline/text/underlined regex "(^|\h)([_]\S+?[\w\S\h]*?([\n]{1})?[\w\S\h]*?\S+?[_])\W" 2:underline add-highlighter shared/org/inline/text/bold regex "(^|\h)([*]\S+?[\w\S\h]*?([\n]{1})?[\w\S\h]*?\S+?[*])\W" 2:bold add-highlighter shared/org/inline/text/date regex "(?:^|\h)([\[][^\s][^\n]*?[^\s]*?[\]])\W" 0:variable add-highlighter shared/org/inline/text/link regex "(?:^|\h)([\[]{2}[^\n]*?[\]]{2})\W" 0:link add-highlighter shared/org/inline/text/drawer regex "^\h*([:][^\s][^\n]*?[^\s]*?[:])\W" 1:keyword +add-highlighter shared/org/math region '[$]{2}' '[$]{2}' fill mono # Commands # ‾‾‾‾‾‾‾‾ From 848bc259b0f1b7b7a1d48430f411129c4db4e752 Mon Sep 17 00:00:00 2001 From: Andrey Orst Date: Thu, 11 Apr 2019 19:26:24 +0300 Subject: [PATCH 18/56] add math blocks starting with square bracket --- rc/filetype/org.kak | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rc/filetype/org.kak b/rc/filetype/org.kak index fcff672100..bb95eb1f80 100644 --- a/rc/filetype/org.kak +++ b/rc/filetype/org.kak @@ -87,7 +87,7 @@ add-highlighter shared/org/inline/text/date regex "(?:^|\h)([\[][^\s][^ add-highlighter shared/org/inline/text/link regex "(?:^|\h)([\[]{2}[^\n]*?[\]]{2})\W" 0:link add-highlighter shared/org/inline/text/drawer regex "^\h*([:][^\s][^\n]*?[^\s]*?[:])\W" 1:keyword -add-highlighter shared/org/math region '[$]{2}' '[$]{2}' fill mono +add-highlighter shared/org/math region '[$]{2}|\\\[' '[$]{2}|\\\]' fill mono # Commands # ‾‾‾‾‾‾‾‾ From 9e0642a95972fd637bc3795273c8db0330141d55 Mon Sep 17 00:00:00 2001 From: Andrey Orst Date: Thu, 11 Apr 2019 21:51:32 +0300 Subject: [PATCH 19/56] add section, subsection, and subsubsection faces --- colors/base16.kak | 3 +++ colors/default.kak | 3 +++ colors/desertex.kak | 3 +++ colors/github.kak | 3 +++ colors/gruvbox.kak | 3 +++ colors/lucius.kak | 3 +++ colors/palenight.kak | 3 +++ colors/red-phoenix.kak | 9 ++++++--- colors/reeder.kak | 3 +++ colors/solarized-dark.kak | 3 +++ colors/solarized-light.kak | 3 +++ colors/tomorrow-night.kak | 5 ++++- colors/zenburn.kak | 3 +++ 13 files changed, 43 insertions(+), 4 deletions(-) diff --git a/colors/base16.kak b/colors/base16.kak index fd0d668b04..50afdca1e1 100644 --- a/colors/base16.kak +++ b/colors/base16.kak @@ -36,6 +36,9 @@ evaluate-commands %sh{ echo " face global title blue face global header ${cyan_light} + face global section ${cyan_light} + face global subsection ${purple_dark} + face global subsubsection ${magenta_dark} face global bold ${orange_light}+b face global italic ${orange_dark}+i face global underline ${magenta_dark}+u diff --git a/colors/default.kak b/colors/default.kak index 573217043a..1597bb8043 100644 --- a/colors/default.kak +++ b/colors/default.kak @@ -17,6 +17,9 @@ face global builtin default+b # For markup face global title blue face global header cyan +face global section blue +face global subsection magenta +face global subsubsection red face global bold red+b face global italic yellow+i face global underline blue+u diff --git a/colors/desertex.kak b/colors/desertex.kak index a56fd2167f..94f088f520 100644 --- a/colors/desertex.kak +++ b/colors/desertex.kak @@ -17,6 +17,9 @@ face global meta rgb:ee799f # Markup face global title blue face global header cyan +face global section blue +face global subsection magenta +face global subsubsection red face global bold red+b face global italic yellow+i face global underline blue+u diff --git a/colors/github.kak b/colors/github.kak index f03496f06e..34b504edb2 100644 --- a/colors/github.kak +++ b/colors/github.kak @@ -20,6 +20,9 @@ face global builtin default+b ## markup face global title blue face global header cyan +face global section blue +face global subsection magenta +face global subsubsection red face global bold red+b face global italic yellow+i face global underline blue+u diff --git a/colors/gruvbox.kak b/colors/gruvbox.kak index 2a07154fcf..b21fa5febf 100644 --- a/colors/gruvbox.kak +++ b/colors/gruvbox.kak @@ -40,6 +40,9 @@ evaluate-commands %sh{ # Markdown highlighting face global title ${green}+b face global header ${orange} + face global section ${aqua} + face global subsection ${blue} + face global subsubsection ${purple} face global bold ${fg}+b face global italic ${fg}+i face global underline ${fg}+u diff --git a/colors/lucius.kak b/colors/lucius.kak index f51abf1264..44dd24765d 100644 --- a/colors/lucius.kak +++ b/colors/lucius.kak @@ -40,6 +40,9 @@ evaluate-commands %sh{ # and markup face global title ${lucius_light_blue} face global header ${lucius_light_green} + face global section ${lucius_light_blue} + face global subsection ${lucius_blue} + face global subsubsection ${lucius_dark_blue} face global bold ${lucius_blue}+b face global italic ${lucius_light_grey}+i face global underline ${lucius_green}+u diff --git a/colors/palenight.kak b/colors/palenight.kak index a080aa8e09..a61d905607 100644 --- a/colors/palenight.kak +++ b/colors/palenight.kak @@ -43,6 +43,9 @@ evaluate-commands %sh{ # Markup face global title $blue face global header $cyan + face global section $blue + face global subsection $purple + face global subsubsection $red face global bold $red+b face global italic $yellow+i face global underline $blue+u diff --git a/colors/red-phoenix.kak b/colors/red-phoenix.kak index 675b146938..3dbf7bcbad 100644 --- a/colors/red-phoenix.kak +++ b/colors/red-phoenix.kak @@ -49,15 +49,18 @@ evaluate-commands %sh{ ## markup echo " - face global title blue + face global title ${blue} face global header ${orange1} + face global section ${light_orange1} + face global subsection ${tan3} + face global subsubsection ${orange2} face global bold ${orange2}+b face global italic ${orange3}+i face global underline ${orange3}+u face global strikethrough ${orange1} face global mono ${yellow1} face global block ${tan1} - face global link blue + face global link ${blue} face global bullet ${gray1} face global list ${gray1} " @@ -73,7 +76,7 @@ evaluate-commands %sh{ face global SecondaryCursorEol black,${orange2}+fg face global LineNumbers ${text_light},${background} face global LineNumberCursor ${text},${gray1}+b - face global MenuForeground ${text_light},blue + face global MenuForeground ${text_light},${blue} face global MenuBackground ${orange1},${window} face global MenuInfo ${gray1} face global Information white,${window} diff --git a/colors/reeder.kak b/colors/reeder.kak index 459c961b55..5eaedddbf0 100644 --- a/colors/reeder.kak +++ b/colors/reeder.kak @@ -38,6 +38,9 @@ evaluate-commands %sh{ # and markup face global title ${orange}+b face global header ${orange}+b + face global section ${orange} + face global subsection ${brown_light} + face global subsubsection ${brown_dark} face global bold default+b face global italic default+i face global underline default+u diff --git a/colors/solarized-dark.kak b/colors/solarized-dark.kak index 6e685b16c5..9dfce43279 100644 --- a/colors/solarized-dark.kak +++ b/colors/solarized-dark.kak @@ -36,6 +36,9 @@ evaluate-commands %sh{ # markup face global title ${blue}+b face global header ${blue} + face global section ${cyan} + face global subsection ${magenta} + face global subsubsection ${orange} face global bold ${base0}+b face global italic ${base0}+i face global underline ${base0}+u diff --git a/colors/solarized-light.kak b/colors/solarized-light.kak index 899d0b3240..ab28548cab 100644 --- a/colors/solarized-light.kak +++ b/colors/solarized-light.kak @@ -36,6 +36,9 @@ evaluate-commands %sh{ # markup face global title ${blue}+b face global header ${blue} + face global section ${cyan} + face global subsection ${orange} + face global subsubsection ${magenta} face global bold ${base01}+b face global italic ${base01}+i face global underline ${base01}+u diff --git a/colors/tomorrow-night.kak b/colors/tomorrow-night.kak index 5f3bc04a28..43d900101c 100644 --- a/colors/tomorrow-night.kak +++ b/colors/tomorrow-night.kak @@ -39,8 +39,11 @@ evaluate-commands %sh{ ## markup echo " - face global title blue + face global title ${blue} face global header ${aqua} + face global section ${aqua} + face global subsection ${purple} + face global subsubsection ${magenta} face global bold ${yellow}+b face global italic ${orange}+i face global underline ${blue}+u diff --git a/colors/zenburn.kak b/colors/zenburn.kak index b6ddb970a7..f795f2ba1c 100644 --- a/colors/zenburn.kak +++ b/colors/zenburn.kak @@ -47,6 +47,9 @@ evaluate-commands %sh{ # and markup face global title ${zenkeyword} face global header ${zenconstant} + face global section ${zenstring} + face global subsection ${zencomment} + face global subsubsection ${zenfunction} face global bold ${zenstorageClass}+b face global italic ${zenfunction}+i face global underline ${zenvariable}+u From a76a2940a064bcfa0d6c40e6a9f9bbce4a047252 Mon Sep 17 00:00:00 2001 From: Andrey Orst Date: Thu, 11 Apr 2019 22:55:02 +0300 Subject: [PATCH 20/56] use new sections, adjust bold --- rc/filetype/org.kak | 27 +++++++++++++++------------ 1 file changed, 15 insertions(+), 12 deletions(-) diff --git a/rc/filetype/org.kak b/rc/filetype/org.kak index bb95eb1f80..668ac2ae2e 100644 --- a/rc/filetype/org.kak +++ b/rc/filetype/org.kak @@ -68,24 +68,27 @@ add-highlighter shared/org/inline/text/star-list regex ^(?:\h+)([*])\h+ 1:bullet add-highlighter shared/org/inline/text/ordered-lists regex ^(?:\h*)(\d+[.)])\h+ 1:bullet # Headings -add-highlighter shared/org/inline/text/heading regex "^[*]+\h+[^\n]+" 0:header +add-highlighter shared/org/inline/text/heading regex "^([*]{1}|[*]{5})\h+[^\n]+" 0:header +add-highlighter shared/org/inline/text/section regex "^([*]{2}|[*]{6})\h+[^\n]+" 0:section +add-highlighter shared/org/inline/text/subsection regex "^([*]{3}|[*]{7})\h+[^\n]+" 0:subsection +add-highlighter shared/org/inline/text/subsubsection regex "^([*]{4}|[*]{8,})\h+[^\n]+" 0:subsubsection # Options add-highlighter shared/org/inline/text/option regex "(?i)#\+[a-z]\w*\b[^\n]*" 0:module -add-highlighter shared/org/inline/text/title regex "(?i)#\+title:([^\n]+)" 0:module 1:meta +add-highlighter shared/org/inline/text/title regex "(?i)#\+title:([^\n]+)" 0:module 1:title add-highlighter shared/org/inline/text/requisites regex "(?i)#\+(?:author|email):([^\n]+)" 0:module 1:keyword # Markup -add-highlighter shared/org/inline/text/italic regex "(^|\h)([/]\S+?[\w\S\h]*?([\n]{1})?[\w\S\h]*?\S+?[/])\W" 2:italic -add-highlighter shared/org/inline/text/strikethrough regex "(^|\h)([+]\S+?[\w\S\h]*?([\n]{1})?[\w\S\h]*?\S+?[+])\W" 2:strikethrough -add-highlighter shared/org/inline/text/verbatim regex "(^|\h)([=]\S+?[\w\S\h]*?([\n]{1})?[\w\S\h]*?\S+?[=])\W" 2:meta -add-highlighter shared/org/inline/text/code regex "(^|\h)([~]\S+?[\w\S\h]*?([\n]{1})?[\w\S\h]*?\S+?[~])\W" 2:mono -add-highlighter shared/org/inline/text/inline-math regex "(^|\h)([$]\S+?[\w\S\h]*?([\n]{1})?[\w\S\h]*?\S+?[$])\W" 2:mono -add-highlighter shared/org/inline/text/underlined regex "(^|\h)([_]\S+?[\w\S\h]*?([\n]{1})?[\w\S\h]*?\S+?[_])\W" 2:underline -add-highlighter shared/org/inline/text/bold regex "(^|\h)([*]\S+?[\w\S\h]*?([\n]{1})?[\w\S\h]*?\S+?[*])\W" 2:bold -add-highlighter shared/org/inline/text/date regex "(?:^|\h)([\[][^\s][^\n]*?[^\s]*?[\]])\W" 0:variable -add-highlighter shared/org/inline/text/link regex "(?:^|\h)([\[]{2}[^\n]*?[\]]{2})\W" 0:link -add-highlighter shared/org/inline/text/drawer regex "^\h*([:][^\s][^\n]*?[^\s]*?[:])\W" 1:keyword +add-highlighter shared/org/inline/text/italic regex "(^|\h)([/]\S[\w\S\h]*?([\n]{1})?[\w\S\h]*?\S[/])\W" 2:italic +add-highlighter shared/org/inline/text/strikethrough regex "(^|\h)([+]\S[\w\S\h]*?([\n]{1})?[\w\S\h]*?\S[+])\W" 2:strikethrough +add-highlighter shared/org/inline/text/verbatim regex "(^|\h)([=]\S[\w\S\h]*?([\n]{1})?[\w\S\h]*?\S[=])\W" 2:meta +add-highlighter shared/org/inline/text/code regex "(^|\h)([~]\S[\w\S\h]*?([\n]{1})?[\w\S\h]*?\S[~])\W" 2:mono +add-highlighter shared/org/inline/text/inline-math regex "(^|\h)([$]\S[\w\S\h]*?([\n]{1})?[\w\S\h]*?\S[$])\W" 2:mono +add-highlighter shared/org/inline/text/underlined regex "(^|\h)([_]\S[\w\S\h]*?([\n]{1})?[\w\S\h]*?\S[_])\W" 2:underline +add-highlighter shared/org/inline/text/bold regex "(^[*][^*]|\h[*])(\S[\w\S\h]*?([\n]{1})?[\w\S\h]*?\S[*])\W" 0:bold +add-highlighter shared/org/inline/text/date regex "(?:^|\h)([\[][^\s][^\n]*?[^\s]*?[\]])\W" 0:variable +add-highlighter shared/org/inline/text/link regex "(?:^|\h)([\[]{2}[^\n]*?[\]]{2})\W" 0:link +add-highlighter shared/org/inline/text/drawer regex "^\h*([:][^\s][^\n]*?[^\s]*?[:])\W" 1:keyword add-highlighter shared/org/math region '[$]{2}|\\\[' '[$]{2}|\\\]' fill mono # Commands From e9c228c73e128d48ee22787264b48a60338ea69a Mon Sep 17 00:00:00 2001 From: Andrey Orst Date: Fri, 12 Apr 2019 09:06:00 +0300 Subject: [PATCH 21/56] avoid bold headings --- rc/filetype/org.kak | 25 +++++++++++++++---------- 1 file changed, 15 insertions(+), 10 deletions(-) diff --git a/rc/filetype/org.kak b/rc/filetype/org.kak index 668ac2ae2e..d7233498eb 100644 --- a/rc/filetype/org.kak +++ b/rc/filetype/org.kak @@ -79,18 +79,23 @@ add-highlighter shared/org/inline/text/title regex "(?i)#\+title:([^\n]+)" add-highlighter shared/org/inline/text/requisites regex "(?i)#\+(?:author|email):([^\n]+)" 0:module 1:keyword # Markup -add-highlighter shared/org/inline/text/italic regex "(^|\h)([/]\S[\w\S\h]*?([\n]{1})?[\w\S\h]*?\S[/])\W" 2:italic -add-highlighter shared/org/inline/text/strikethrough regex "(^|\h)([+]\S[\w\S\h]*?([\n]{1})?[\w\S\h]*?\S[+])\W" 2:strikethrough -add-highlighter shared/org/inline/text/verbatim regex "(^|\h)([=]\S[\w\S\h]*?([\n]{1})?[\w\S\h]*?\S[=])\W" 2:meta -add-highlighter shared/org/inline/text/code regex "(^|\h)([~]\S[\w\S\h]*?([\n]{1})?[\w\S\h]*?\S[~])\W" 2:mono -add-highlighter shared/org/inline/text/inline-math regex "(^|\h)([$]\S[\w\S\h]*?([\n]{1})?[\w\S\h]*?\S[$])\W" 2:mono -add-highlighter shared/org/inline/text/underlined regex "(^|\h)([_]\S[\w\S\h]*?([\n]{1})?[\w\S\h]*?\S[_])\W" 2:underline -add-highlighter shared/org/inline/text/bold regex "(^[*][^*]|\h[*])(\S[\w\S\h]*?([\n]{1})?[\w\S\h]*?\S[*])\W" 0:bold -add-highlighter shared/org/inline/text/date regex "(?:^|\h)([\[][^\s][^\n]*?[^\s]*?[\]])\W" 0:variable -add-highlighter shared/org/inline/text/link regex "(?:^|\h)([\[]{2}[^\n]*?[\]]{2})\W" 0:link -add-highlighter shared/org/inline/text/drawer regex "^\h*([:][^\s][^\n]*?[^\s]*?[:])\W" 1:keyword +add-highlighter shared/org/inline/text/italic regex "(^|\h)([/]\S[\w\S\h]*?([\n]{1})?[\w\S\h]*?\S[/])\W" 2:italic +add-highlighter shared/org/inline/text/strikethrough regex "(^|\h)([+]\S[\w\S\h]*?([\n]{1})?[\w\S\h]*?\S[+])\W" 2:strikethrough +add-highlighter shared/org/inline/text/verbatim regex "(^|\h)([=]\S[\w\S\h]*?([\n]{1})?[\w\S\h]*?\S[=])\W" 2:meta +add-highlighter shared/org/inline/text/code regex "(^|\h)([~]\S[\w\S\h]*?([\n]{1})?[\w\S\h]*?\S[~])\W" 2:mono +add-highlighter shared/org/inline/text/inline-math regex "(^|\h)([$]\S[\w\S\h]*?([\n]{1})?[\w\S\h]*?\S[$])\W" 2:mono +add-highlighter shared/org/inline/text/underlined regex "(^|\h)([_]\S[\w\S\h]*?([\n]{1})?[\w\S\h]*?\S[_])\W" 2:underline +add-highlighter shared/org/inline/text/date regex "(?:^|\h)([\[][^\s][^\n]*?[^\s]*?[\]])\W" 0:variable +add-highlighter shared/org/inline/text/link regex "(?:^|\h)([\[]{2}[^\n]*?[\]]{2})\W" 0:link +add-highlighter shared/org/inline/text/drawer regex "^\h*([:][^\s][^\n]*?[^\s]*?[:])\W" 1:keyword + +## bold is kinda tricky because we need to HL everything but headings, so it's split up on several regexps +add-highlighter shared/org/inline/text/bold regex "(^|\h)([*][^*\s][^\n]*?(\n{1})?[^\n]*?[*])\W" 2:bold +add-highlighter shared/org/inline/text/bold-stars-bol regex "([*]{3,})\n" 1:bold +add-highlighter shared/org/inline/text/bold-stars-mol regex "\h([*]{3})[^*\w]" 1:bold add-highlighter shared/org/math region '[$]{2}|\\\[' '[$]{2}|\\\]' fill mono + # Commands # ‾‾‾‾‾‾‾‾ From 69c23e4006fcad1d21682710b9c4bca3b028f9a2 Mon Sep 17 00:00:00 2001 From: Andrey Orst Date: Fri, 12 Apr 2019 09:13:40 +0300 Subject: [PATCH 22/56] simplify markup regexps --- rc/filetype/org.kak | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/rc/filetype/org.kak b/rc/filetype/org.kak index d7233498eb..956170fff8 100644 --- a/rc/filetype/org.kak +++ b/rc/filetype/org.kak @@ -79,15 +79,15 @@ add-highlighter shared/org/inline/text/title regex "(?i)#\+title:([^\n]+)" add-highlighter shared/org/inline/text/requisites regex "(?i)#\+(?:author|email):([^\n]+)" 0:module 1:keyword # Markup -add-highlighter shared/org/inline/text/italic regex "(^|\h)([/]\S[\w\S\h]*?([\n]{1})?[\w\S\h]*?\S[/])\W" 2:italic -add-highlighter shared/org/inline/text/strikethrough regex "(^|\h)([+]\S[\w\S\h]*?([\n]{1})?[\w\S\h]*?\S[+])\W" 2:strikethrough -add-highlighter shared/org/inline/text/verbatim regex "(^|\h)([=]\S[\w\S\h]*?([\n]{1})?[\w\S\h]*?\S[=])\W" 2:meta -add-highlighter shared/org/inline/text/code regex "(^|\h)([~]\S[\w\S\h]*?([\n]{1})?[\w\S\h]*?\S[~])\W" 2:mono -add-highlighter shared/org/inline/text/inline-math regex "(^|\h)([$]\S[\w\S\h]*?([\n]{1})?[\w\S\h]*?\S[$])\W" 2:mono -add-highlighter shared/org/inline/text/underlined regex "(^|\h)([_]\S[\w\S\h]*?([\n]{1})?[\w\S\h]*?\S[_])\W" 2:underline -add-highlighter shared/org/inline/text/date regex "(?:^|\h)([\[][^\s][^\n]*?[^\s]*?[\]])\W" 0:variable -add-highlighter shared/org/inline/text/link regex "(?:^|\h)([\[]{2}[^\n]*?[\]]{2})\W" 0:link -add-highlighter shared/org/inline/text/drawer regex "^\h*([:][^\s][^\n]*?[^\s]*?[:])\W" 1:keyword +add-highlighter shared/org/inline/text/italic regex "(^|\h)[/]\S[^\n]*?\n?[^\n]*?[/]\W" 2:italic +add-highlighter shared/org/inline/text/strikethrough regex "(^|\h)[+]\S[^\n]*?\n?[^\n]*?[+]\W" 2:strikethrough +add-highlighter shared/org/inline/text/verbatim regex "(^|\h)[=]\S[^\n]*?\n?[^\n]*?[=]\W" 2:meta +add-highlighter shared/org/inline/text/code regex "(^|\h)[~]\S[^\n]*?\n?[^\n]*?[~]\W" 2:mono +add-highlighter shared/org/inline/text/inline-math regex "(^|\h)[$]\S[^\n]*?\n?[^\n]*?[$]\W" 2:mono +add-highlighter shared/org/inline/text/underlined regex "(^|\h)[_]\S[^\n]*?\n?[^\n]*?[_]\W" 2:underline +add-highlighter shared/org/inline/text/date regex "(?:^|\h)([\[][^\s][^\n]*?[^\s]*?[\]])\W" 0:variable +add-highlighter shared/org/inline/text/link regex "(?:^|\h)([\[]{2}[^\n]*?[\]]{2})\W" 0:link +add-highlighter shared/org/inline/text/drawer regex "^\h*([:][^\s][^\n]*?[^\s]*?[:])\W" 1:keyword ## bold is kinda tricky because we need to HL everything but headings, so it's split up on several regexps add-highlighter shared/org/inline/text/bold regex "(^|\h)([*][^*\s][^\n]*?(\n{1})?[^\n]*?[*])\W" 2:bold From a1721d2da1b3142e979329158a8f3003722e6980 Mon Sep 17 00:00:00 2001 From: Andrey Orst Date: Fri, 12 Apr 2019 09:13:52 +0300 Subject: [PATCH 23/56] simplify markup regexps --- rc/filetype/org.kak | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/rc/filetype/org.kak b/rc/filetype/org.kak index 956170fff8..fa35cccf0d 100644 --- a/rc/filetype/org.kak +++ b/rc/filetype/org.kak @@ -79,12 +79,12 @@ add-highlighter shared/org/inline/text/title regex "(?i)#\+title:([^\n]+)" add-highlighter shared/org/inline/text/requisites regex "(?i)#\+(?:author|email):([^\n]+)" 0:module 1:keyword # Markup -add-highlighter shared/org/inline/text/italic regex "(^|\h)[/]\S[^\n]*?\n?[^\n]*?[/]\W" 2:italic -add-highlighter shared/org/inline/text/strikethrough regex "(^|\h)[+]\S[^\n]*?\n?[^\n]*?[+]\W" 2:strikethrough -add-highlighter shared/org/inline/text/verbatim regex "(^|\h)[=]\S[^\n]*?\n?[^\n]*?[=]\W" 2:meta -add-highlighter shared/org/inline/text/code regex "(^|\h)[~]\S[^\n]*?\n?[^\n]*?[~]\W" 2:mono -add-highlighter shared/org/inline/text/inline-math regex "(^|\h)[$]\S[^\n]*?\n?[^\n]*?[$]\W" 2:mono -add-highlighter shared/org/inline/text/underlined regex "(^|\h)[_]\S[^\n]*?\n?[^\n]*?[_]\W" 2:underline +add-highlighter shared/org/inline/text/italic regex "(^|\h)([/]\S[^\n]*?\n?[^\n]*?[/])\W" 2:italic +add-highlighter shared/org/inline/text/strikethrough regex "(^|\h)([+]\S[^\n]*?\n?[^\n]*?[+])\W" 2:strikethrough +add-highlighter shared/org/inline/text/verbatim regex "(^|\h)([=]\S[^\n]*?\n?[^\n]*?[=])\W" 2:meta +add-highlighter shared/org/inline/text/code regex "(^|\h)([~]\S[^\n]*?\n?[^\n]*?[~])\W" 2:mono +add-highlighter shared/org/inline/text/inline-math regex "(^|\h)([$]\S[^\n]*?\n?[^\n]*?[$])\W" 2:mono +add-highlighter shared/org/inline/text/underlined regex "(^|\h)([_]\S[^\n]*?\n?[^\n]*?[_])\W" 2:underline add-highlighter shared/org/inline/text/date regex "(?:^|\h)([\[][^\s][^\n]*?[^\s]*?[\]])\W" 0:variable add-highlighter shared/org/inline/text/link regex "(?:^|\h)([\[]{2}[^\n]*?[\]]{2})\W" 0:link add-highlighter shared/org/inline/text/drawer regex "^\h*([:][^\s][^\n]*?[^\s]*?[:])\W" 1:keyword From 01a88cef3878972e29e37e9c94828b38cc419724 Mon Sep 17 00:00:00 2001 From: Andrey Orst Date: Fri, 12 Apr 2019 09:23:10 +0300 Subject: [PATCH 24/56] add one level of iteration to sections --- rc/filetype/org.kak | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/rc/filetype/org.kak b/rc/filetype/org.kak index fa35cccf0d..db486a172b 100644 --- a/rc/filetype/org.kak +++ b/rc/filetype/org.kak @@ -68,10 +68,10 @@ add-highlighter shared/org/inline/text/star-list regex ^(?:\h+)([*])\h+ 1:bullet add-highlighter shared/org/inline/text/ordered-lists regex ^(?:\h*)(\d+[.)])\h+ 1:bullet # Headings -add-highlighter shared/org/inline/text/heading regex "^([*]{1}|[*]{5})\h+[^\n]+" 0:header -add-highlighter shared/org/inline/text/section regex "^([*]{2}|[*]{6})\h+[^\n]+" 0:section -add-highlighter shared/org/inline/text/subsection regex "^([*]{3}|[*]{7})\h+[^\n]+" 0:subsection -add-highlighter shared/org/inline/text/subsubsection regex "^([*]{4}|[*]{8,})\h+[^\n]+" 0:subsubsection +add-highlighter shared/org/inline/text/heading regex "^([*]{1}|[*]{5}|[*]{9})\h+[^\n]+" 0:header +add-highlighter shared/org/inline/text/section regex "^([*]{2}|[*]{6}|[*]{10})\h+[^\n]+" 0:section +add-highlighter shared/org/inline/text/subsection regex "^([*]{3}|[*]{7}|[*]{11})\h+[^\n]+" 0:subsection +add-highlighter shared/org/inline/text/subsubsection regex "^([*]{4}|[*]{8}|[*]{12,})\h+[^\n]+" 0:subsubsection # Options add-highlighter shared/org/inline/text/option regex "(?i)#\+[a-z]\w*\b[^\n]*" 0:module From bf81bde91b77401a3ee8953aa2739d09705cd91b Mon Sep 17 00:00:00 2001 From: Andrey Orst Date: Fri, 12 Apr 2019 12:13:23 +0300 Subject: [PATCH 25/56] merge bold highlighters into one --- rc/filetype/org.kak | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/rc/filetype/org.kak b/rc/filetype/org.kak index db486a172b..b1bb183958 100644 --- a/rc/filetype/org.kak +++ b/rc/filetype/org.kak @@ -90,9 +90,7 @@ add-highlighter shared/org/inline/text/link regex "(?:^|\h)([\[]{2}[^\ add-highlighter shared/org/inline/text/drawer regex "^\h*([:][^\s][^\n]*?[^\s]*?[:])\W" 1:keyword ## bold is kinda tricky because we need to HL everything but headings, so it's split up on several regexps -add-highlighter shared/org/inline/text/bold regex "(^|\h)([*][^*\s][^\n]*?(\n{1})?[^\n]*?[*])\W" 2:bold -add-highlighter shared/org/inline/text/bold-stars-bol regex "([*]{3,})\n" 1:bold -add-highlighter shared/org/inline/text/bold-stars-mol regex "\h([*]{3})[^*\w]" 1:bold +add-highlighter shared/org/inline/text/bold regex "(?:^|\h)([*][^*\s][^\n]*?(\n{1})?[^\n]*?[*])\W|([*]{3,})\n|\h([*]{3})[^*\w]" 1:bold add-highlighter shared/org/math region '[$]{2}|\\\[' '[$]{2}|\\\]' fill mono From f1c507c755b4f605d8925e2b382c9d25dce3006e Mon Sep 17 00:00:00 2001 From: Andrey Orst Date: Fri, 12 Apr 2019 12:13:52 +0300 Subject: [PATCH 26/56] define inner region for blocks --- rc/filetype/org.kak | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/rc/filetype/org.kak b/rc/filetype/org.kak index b1bb183958..1746e9eb78 100644 --- a/rc/filetype/org.kak +++ b/rc/filetype/org.kak @@ -51,10 +51,14 @@ add-highlighter shared/org/table region ^\h*[|][^+] $ fill string # Various blocks evaluate-commands %sh{ blocks="EXAMPLE QUOTE EXPORT CENTER VERSE" - join() { sep=$2; eval set -- $1; IFS="$sep"; echo "$*"; } - printf "%s\n" "add-highlighter shared/org/block region -match-capture ^\h*(?i)#\+BEGIN_($(join "${blocks}" '|'))(\h+|\n) ^\h*(?i)#\+END_($(join "${blocks}" '|'))\h*$ fill meta" + for block in ${blocks}; do + printf "%s\n" "add-highlighter shared/org/${block} region '(?i)#\+BEGIN_${block}\b' '(?i)#\+END_${block}\b' regions" + printf "%s\n" "add-highlighter shared/org/${block}/ default-region fill meta" + printf "%s\n" "add-highlighter shared/org/${block}/inner region \A#\+(?i)BEGIN_${block}\b\K '(?i)(?=#\+END_${block})' fill mono" + done } + # Small example block add-highlighter shared/org/inline/text/example regex ^(\h*)[:]\h+[^\n]* 0:meta From fbe0bfee47b7b6beea47e6a0b7d4dd93d23e4823 Mon Sep 17 00:00:00 2001 From: Andrey Orst Date: Fri, 12 Apr 2019 14:09:13 +0300 Subject: [PATCH 27/56] fix links; sort languages --- rc/filetype/org.kak | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/rc/filetype/org.kak b/rc/filetype/org.kak index 1746e9eb78..515d7544d6 100644 --- a/rc/filetype/org.kak +++ b/rc/filetype/org.kak @@ -16,12 +16,13 @@ add-highlighter shared/org/inline default-region regions add-highlighter shared/org/inline/text default-region group evaluate-commands %sh{ - languages="arch-linux asciidoc cabal c cpp objc clojure - cmake coffee css cucumber dart diff d dockerfile - elixir elm etc exherbo fish gas git go haml haskell - hbs html i3 ini java javascript json julia justrc - kickstart latex emacs-lisp lisp lua mail makefile markdown - mercurial moon nim ocaml perl php pony protobuf + languages="arch-linux asciidoc c cabal clojure + cmake coffee cpp css cucumber d dart diff + dockerfile elixir elm emacs-lisp etc exherbo + fish gas git go haml haskell hbs html i3 ini + java javascript json julia justrc kickstart + latex lisp lua mail makefile markdown mercurial + moon nim objc ocaml org perl php pony protobuf pug python ragel restructuredtext ruby rust sass scala scheme scss sh sql swift systemd taskpaper toml troff tupfile void-linux yaml" @@ -89,8 +90,8 @@ add-highlighter shared/org/inline/text/verbatim regex "(^|\h)([=]\S[^\n]*? add-highlighter shared/org/inline/text/code regex "(^|\h)([~]\S[^\n]*?\n?[^\n]*?[~])\W" 2:mono add-highlighter shared/org/inline/text/inline-math regex "(^|\h)([$]\S[^\n]*?\n?[^\n]*?[$])\W" 2:mono add-highlighter shared/org/inline/text/underlined regex "(^|\h)([_]\S[^\n]*?\n?[^\n]*?[_])\W" 2:underline -add-highlighter shared/org/inline/text/date regex "(?:^|\h)([\[][^\s][^\n]*?[^\s]*?[\]])\W" 0:variable -add-highlighter shared/org/inline/text/link regex "(?:^|\h)([\[]{2}[^\n]*?[\]]{2})\W" 0:link +add-highlighter shared/org/inline/text/date regex "[\[][^\s][^\n]*?[^\s]*?[\]]" 0:variable +add-highlighter shared/org/inline/text/link regex "[\[]{2}[^\n]*?[\]]{2}" 0:link add-highlighter shared/org/inline/text/drawer regex "^\h*([:][^\s][^\n]*?[^\s]*?[:])\W" 1:keyword ## bold is kinda tricky because we need to HL everything but headings, so it's split up on several regexps From 5e066c702e48b2754d4587911bf304e7224a0102 Mon Sep 17 00:00:00 2001 From: Andrey Orst Date: Sat, 13 Apr 2019 14:33:55 +0300 Subject: [PATCH 28/56] handle TODO items --- rc/filetype/org.kak | 49 ++++++++++++++++++++++++++++++++++++++++----- 1 file changed, 44 insertions(+), 5 deletions(-) diff --git a/rc/filetype/org.kak b/rc/filetype/org.kak index db486a172b..05b93bd6c0 100644 --- a/rc/filetype/org.kak +++ b/rc/filetype/org.kak @@ -1,11 +1,50 @@ # https://orgmode.org/ - your life in plain text # ‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾ + +# Faces +# ‾‾‾‾‾ + +set-face global org_todo red+b +set-face global org_done green+b +set-face global org_priority value + +# Options +# ‾‾‾‾‾‾‾ + +# Org mode supports different priorities and those can be customized either by +# using `#+TODO' and `#+PRIORITIES:' or by settings. These are default values +# that will be used in `dynregex' highlighters. We also need to update these +# items when opening file. +declare-option -docstring "Org Mode todo markers. You can customize this option directly, following the format, or by using `#+TODO:' in your document: + document format: #+TODO: state1 state2 ... stateN done + manual format: '(state1|state2|...|stateN)|(done)' +Colors for TODO items can be customized with `org_todo' and `org_done' faces. +" \ +regex org_todo_items "(TODO)|(DONE)" + +declare-option -docstring "Org Mode priorities. You can customize this option directly, or by using `#+PRIORITIES:' in your document. Please make sure that the highest priority is earlier in the alphabet than the lowest priority: + document format: #+PRIORITIES: A C B + manual format: 'A|C|B' +Colors for priority items can be customized with `org_priority' face." \ +regex org_priority_items "A|C|B" + # Detection # ‾‾‾‾‾‾‾‾‾ hook global BufCreate .*[.]org %{ set-option buffer filetype org + # Update `org_todo_items' and `org_priority_items' when opening file + evaluate-commands -save-regs '"/' %{ + try %{ + execute-keys -draft '/(?i)#\+TODO:[^\n]+f:ly: set-option buffer org_todo_items %reg{dquote}' + set-option buffer org_todo_items %sh{ printf "%s\n" " ${kak_opt_org_todo_items}" | sed -E "s/\s+/|/g;s/^\|//;s/(.*)\|(\w+)$/(\1)|(\2)/" } + } + try %{ + execute-keys -draft '/(?i)#\+PRIORITIES:[^\n]+f:ls\h*\w(\s+)?(\w)?(\s+)?(\w)?\sy: set-option buffer org_priority_items %reg{dquote}' + set-option buffer org_priority_items %sh{ printf "%s\n" "${kak_opt_org_priority_items}" | sed -E "s/ /|/g" } + } + } } # Highlighters @@ -67,11 +106,11 @@ add-highlighter shared/org/inline/text/star-list regex ^(?:\h+)([*])\h+ 1:bullet # Ordered list items start with a numeral followed by either a period or a right parenthesis, such as `1.' or `1)' add-highlighter shared/org/inline/text/ordered-lists regex ^(?:\h*)(\d+[.)])\h+ 1:bullet -# Headings -add-highlighter shared/org/inline/text/heading regex "^([*]{1}|[*]{5}|[*]{9})\h+[^\n]+" 0:header -add-highlighter shared/org/inline/text/section regex "^([*]{2}|[*]{6}|[*]{10})\h+[^\n]+" 0:section -add-highlighter shared/org/inline/text/subsection regex "^([*]{3}|[*]{7}|[*]{11})\h+[^\n]+" 0:subsection -add-highlighter shared/org/inline/text/subsubsection regex "^([*]{4}|[*]{8}|[*]{12,})\h+[^\n]+" 0:subsubsection +# Headings. Also includes highlighting groups for TODO and PRIORITIES +add-highlighter shared/org/inline/text/heading dynregex '^(?:[*]{1}|[*]{5}|[*]{9})\h+(?:(?:%opt{org_todo_items})\h+)?(\[#(?:%opt{org_priority_items})\])?[^\n]+' 0:header 1:org_todo 2:org_done 3:org_priority +add-highlighter shared/org/inline/text/section dynregex '^(?:[*]{2}|[*]{6}|[*]{10})\h+(?:(?:%opt{org_todo_items})\h+)?(\[#(?:%opt{org_priority_items})\])?[^\n]+' 0:section 1:org_todo 2:org_done 3:org_priority +add-highlighter shared/org/inline/text/subsection dynregex '^(?:[*]{3}|[*]{7}|[*]{11})\h+(?:(?:%opt{org_todo_items})\h+)?(\[#(?:%opt{org_priority_items})\])?[^\n]+' 0:subsection 1:org_todo 2:org_done 3:org_priority +add-highlighter shared/org/inline/text/subsubsection dynregex '^(?:[*]{4}|[*]{8}|[*]{12,})\h+(?:(?:%opt{org_todo_items})\h+)?(\[#(?:%opt{org_priority_items})\])?[^\n]+' 0:subsubsection 1:org_todo 2:org_done 3:org_priority # Options add-highlighter shared/org/inline/text/option regex "(?i)#\+[a-z]\w*\b[^\n]*" 0:module From 43e227ac9fe136612a783bec47b3e356e58f2662 Mon Sep 17 00:00:00 2001 From: Andrey Orst Date: Sat, 13 Apr 2019 14:43:11 +0300 Subject: [PATCH 29/56] adjust math blocks --- rc/filetype/org.kak | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/rc/filetype/org.kak b/rc/filetype/org.kak index 05b93bd6c0..11192a2809 100644 --- a/rc/filetype/org.kak +++ b/rc/filetype/org.kak @@ -133,7 +133,9 @@ add-highlighter shared/org/inline/text/bold regex "(^|\h)([*][^*\s][^\ add-highlighter shared/org/inline/text/bold-stars-bol regex "([*]{3,})\n" 1:bold add-highlighter shared/org/inline/text/bold-stars-mol regex "\h([*]{3})[^*\w]" 1:bold -add-highlighter shared/org/math region '[$]{2}|\\\[' '[$]{2}|\\\]' fill mono +add-highlighter shared/org/math1 region '[$]{2}' '[$]{2}' fill mono +add-highlighter shared/org/math2 region '\\\[' '\\\]' fill mono +add-highlighter shared/org/math3 region '\\\(' '\\\)' fill mono # Commands # ‾‾‾‾‾‾‾‾ From a1adafb29dda8135fbdf3f24db401ed3f8978ae7 Mon Sep 17 00:00:00 2001 From: Andrey Orst Date: Sat, 13 Apr 2019 18:30:37 +0300 Subject: [PATCH 30/56] support tags in headings --- rc/filetype/org.kak | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/rc/filetype/org.kak b/rc/filetype/org.kak index 11192a2809..54b1293d51 100644 --- a/rc/filetype/org.kak +++ b/rc/filetype/org.kak @@ -21,13 +21,13 @@ declare-option -docstring "Org Mode todo markers. You can customize this option manual format: '(state1|state2|...|stateN)|(done)' Colors for TODO items can be customized with `org_todo' and `org_done' faces. " \ -regex org_todo_items "(TODO)|(DONE)" +regex org_todo "(TODO)|(DONE)" declare-option -docstring "Org Mode priorities. You can customize this option directly, or by using `#+PRIORITIES:' in your document. Please make sure that the highest priority is earlier in the alphabet than the lowest priority: document format: #+PRIORITIES: A C B manual format: 'A|C|B' Colors for priority items can be customized with `org_priority' face." \ -regex org_priority_items "A|C|B" +regex org_priority "A|C|B" # Detection # ‾‾‾‾‾‾‾‾‾ @@ -107,10 +107,11 @@ add-highlighter shared/org/inline/text/star-list regex ^(?:\h+)([*])\h+ 1:bullet add-highlighter shared/org/inline/text/ordered-lists regex ^(?:\h*)(\d+[.)])\h+ 1:bullet # Headings. Also includes highlighting groups for TODO and PRIORITIES -add-highlighter shared/org/inline/text/heading dynregex '^(?:[*]{1}|[*]{5}|[*]{9})\h+(?:(?:%opt{org_todo_items})\h+)?(\[#(?:%opt{org_priority_items})\])?[^\n]+' 0:header 1:org_todo 2:org_done 3:org_priority -add-highlighter shared/org/inline/text/section dynregex '^(?:[*]{2}|[*]{6}|[*]{10})\h+(?:(?:%opt{org_todo_items})\h+)?(\[#(?:%opt{org_priority_items})\])?[^\n]+' 0:section 1:org_todo 2:org_done 3:org_priority -add-highlighter shared/org/inline/text/subsection dynregex '^(?:[*]{3}|[*]{7}|[*]{11})\h+(?:(?:%opt{org_todo_items})\h+)?(\[#(?:%opt{org_priority_items})\])?[^\n]+' 0:subsection 1:org_todo 2:org_done 3:org_priority -add-highlighter shared/org/inline/text/subsubsection dynregex '^(?:[*]{4}|[*]{8}|[*]{12,})\h+(?:(?:%opt{org_todo_items})\h+)?(\[#(?:%opt{org_priority_items})\])?[^\n]+' 0:subsubsection 1:org_todo 2:org_done 3:org_priority +# format: STARS TODO PRIORITY TEXT TAGS +add-highlighter shared/org/inline/text/heading dynregex '^(?:[*]{1}|[*]{5}|[*]{9})\h+(?:(?:%opt{org_todo})\h+)?(\[#(?:%opt{org_priority})\])?.*?(:[^:\n]+?:)?\n' 0:header 1:org_todo 2:org_done 3:org_priority 4:module +add-highlighter shared/org/inline/text/section dynregex '^(?:[*]{2}|[*]{6}|[*]{10})\h+(?:(?:%opt{org_todo})\h+)?(\[#(?:%opt{org_priority})\])?.*?(:[^:\n]+?:)?\n' 0:section 1:org_todo 2:org_done 3:org_priority 4:module +add-highlighter shared/org/inline/text/subsection dynregex '^(?:[*]{3}|[*]{7}|[*]{11})\h+(?:(?:%opt{org_todo})\h+)?(\[#(?:%opt{org_priority})\])?.*?(:[^:\n]+?:)?\n' 0:subsection 1:org_todo 2:org_done 3:org_priority 4:module +add-highlighter shared/org/inline/text/subsubsection dynregex '^(?:[*]{4}|[*]{8}|[*]{12,})\h+(?:(?:%opt{org_todo})\h+)?(\[#(?:%opt{org_priority})\])?.*?(:[^:\n]+?:)?\n' 0:subsubsection 1:org_todo 2:org_done 3:org_priority 4:module # Options add-highlighter shared/org/inline/text/option regex "(?i)#\+[a-z]\w*\b[^\n]*" 0:module From 61f5c0a88737e13826a76cdbeaa2adc496a79f64 Mon Sep 17 00:00:00 2001 From: Andrey Orst Date: Sat, 13 Apr 2019 18:35:31 +0300 Subject: [PATCH 31/56] fix headings --- rc/filetype/org.kak | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/rc/filetype/org.kak b/rc/filetype/org.kak index 54b1293d51..b91f2913ab 100644 --- a/rc/filetype/org.kak +++ b/rc/filetype/org.kak @@ -108,10 +108,10 @@ add-highlighter shared/org/inline/text/ordered-lists regex ^(?:\h*)(\d+[.)])\h+ # Headings. Also includes highlighting groups for TODO and PRIORITIES # format: STARS TODO PRIORITY TEXT TAGS -add-highlighter shared/org/inline/text/heading dynregex '^(?:[*]{1}|[*]{5}|[*]{9})\h+(?:(?:%opt{org_todo})\h+)?(\[#(?:%opt{org_priority})\])?.*?(:[^:\n]+?:)?\n' 0:header 1:org_todo 2:org_done 3:org_priority 4:module -add-highlighter shared/org/inline/text/section dynregex '^(?:[*]{2}|[*]{6}|[*]{10})\h+(?:(?:%opt{org_todo})\h+)?(\[#(?:%opt{org_priority})\])?.*?(:[^:\n]+?:)?\n' 0:section 1:org_todo 2:org_done 3:org_priority 4:module -add-highlighter shared/org/inline/text/subsection dynregex '^(?:[*]{3}|[*]{7}|[*]{11})\h+(?:(?:%opt{org_todo})\h+)?(\[#(?:%opt{org_priority})\])?.*?(:[^:\n]+?:)?\n' 0:subsection 1:org_todo 2:org_done 3:org_priority 4:module -add-highlighter shared/org/inline/text/subsubsection dynregex '^(?:[*]{4}|[*]{8}|[*]{12,})\h+(?:(?:%opt{org_todo})\h+)?(\[#(?:%opt{org_priority})\])?.*?(:[^:\n]+?:)?\n' 0:subsubsection 1:org_todo 2:org_done 3:org_priority 4:module +add-highlighter shared/org/inline/text/heading dynregex '^(?:[*]{1}|[*]{5}|[*]{9})\h+(?:(?:%opt{org_todo})\h+)?(\[#(?:%opt{org_priority})\])?[^\n]*(:[^:\n]+?:)?\n' 0:header 1:org_todo 2:org_done 3:org_priority 4:module +add-highlighter shared/org/inline/text/section dynregex '^(?:[*]{2}|[*]{6}|[*]{10})\h+(?:(?:%opt{org_todo})\h+)?(\[#(?:%opt{org_priority})\])?[^\n]*(:[^:\n]+?:)?\n' 0:section 1:org_todo 2:org_done 3:org_priority 4:module +add-highlighter shared/org/inline/text/subsection dynregex '^(?:[*]{3}|[*]{7}|[*]{11})\h+(?:(?:%opt{org_todo})\h+)?(\[#(?:%opt{org_priority})\])?[^\n]*(:[^:\n]+?:)?\n' 0:subsection 1:org_todo 2:org_done 3:org_priority 4:module +add-highlighter shared/org/inline/text/subsubsection dynregex '^(?:[*]{4}|[*]{8}|[*]{12,})\h+(?:(?:%opt{org_todo})\h+)?(\[#(?:%opt{org_priority})\])?[^\n]*(:[^:\n]+?:)?\n' 0:subsubsection 1:org_todo 2:org_done 3:org_priority 4:module # Options add-highlighter shared/org/inline/text/option regex "(?i)#\+[a-z]\w*\b[^\n]*" 0:module From 23f0ec43d78cc61c53bcef29ca6152e1b383773c Mon Sep 17 00:00:00 2001 From: Andrey Orst Date: Sat, 13 Apr 2019 19:12:08 +0300 Subject: [PATCH 32/56] add timestamps; adjust markup to specification --- rc/filetype/org.kak | 32 ++++++++++++++++++++++++++------ 1 file changed, 26 insertions(+), 6 deletions(-) diff --git a/rc/filetype/org.kak b/rc/filetype/org.kak index b91f2913ab..3ca6a3742a 100644 --- a/rc/filetype/org.kak +++ b/rc/filetype/org.kak @@ -118,13 +118,33 @@ add-highlighter shared/org/inline/text/option regex "(?i)#\+[a-z]\w*\b[^\n]* add-highlighter shared/org/inline/text/title regex "(?i)#\+title:([^\n]+)" 0:module 1:title add-highlighter shared/org/inline/text/requisites regex "(?i)#\+(?:author|email):([^\n]+)" 0:module 1:keyword +# Timestamps +## YYYY-MM-DD DAYNAME +declare-option regex org_date '\d\d\d\d-\d\d-\d\d\h+[^\s-+>\]\d]+' +## H:MM +declare-option regex org_time '([0-2])?[0-9]:[0-5][0-9]' +## (.+|++) or (-|--) digit (hour|day|week|month|year) +declare-option regex org_repeater_or_delay '([.+][+]|[-]{1,2})\h+\d\h+[hdwmy]' +## DATE TIME REPEATER-OR-DELAY +declare-option regex org_timestamp "%opt{org_date}(\h+%opt{org_time}(-%opt{org_time})?(\h+%opt{org_repeater_or_delay})?)?" + +add-highlighter shared/org/inline/text/timestamp_active dynregex "<%opt{org_timestamp}(--%opt{org_timestamp})?>" 0:keyword +add-highlighter shared/org/inline/text/timestamp_inactive dynregex "\[%opt{org_timestamp}(--%opt{org_timestamp})?\]" 0:comment + # Markup -add-highlighter shared/org/inline/text/italic regex "(^|\h)([/]\S[^\n]*?\n?[^\n]*?[/])\W" 2:italic -add-highlighter shared/org/inline/text/strikethrough regex "(^|\h)([+]\S[^\n]*?\n?[^\n]*?[+])\W" 2:strikethrough -add-highlighter shared/org/inline/text/verbatim regex "(^|\h)([=]\S[^\n]*?\n?[^\n]*?[=])\W" 2:meta -add-highlighter shared/org/inline/text/code regex "(^|\h)([~]\S[^\n]*?\n?[^\n]*?[~])\W" 2:mono -add-highlighter shared/org/inline/text/inline-math regex "(^|\h)([$]\S[^\n]*?\n?[^\n]*?[$])\W" 2:mono -add-highlighter shared/org/inline/text/underlined regex "(^|\h)([_]\S[^\n]*?\n?[^\n]*?[_])\W" 2:underline +## FORMAT: PRE MARKER CONTENTS MARKER POST +## PRE: whitespace `(`, `{`, `'`, `"` or beginning of the line +## MARKER: `/`, `+`, `=`, `~`, `_`, or `$` +## CONTENTS FORMAT: BORDER BODY BORDER +## BORDER: any non-whitespace, and not `,` `'` or `"` +## BODY: any character, can't be longer than tho lines +add-highlighter shared/org/inline/text/italic regex "(^|[\h({'i""])([/][^\h,'""][^\n]*?\n?[^\n]*[^\h,'""][/])\W" 2:italic +add-highlighter shared/org/inline/text/strikethrough regex "(^|[\h({'i""])([+][^\h,'""][^\n]*?\n?[^\n]*[^\h,'""][+])\W" 2:strikethrough +add-highlighter shared/org/inline/text/verbatim regex "(^|[\h({'i""])([=][^\h,'""][^\n]*?\n?[^\n]*[^\h,'""][=])\W" 2:meta +add-highlighter shared/org/inline/text/code regex "(^|[\h({'i""])([~][^\h,'""][^\n]*?\n?[^\n]*[^\h,'""][~])\W" 2:mono +add-highlighter shared/org/inline/text/inline-math regex "(^|[\h({'i""])([$][^\h,'""][^\n]*?\n?[^\n]*[^\h,'""][$])\W" 2:mono +add-highlighter shared/org/inline/text/underlined regex "(^|[\h({'i""])([_][^\h,'""][^\n]*?\n?[^\n]*[^\h,'""][_])\W" 2:underline + add-highlighter shared/org/inline/text/date regex "(?:^|\h)([\[][^\s][^\n]*?[^\s]*?[\]])\W" 0:variable add-highlighter shared/org/inline/text/link regex "(?:^|\h)([\[]{2}[^\n]*?[\]]{2})\W" 0:link add-highlighter shared/org/inline/text/drawer regex "^\h*([:][^\s][^\n]*?[^\s]*?[:])\W" 1:keyword From 5018a172e3152ec170c1c2683652776e645bdc6c Mon Sep 17 00:00:00 2001 From: Andrey Orst Date: Sat, 13 Apr 2019 19:30:45 +0300 Subject: [PATCH 33/56] add latex area --- rc/filetype/org.kak | 3 +++ 1 file changed, 3 insertions(+) diff --git a/rc/filetype/org.kak b/rc/filetype/org.kak index 47f1a832cb..3308040ab8 100644 --- a/rc/filetype/org.kak +++ b/rc/filetype/org.kak @@ -158,6 +158,9 @@ add-highlighter shared/org/inline/text/link regex "(?:^|\h)([\[]{2}[^\n]*?[\ add-highlighter shared/org/inline/text/drawer regex "^\h*([:][^\s][^\n]*?[^\s]*?[:])\W" 1:keyword # LaTeX +add-highlighter shared/org/LaTeX region '\\begin\{[A-Za-z0-9*]+\}' '\\end\{[A-Za-z0-9*]+\}' fill string + +# LaTeX Math add-highlighter shared/org/math1 region '[$]{2}' '[$]{2}' fill mono add-highlighter shared/org/math2 region '\\\[' '\\\]' fill mono add-highlighter shared/org/math3 region '\\\(' '\\\)' fill mono From 86f67081ccd041d32ea102303d985fb5c6c22bdb Mon Sep 17 00:00:00 2001 From: Andrey Orst Date: Sat, 13 Apr 2019 19:31:55 +0300 Subject: [PATCH 34/56] use match-capture for latex block --- rc/filetype/org.kak | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rc/filetype/org.kak b/rc/filetype/org.kak index 3308040ab8..67d1a49bf4 100644 --- a/rc/filetype/org.kak +++ b/rc/filetype/org.kak @@ -158,7 +158,7 @@ add-highlighter shared/org/inline/text/link regex "(?:^|\h)([\[]{2}[^\n]*?[\ add-highlighter shared/org/inline/text/drawer regex "^\h*([:][^\s][^\n]*?[^\s]*?[:])\W" 1:keyword # LaTeX -add-highlighter shared/org/LaTeX region '\\begin\{[A-Za-z0-9*]+\}' '\\end\{[A-Za-z0-9*]+\}' fill string +add-highlighter shared/org/LaTeX region -match-capture '\\begin\{([A-Za-z0-9*]+)\}' '\\end\{([A-Za-z0-9*]+)\}' fill string # LaTeX Math add-highlighter shared/org/math1 region '[$]{2}' '[$]{2}' fill mono From 19b78f2cc37e5c0276437429f0afcde48e599914 Mon Sep 17 00:00:00 2001 From: Andrey Orst Date: Sat, 13 Apr 2019 22:50:33 +0300 Subject: [PATCH 35/56] export snippets and footnotes --- rc/filetype/org.kak | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/rc/filetype/org.kak b/rc/filetype/org.kak index 67d1a49bf4..7a4823098c 100644 --- a/rc/filetype/org.kak +++ b/rc/filetype/org.kak @@ -165,6 +165,12 @@ add-highlighter shared/org/math1 region '[$]{2}' '[$]{2}' fill mono add-highlighter shared/org/math2 region '\\\[' '\\\]' fill mono add-highlighter shared/org/math3 region '\\\(' '\\\)' fill mono +# Export snippets +add-highlighter shared/org/inline/text/export regex "@@[a-zA-Z-]+:.*?@@" 0:mono + +# Footnotes +add-highlighter shared/org/inline/text/footnote regex "\[fn:([\w-_]+)?(:[^\n]+)?\]" 0:link + # Commands # ‾‾‾‾‾‾‾‾ From 90dc15d856c5a6fe255ce229653d4919f9a9cb22 Mon Sep 17 00:00:00 2001 From: Andrey Orst Date: Sat, 13 Apr 2019 23:13:04 +0300 Subject: [PATCH 36/56] extend links, targets, add cookies --- rc/filetype/org.kak | 22 ++++++++++++++++++---- 1 file changed, 18 insertions(+), 4 deletions(-) diff --git a/rc/filetype/org.kak b/rc/filetype/org.kak index 7a4823098c..c924b401b5 100644 --- a/rc/filetype/org.kak +++ b/rc/filetype/org.kak @@ -123,6 +123,9 @@ add-highlighter shared/org/inline/text/option regex "(?i)#\+[a-z]\w*\b[^\n]* add-highlighter shared/org/inline/text/title regex "(?i)#\+title:([^\n]+)" 0:module 1:title add-highlighter shared/org/inline/text/requisites regex "(?i)#\+(?:author|email):([^\n]+)" 0:module 1:keyword +# Drawer +add-highlighter shared/org/inline/text/drawer regex "^\h*([:][^\s][^\n]*?[^\s]*?[:])\W" 1:keyword + # Timestamps ## YYYY-MM-DD DAYNAME declare-option regex org_date '\d\d\d\d-\d\d-\d\d\h+[^\s-+>\]\d]+' @@ -154,9 +157,6 @@ add-highlighter shared/org/inline/text/underlined regex "(^|[\h({'i""])([_][ ## bold is kinda tricky because we need to HL everything but headings, so it's split up on several regexps add-highlighter shared/org/inline/text/bold regex "(?:^|[\h({'i""])([*][^\h,'""*][^\n]*?(\n{1})?[^\n]*?[*])\W|([*]{3,})\n|\h([*]{3})[\s.,:!?')}]" 1:bold -add-highlighter shared/org/inline/text/link regex "(?:^|\h)([\[]{2}[^\n]*?[\]]{2})\W" 0:link -add-highlighter shared/org/inline/text/drawer regex "^\h*([:][^\s][^\n]*?[^\s]*?[:])\W" 1:keyword - # LaTeX add-highlighter shared/org/LaTeX region -match-capture '\\begin\{([A-Za-z0-9*]+)\}' '\\end\{([A-Za-z0-9*]+)\}' fill string @@ -168,9 +168,23 @@ add-highlighter shared/org/math3 region '\\\(' '\\\)' fill mono # Export snippets add-highlighter shared/org/inline/text/export regex "@@[a-zA-Z-]+:.*?@@" 0:mono -# Footnotes +# Footnotes (greedy) add-highlighter shared/org/inline/text/footnote regex "\[fn:([\w-_]+)?(:[^\n]+)?\]" 0:link +# Links +add-highlighter shared/org/inline/text/link1 regex "[<][^<>\n\]+:[^<>\n\]+?[>]" 0:link +add-highlighter shared/org/inline/text/link2 regex "(?:^|\h)([\[]{2}[^\n\[\]]*?[\]]{2})\W" 0:link + +# Targets +add-highlighter shared/org/inline/text/org_target regex '<<[^\s<>][^\n<>]+[^\s<>]>>' 0:link +add-highlighter shared/org/inline/text/org_radio_target regex '<<<[^\s<>][^\n<>]+[^\s<>]>>>' 0:link + +# Macros +add-highlighter shared/org/inline/text/macros regex '[{]{3}[A-Za-z][a-zA-Z0-9-_]+\(.*?\)[}]{3}' 0:meta + +# Cookies +add-highlighter shared/org/inline/text/cookies regex '[\[]\d+?(%|/\d+?)[\]]' 0:value + # Commands # ‾‾‾‾‾‾‾‾ From 888626c98ccece9cbfd886e1f1e5866008e46195 Mon Sep 17 00:00:00 2001 From: Andrey Orst Date: Sun, 14 Apr 2019 10:22:58 +0300 Subject: [PATCH 37/56] fix link regex --- rc/filetype/org.kak | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/rc/filetype/org.kak b/rc/filetype/org.kak index c924b401b5..a8eddc80dd 100644 --- a/rc/filetype/org.kak +++ b/rc/filetype/org.kak @@ -172,12 +172,12 @@ add-highlighter shared/org/inline/text/export regex "@@[a-zA-Z-]+:.*?@@" 0:mono add-highlighter shared/org/inline/text/footnote regex "\[fn:([\w-_]+)?(:[^\n]+)?\]" 0:link # Links -add-highlighter shared/org/inline/text/link1 regex "[<][^<>\n\]+:[^<>\n\]+?[>]" 0:link +add-highlighter shared/org/inline/text/link1 regex "<[^<>\n]+:[^<>\n\]]+?>" 0:link add-highlighter shared/org/inline/text/link2 regex "(?:^|\h)([\[]{2}[^\n\[\]]*?[\]]{2})\W" 0:link # Targets -add-highlighter shared/org/inline/text/org_target regex '<<[^\s<>][^\n<>]+[^\s<>]>>' 0:link -add-highlighter shared/org/inline/text/org_radio_target regex '<<<[^\s<>][^\n<>]+[^\s<>]>>>' 0:link +add-highlighter shared/org/inline/text/org_target regex '[<]{2}[^\s<>][^\n<>]+[^\s<>][>]{2}' 0:link +add-highlighter shared/org/inline/text/org_radio_target regex '[<]{3}[^\s<>][^\n<>]+[^\s<>][>]{3}' 0:link # Macros add-highlighter shared/org/inline/text/macros regex '[{]{3}[A-Za-z][a-zA-Z0-9-_]+\(.*?\)[}]{3}' 0:meta From d74a54dbefcfa40cecb5dc39de9b0e35f5c987c8 Mon Sep 17 00:00:00 2001 From: Andrey Orst Date: Sun, 14 Apr 2019 10:34:18 +0300 Subject: [PATCH 38/56] update commants and docstrings --- rc/filetype/org.kak | 52 ++++++++++++++++++++++++++------------------- 1 file changed, 30 insertions(+), 22 deletions(-) diff --git a/rc/filetype/org.kak b/rc/filetype/org.kak index a8eddc80dd..5046c09c8a 100644 --- a/rc/filetype/org.kak +++ b/rc/filetype/org.kak @@ -100,16 +100,16 @@ evaluate-commands %sh{ # Small example block -add-highlighter shared/org/inline/text/example regex ^(\h*)[:]\h+[^\n]* 0:meta +add-highlighter shared/org/inline/text/example regex '^\h*[:]\h+[^\n]*' 0:meta # Unordered list items start with `-', `+', or `*' -add-highlighter shared/org/inline/text/unordered-lists regex ^(?:\h*)([-+])\h+ 1:bullet +add-highlighter shared/org/inline/text/unordered-lists regex '^\h*([-+])\h+' 1:bullet # But `*' list must be indented with at least single space, if not it is treated as a heading -add-highlighter shared/org/inline/text/star-list regex ^(?:\h+)([*])\h+ 1:bullet +add-highlighter shared/org/inline/text/star-list regex '^\h+([*])\h+' 1:bullet # Ordered list items start with a numeral followed by either a period or a right parenthesis, such as `1.' or `1)' -add-highlighter shared/org/inline/text/ordered-lists regex ^(?:\h*)(\d+[.)])\h+ 1:bullet +add-highlighter shared/org/inline/text/ordered-lists regex '^\h*(\d+[.)])\h+' 1:bullet # Headings. Also includes highlighting groups for TODO and PRIORITIES # format: STARS TODO PRIORITY TEXT TAGS @@ -127,14 +127,22 @@ add-highlighter shared/org/inline/text/requisites regex "(?i)#\+(?:author|email) add-highlighter shared/org/inline/text/drawer regex "^\h*([:][^\s][^\n]*?[^\s]*?[:])\W" 1:keyword # Timestamps -## YYYY-MM-DD DAYNAME -declare-option regex org_date '\d\d\d\d-\d\d-\d\d\h+[^\s-+>\]\d]+' -## H:MM -declare-option regex org_time '([0-2])?[0-9]:[0-5][0-9]' -## (.+|++) or (-|--) digit (hour|day|week|month|year) -declare-option regex org_repeater_or_delay '([.+][+]|[-]{1,2})\h+\d\h+[hdwmy]' -## DATE TIME REPEATER-OR-DELAY -declare-option regex org_timestamp "%opt{org_date}(\h+%opt{org_time}(-%opt{org_time})?(\h+%opt{org_repeater_or_delay})?)?" +declare-option -docstring "Org date + format: YYYY-MM-DD DAYNAME" \ +regex org_date '\d\d\d\d-\d\d-\d\d\h+[^\s-+>\]\d]+' + +declare-option -docstring "Org time + format H:MM" \ +regex org_time '([0-2])?[0-9]:[0-5][0-9]' + +declare-option -docstring "Org repeater or delay + format: (.+|++) or (-|--) digit (hour|day|week|month|year) +" \ +regex org_repeater_or_delay '([.+][+]|[-]{1,2})\h+\d\h+[hdwmy]' + +declare-option -docstring "Org timestamp + format: DATE TIME REPEATER-OR-DELAY" \ +regex org_timestamp "%opt{org_date}(\h+%opt{org_time}(-%opt{org_time})?(\h+%opt{org_repeater_or_delay})?)?" add-highlighter shared/org/inline/text/timestamp_active dynregex "<%opt{org_timestamp}(--%opt{org_timestamp})?>" 0:keyword add-highlighter shared/org/inline/text/timestamp_inactive dynregex "\[%opt{org_timestamp}(--%opt{org_timestamp})?\]" 0:comment @@ -147,21 +155,21 @@ add-highlighter shared/org/inline/text/timestamp_inactive dynregex "\[%opt{org_t ## BORDER: any non-whitespace, and not `,` `'` or `"` ## BODY: any character, can't be longer than tho lines ## POST: a whitespace character, `-`, `.`, `,`, `:`, `!`, `?`, `'`, `)`, `}` -add-highlighter shared/org/inline/text/italic regex "(^|[\h({'i""])([/][^\h,'""][^\n]*?\n?[^\n]*[^\h,'""][/])[\s.,:!?')}]" 2:italic -add-highlighter shared/org/inline/text/strikethrough regex "(^|[\h({'i""])([+][^\h,'""][^\n]*?\n?[^\n]*[^\h,'""][+])[\s.,:!?')}]" 2:strikethrough -add-highlighter shared/org/inline/text/verbatim regex "(^|[\h({'i""])([=][^\h,'""][^\n]*?\n?[^\n]*[^\h,'""][=])[\s.,:!?')}]" 2:meta -add-highlighter shared/org/inline/text/code regex "(^|[\h({'i""])([~][^\h,'""][^\n]*?\n?[^\n]*[^\h,'""][~])[\s.,:!?')}]" 2:mono -add-highlighter shared/org/inline/text/inline-math regex "(^|[\h({'i""])([$][^\h,'""][^\n]*?\n?[^\n]*[^\h,'""][$])[\s.,:!?')}]" 2:mono -add-highlighter shared/org/inline/text/underlined regex "(^|[\h({'i""])([_][^\h,'""][^\n]*?\n?[^\n]*[^\h,'""][_])[\s.,:!?')}]" 2:underline - +add-highlighter shared/org/inline/text/italic regex "(^|[\h({'""])([/][^\h,'""][^\n]*?\n?[^\n]*[^\h,'""][/])[\s.,:!?')}]" 2:italic +add-highlighter shared/org/inline/text/strikethrough regex "(^|[\h({'""])([+][^\h,'""][^\n]*?\n?[^\n]*[^\h,'""][+])[\s.,:!?')}]" 2:strikethrough +add-highlighter shared/org/inline/text/verbatim regex "(^|[\h({'""])([=][^\h,'""][^\n]*?\n?[^\n]*[^\h,'""][=])[\s.,:!?')}]" 2:meta +add-highlighter shared/org/inline/text/code regex "(^|[\h({'""])([~][^\h,'""][^\n]*?\n?[^\n]*[^\h,'""][~])[\s.,:!?')}]" 2:mono +add-highlighter shared/org/inline/text/underlined regex "(^|[\h({'""])([_][^\h,'""][^\n]*?\n?[^\n]*[^\h,'""][_])[\s.,:!?')}]" 2:underline +## will be deprecated in future releases of Org but currently is supported +add-highlighter shared/org/inline/text/inline-math regex "(^|[\h({'""])([$][^\h,'""][^\n]*?\n?[^\n]*[^\h,'""][$])[\s.,:!?')}]" 2:mono ## bold is kinda tricky because we need to HL everything but headings, so it's split up on several regexps -add-highlighter shared/org/inline/text/bold regex "(?:^|[\h({'i""])([*][^\h,'""*][^\n]*?(\n{1})?[^\n]*?[*])\W|([*]{3,})\n|\h([*]{3})[\s.,:!?')}]" 1:bold +add-highlighter shared/org/inline/text/bold regex "(?:^|[\h({'""])([*][^\h,'""*][^\n]*?(\n{1})?[^\n]*?[*])\W|([*]{3,})\n|\h([*]{3})[\s.,:!?')}]" 1:bold # LaTeX add-highlighter shared/org/LaTeX region -match-capture '\\begin\{([A-Za-z0-9*]+)\}' '\\end\{([A-Za-z0-9*]+)\}' fill string -# LaTeX Math -add-highlighter shared/org/math1 region '[$]{2}' '[$]{2}' fill mono +## LaTeX Math +add-highlighter shared/org/math1 region '[$]{2}' '[$]{2}' fill mono # will be deprecated in future releases of Org but currently is supported add-highlighter shared/org/math2 region '\\\[' '\\\]' fill mono add-highlighter shared/org/math3 region '\\\(' '\\\)' fill mono From 3fed6948dc4a910b276bf85ad2a6905f9f3050ae Mon Sep 17 00:00:00 2001 From: Andrey Orst Date: Sun, 14 Apr 2019 12:44:41 +0300 Subject: [PATCH 39/56] better detection of TODO items on startup --- rc/filetype/org.kak | 24 +++++++++++++++++------- 1 file changed, 17 insertions(+), 7 deletions(-) diff --git a/rc/filetype/org.kak b/rc/filetype/org.kak index 5046c09c8a..89c4daf6c1 100644 --- a/rc/filetype/org.kak +++ b/rc/filetype/org.kak @@ -17,9 +17,9 @@ set-face global org_priority value # that will be used in `dynregex' highlighters. We also need to update these # items when opening file. declare-option -docstring "Org Mode todo markers. You can customize this option directly, following the format, or by using `#+TODO:' in your document: - document format: #+TODO: state1 state2 ... stateN done - manual format: '(state1|state2|...|stateN)|(done)' -Colors for TODO items can be customized with `org_todo' and `org_done' faces. + document format: #+TODO: todo1 todo2 ... todoN | done1 done2 ... doneN + manual format: '(todo1|todo2|...|todoN)|(done1|done2|...|doneN)' +# Colors for TODO items can be customized with `org_todo' and `org_done' faces. " \ regex org_todo "(TODO)|(DONE)" @@ -37,12 +37,22 @@ hook global BufCreate .*[.]org %{ # Update `org_todo_items' and `org_priority_items' when opening file evaluate-commands -save-regs '"/' %{ try %{ - execute-keys -draft '/(?i)#\+TODO:[^\n]+f:ly: set-option buffer org_todo_items %reg{dquote}' - set-option buffer org_todo_items %sh{ printf "%s\n" " ${kak_opt_org_todo_items}" | sed -E "s/\s+/|/g;s/^\|//;s/(.*)\|(\w+)$/(\1)|(\2)/" } + execute-keys -draft '/(?i)#\+(SEQ_|TYP_)?TODO:[^\n]+f:ly: set-option buffer org_todo %reg{dquote}' + set-option buffer org_todo %sh{ printf "%s\n" "${kak_opt_org_todo}" | perl -pe 'if (/^.*\|.*$/) { + $_ =~ s/(.*)\|(.*)/($1)|($2)/; + $_ =~ s/\(\s+/(/g; + $_ =~ s/\s+\)/)/g; + $_ =~ s/[\t ]+/|/g; + } else { + $_ =~ s/(.*) ([^\s]+$)/($1)|($2)/; + $_ =~ s/\(\s+/(/g; + $_ =~ s/\s+\)/)/g; + $_ =~ s/[\t ]+/|/g; + }' } } try %{ - execute-keys -draft '/(?i)#\+PRIORITIES:[^\n]+f:ls\h*\w(\s+)?(\w)?(\s+)?(\w)?\sy: set-option buffer org_priority_items %reg{dquote}' - set-option buffer org_priority_items %sh{ printf "%s\n" "${kak_opt_org_priority_items}" | sed -E "s/ /|/g" } + execute-keys -draft '/(?i)#\+PRIORITIES:[^\n]+f:ls\h*\w(\s+)?(\w)?(\s+)?(\w)?\sy: set-option buffer org_priority %reg{dquote}' + set-option buffer org_priority %sh{ printf "%s\n" "${kak_opt_org_priority}" | sed -E "s/ /|/g" } } } } From 3467e0447f4f188a5fc381cb77e33d38c5a7fafb Mon Sep 17 00:00:00 2001 From: Andrey Orst Date: Sun, 14 Apr 2019 14:10:44 +0300 Subject: [PATCH 40/56] better heading highlighting --- rc/filetype/org.kak | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/rc/filetype/org.kak b/rc/filetype/org.kak index 89c4daf6c1..18583789a5 100644 --- a/rc/filetype/org.kak +++ b/rc/filetype/org.kak @@ -123,11 +123,13 @@ add-highlighter shared/org/inline/text/ordered-lists regex '^\h*(\d+[.)])\h+' 1: # Headings. Also includes highlighting groups for TODO and PRIORITIES # format: STARS TODO PRIORITY TEXT TAGS -add-highlighter shared/org/inline/text/heading dynregex '^(?:[*]{1}|[*]{5}|[*]{9})\h+(?:(?:%opt{org_todo})\h+)?(\[#(?:%opt{org_priority})\])?[^\n]*(:[^:\n]+?:)?\n' 0:header 1:org_todo 2:org_done 3:org_priority 4:module -add-highlighter shared/org/inline/text/section dynregex '^(?:[*]{2}|[*]{6}|[*]{10})\h+(?:(?:%opt{org_todo})\h+)?(\[#(?:%opt{org_priority})\])?[^\n]*(:[^:\n]+?:)?\n' 0:section 1:org_todo 2:org_done 3:org_priority 4:module -add-highlighter shared/org/inline/text/subsection dynregex '^(?:[*]{3}|[*]{7}|[*]{11})\h+(?:(?:%opt{org_todo})\h+)?(\[#(?:%opt{org_priority})\])?[^\n]*(:[^:\n]+?:)?\n' 0:subsection 1:org_todo 2:org_done 3:org_priority 4:module -add-highlighter shared/org/inline/text/subsubsection dynregex '^(?:[*]{4}|[*]{8}|[*]{12,})\h+(?:(?:%opt{org_todo})\h+)?(\[#(?:%opt{org_priority})\])?[^\n]*(:[^:\n]+?:)?\n' 0:subsubsection 1:org_todo 2:org_done 3:org_priority 4:module - +add-highlighter shared/org/inline/text/heading regex '^(?:[*]{1}|[*]{5}|[*]{9})\h+[^\n]*?(:[^:\n]*?:)?\n' 0:header 1:module +add-highlighter shared/org/inline/text/section regex '^(?:[*]{2}|[*]{6}|[*]{10})\h+[^\n]*?(:[^:\n]*?:)?\n' 0:section 1:module +add-highlighter shared/org/inline/text/subsection regex '^(?:[*]{3}|[*]{7}|[*]{11})\h+[^\n]*?(:[^:\n]*?:)?\n' 0:subsection 1:module +add-highlighter shared/org/inline/text/subsubsection regex '^(?:[*]{4}|[*]{8}|[*]{12,})\h+[^\n]*?(:[^:\n]*?:)?\n' 0:subsubsection 1:module +add-highlighter shared/org/inline/text/heading_todo dynregex '^(?:[*]+)\h+%opt{org_todo}' 1:org_todo 2:org_done +add-highlighter shared/org/inline/text/heading_priority dynregex '^(?:[*]+)\h+[^\n\[]*(\[#(?:%opt{org_priority})\])' 1:org_priority +# (?:(?:%opt{org_todo})\h+)?(\[#(?:%opt{org_priority})\])? # Options add-highlighter shared/org/inline/text/option regex "(?i)#\+[a-z]\w*\b[^\n]*" 0:module add-highlighter shared/org/inline/text/title regex "(?i)#\+title:([^\n]+)" 0:module 1:title From 58fdee08c1562f70c6614b13ac67a9190996099b Mon Sep 17 00:00:00 2001 From: Andrey Orst Date: Sun, 14 Apr 2019 14:11:50 +0300 Subject: [PATCH 41/56] fix link --- rc/filetype/org.kak | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rc/filetype/org.kak b/rc/filetype/org.kak index 18583789a5..679c44ea28 100644 --- a/rc/filetype/org.kak +++ b/rc/filetype/org.kak @@ -193,7 +193,7 @@ add-highlighter shared/org/inline/text/footnote regex "\[fn:([\w-_]+)?(:[^\n]+)? # Links add-highlighter shared/org/inline/text/link1 regex "<[^<>\n]+:[^<>\n\]]+?>" 0:link -add-highlighter shared/org/inline/text/link2 regex "(?:^|\h)([\[]{2}[^\n\[\]]*?[\]]{2})\W" 0:link +add-highlighter shared/org/inline/text/link2 regex "(?:^|\h)([\[]{2}[^\n]*?[\]]{2})\W" 0:link # Targets add-highlighter shared/org/inline/text/org_target regex '[<]{2}[^\s<>][^\n<>]+[^\s<>][>]{2}' 0:link From 9282240e8f2e6e7564f7f385013c7593fb5a71c0 Mon Sep 17 00:00:00 2001 From: Andrey Orst Date: Sun, 14 Apr 2019 14:36:08 +0300 Subject: [PATCH 42/56] tweak markup to handle three chars correctly --- rc/filetype/org.kak | 34 +++++++++++++++++----------------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/rc/filetype/org.kak b/rc/filetype/org.kak index 679c44ea28..9f7f4193e0 100644 --- a/rc/filetype/org.kak +++ b/rc/filetype/org.kak @@ -17,15 +17,15 @@ set-face global org_priority value # that will be used in `dynregex' highlighters. We also need to update these # items when opening file. declare-option -docstring "Org Mode todo markers. You can customize this option directly, following the format, or by using `#+TODO:' in your document: - document format: #+TODO: todo1 todo2 ... todoN | done1 done2 ... doneN - manual format: '(todo1|todo2|...|todoN)|(done1|done2|...|doneN)' + document format: #+TODO: todo1 todo2 ... todoN | done1 done2 ... doneN + manual format: '(todo1|todo2|...|todoN)|(done1|done2|...|doneN)' # Colors for TODO items can be customized with `org_todo' and `org_done' faces. " \ regex org_todo "(TODO)|(DONE)" declare-option -docstring "Org Mode priorities. You can customize this option directly, or by using `#+PRIORITIES:' in your document. Please make sure that the highest priority is earlier in the alphabet than the lowest priority: - document format: #+PRIORITIES: A C B - manual format: 'A|C|B' + document format: #+PRIORITIES: A C B + manual format: 'A|C|B' Colors for priority items can be customized with `org_priority' face." \ regex org_priority "A|C|B" @@ -37,7 +37,7 @@ hook global BufCreate .*[.]org %{ # Update `org_todo_items' and `org_priority_items' when opening file evaluate-commands -save-regs '"/' %{ try %{ - execute-keys -draft '/(?i)#\+(SEQ_|TYP_)?TODO:[^\n]+f:ly: set-option buffer org_todo %reg{dquote}' + execute-keys -draft '/(?i)^\h*#\+(SEQ_|TYP_)?TODO:[^\n]+f:ly: set-option buffer org_todo %reg{dquote}' set-option buffer org_todo %sh{ printf "%s\n" "${kak_opt_org_todo}" | perl -pe 'if (/^.*\|.*$/) { $_ =~ s/(.*)\|(.*)/($1)|($2)/; $_ =~ s/\(\s+/(/g; @@ -51,7 +51,7 @@ hook global BufCreate .*[.]org %{ }' } } try %{ - execute-keys -draft '/(?i)#\+PRIORITIES:[^\n]+f:ls\h*\w(\s+)?(\w)?(\s+)?(\w)?\sy: set-option buffer org_priority %reg{dquote}' + execute-keys -draft '/(?i)^\h*#\+PRIORITIES:[^\n]+f:ls\h*\w(\s+)?(\w)?(\s+)?(\w)?\sy: set-option buffer org_priority %reg{dquote}' set-option buffer org_priority %sh{ printf "%s\n" "${kak_opt_org_priority}" | sed -E "s/ /|/g" } } } @@ -140,20 +140,20 @@ add-highlighter shared/org/inline/text/drawer regex "^\h*([:][^\s][^\n]*?[^\s] # Timestamps declare-option -docstring "Org date - format: YYYY-MM-DD DAYNAME" \ + format: YYYY-MM-DD DAYNAME" \ regex org_date '\d\d\d\d-\d\d-\d\d\h+[^\s-+>\]\d]+' declare-option -docstring "Org time - format H:MM" \ + format H:MM" \ regex org_time '([0-2])?[0-9]:[0-5][0-9]' declare-option -docstring "Org repeater or delay - format: (.+|++) or (-|--) digit (hour|day|week|month|year) + format: (.+|++) or (-|--) digit (hour|day|week|month|year) " \ regex org_repeater_or_delay '([.+][+]|[-]{1,2})\h+\d\h+[hdwmy]' declare-option -docstring "Org timestamp - format: DATE TIME REPEATER-OR-DELAY" \ + format: DATE TIME REPEATER-OR-DELAY" \ regex org_timestamp "%opt{org_date}(\h+%opt{org_time}(-%opt{org_time})?(\h+%opt{org_repeater_or_delay})?)?" add-highlighter shared/org/inline/text/timestamp_active dynregex "<%opt{org_timestamp}(--%opt{org_timestamp})?>" 0:keyword @@ -167,15 +167,15 @@ add-highlighter shared/org/inline/text/timestamp_inactive dynregex "\[%opt{org_t ## BORDER: any non-whitespace, and not `,` `'` or `"` ## BODY: any character, can't be longer than tho lines ## POST: a whitespace character, `-`, `.`, `,`, `:`, `!`, `?`, `'`, `)`, `}` -add-highlighter shared/org/inline/text/italic regex "(^|[\h({'""])([/][^\h,'""][^\n]*?\n?[^\n]*[^\h,'""][/])[\s.,:!?')}]" 2:italic -add-highlighter shared/org/inline/text/strikethrough regex "(^|[\h({'""])([+][^\h,'""][^\n]*?\n?[^\n]*[^\h,'""][+])[\s.,:!?')}]" 2:strikethrough -add-highlighter shared/org/inline/text/verbatim regex "(^|[\h({'""])([=][^\h,'""][^\n]*?\n?[^\n]*[^\h,'""][=])[\s.,:!?')}]" 2:meta -add-highlighter shared/org/inline/text/code regex "(^|[\h({'""])([~][^\h,'""][^\n]*?\n?[^\n]*[^\h,'""][~])[\s.,:!?')}]" 2:mono -add-highlighter shared/org/inline/text/underlined regex "(^|[\h({'""])([_][^\h,'""][^\n]*?\n?[^\n]*[^\h,'""][_])[\s.,:!?')}]" 2:underline +add-highlighter shared/org/inline/text/italic regex "(^|[\h({'""])([/][^\h,'""][^\n]*?(\n[^\n]*?[^,'""\s])?[/])[\s.,:!?')}]" 2:italic +add-highlighter shared/org/inline/text/strikethrough regex "(^|[\h({'""])([+][^\h,'""][^\n]*?(\n[^\n]*?[^,'""\s])?[+])[\s.,:!?')}]" 2:strikethrough +add-highlighter shared/org/inline/text/verbatim regex "(^|[\h({'""])([=][^\h,'""][^\n]*?(\n[^\n]*?[^,'""\s])?[=])[\s.,:!?')}]" 2:meta +add-highlighter shared/org/inline/text/code regex "(^|[\h({'""])([~][^\h,'""][^\n]*?(\n[^\n]*?[^,'""\s])?[~])[\s.,:!?')}]" 2:mono +add-highlighter shared/org/inline/text/underlined regex "(^|[\h({'""])([_][^\h,'""][^\n]*?(\n[^\n]*?[^,'""\s])?[_])[\s.,:!?')}]" 2:underline ## will be deprecated in future releases of Org but currently is supported -add-highlighter shared/org/inline/text/inline-math regex "(^|[\h({'""])([$][^\h,'""][^\n]*?\n?[^\n]*[^\h,'""][$])[\s.,:!?')}]" 2:mono +add-highlighter shared/org/inline/text/inline-math regex "(^|[\h({'""])([$][^\h,'""][^\n]*?(\n[^\n]*?[^,'""\s])?[$])[\s.,:!?')}]" 2:mono ## bold is kinda tricky because we need to HL everything but headings, so it's split up on several regexps -add-highlighter shared/org/inline/text/bold regex "(?:^|[\h({'""])([*][^\h,'""*][^\n]*?(\n{1})?[^\n]*?[*])\W|([*]{3,})\n|\h([*]{3})[\s.,:!?')}]" 1:bold +add-highlighter shared/org/inline/text/bold regex "(?:^|[\h({'""])([*][^\h,'""][^\n]*?(\n[^\n]*?[^,'""\s])?[*])[\s.,:!?')}]|([*]{3,})\n|\h([*]{3})[\s.,:!?')}]" 1:bold # LaTeX add-highlighter shared/org/LaTeX region -match-capture '\\begin\{([A-Za-z0-9*]+)\}' '\\end\{([A-Za-z0-9*]+)\}' fill string From 5c4073ba4f2ba7dde0d11427acc636a1954f3edb Mon Sep 17 00:00:00 2001 From: Andrey Orst Date: Sun, 14 Apr 2019 14:50:00 +0300 Subject: [PATCH 43/56] provide reparse command --- rc/filetype/org.kak | 54 +++++++++++++++++++++++++++------------------ 1 file changed, 32 insertions(+), 22 deletions(-) diff --git a/rc/filetype/org.kak b/rc/filetype/org.kak index 9f7f4193e0..6aaa7c0747 100644 --- a/rc/filetype/org.kak +++ b/rc/filetype/org.kak @@ -35,26 +35,7 @@ regex org_priority "A|C|B" hook global BufCreate .*[.]org %{ set-option buffer filetype org # Update `org_todo_items' and `org_priority_items' when opening file - evaluate-commands -save-regs '"/' %{ - try %{ - execute-keys -draft '/(?i)^\h*#\+(SEQ_|TYP_)?TODO:[^\n]+f:ly: set-option buffer org_todo %reg{dquote}' - set-option buffer org_todo %sh{ printf "%s\n" "${kak_opt_org_todo}" | perl -pe 'if (/^.*\|.*$/) { - $_ =~ s/(.*)\|(.*)/($1)|($2)/; - $_ =~ s/\(\s+/(/g; - $_ =~ s/\s+\)/)/g; - $_ =~ s/[\t ]+/|/g; - } else { - $_ =~ s/(.*) ([^\s]+$)/($1)|($2)/; - $_ =~ s/\(\s+/(/g; - $_ =~ s/\s+\)/)/g; - $_ =~ s/[\t ]+/|/g; - }' } - } - try %{ - execute-keys -draft '/(?i)^\h*#\+PRIORITIES:[^\n]+f:ls\h*\w(\s+)?(\w)?(\s+)?(\w)?\sy: set-option buffer org_priority %reg{dquote}' - set-option buffer org_priority %sh{ printf "%s\n" "${kak_opt_org_priority}" | sed -E "s/ /|/g" } - } - } + org-parse-file } # Highlighters @@ -127,8 +108,8 @@ add-highlighter shared/org/inline/text/heading regex '^(?:[*]{1}|[*]{ add-highlighter shared/org/inline/text/section regex '^(?:[*]{2}|[*]{6}|[*]{10})\h+[^\n]*?(:[^:\n]*?:)?\n' 0:section 1:module add-highlighter shared/org/inline/text/subsection regex '^(?:[*]{3}|[*]{7}|[*]{11})\h+[^\n]*?(:[^:\n]*?:)?\n' 0:subsection 1:module add-highlighter shared/org/inline/text/subsubsection regex '^(?:[*]{4}|[*]{8}|[*]{12,})\h+[^\n]*?(:[^:\n]*?:)?\n' 0:subsubsection 1:module -add-highlighter shared/org/inline/text/heading_todo dynregex '^(?:[*]+)\h+%opt{org_todo}' 1:org_todo 2:org_done -add-highlighter shared/org/inline/text/heading_priority dynregex '^(?:[*]+)\h+[^\n\[]*(\[#(?:%opt{org_priority})\])' 1:org_priority +add-highlighter shared/org/inline/text/heading_todo dynregex '^[*]+\h+(?:%opt{org_todo})' 1:org_todo 2:org_done +add-highlighter shared/org/inline/text/heading_priority dynregex '^[*]+\h+[^\n\[]*(\[#(?:%opt{org_priority})\])' 1:org_priority # (?:(?:%opt{org_todo})\h+)?(\[#(?:%opt{org_priority})\])? # Options add-highlighter shared/org/inline/text/option regex "(?i)#\+[a-z]\w*\b[^\n]*" 0:module @@ -216,6 +197,35 @@ define-command -hidden org-indent-on-new-line %{ } } +define-command -docstring "" \ +org-parse-file %{ evaluate-commands -save-regs '"/' %{ + # Parse TODO items + try %{ + execute-keys -draft '/(?i)^\h*#\+(SEQ_|TYP_)?TODO:[^\n]+f:ly: set-option buffer org_todo %reg{dquote}' + # This Perl code transforms these two lines to similar formats: + # `word1 word2 word3 word4' to `(word1|word2|word3)|(word4)', + # and `word1 word2 | word3 word4' to `(word1|word2)|(word3|word4)'. + # This regex is later used in to highlight todo items in headings. + set-option buffer org_todo %sh{ printf "%s\n" "${kak_opt_org_todo}" | perl -pe 'if (/^.*\|.*$/) { + $_ =~ s/(.*)\|(.*)/($1)|($2)/; + $_ =~ s/\(\s+/(/g; + $_ =~ s/\s+\)/)/g; + $_ =~ s/[\t ]+/|/g; + } else { + $_ =~ s/(.*) ([^\s]+$)/($1)|($2)/; + $_ =~ s/\(\s+/(/g; + $_ =~ s/\s+\)/)/g; + $_ =~ s/[\t ]+/|/g; + }' } + } + # Parse priority items + try %{ + # this `execute-keys' selects first three letters in `#+PRIORITIES' line + execute-keys -draft '/(?i)^\h*#\+PRIORITIES:[^\n]+f:ls\h*\w(\s+)?(\w)?(\s+)?(\w)?\sy: set-option buffer org_priority %reg{dquote}' + set-option buffer org_priority %sh{ printf "%s\n" "${kak_opt_org_priority}" | sed -E "s/ /|/g" } + } +}} + # Initialization # ‾‾‾‾‾‾‾‾‾‾‾‾‾‾ From d5bd2e6bf4bb5898a203d03b1cd893cde97bc9ef Mon Sep 17 00:00:00 2001 From: Andrey Orst Date: Sun, 14 Apr 2019 14:57:15 +0300 Subject: [PATCH 44/56] tweak timestamp and link --- rc/filetype/org.kak | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/rc/filetype/org.kak b/rc/filetype/org.kak index 6aaa7c0747..72b5d5506f 100644 --- a/rc/filetype/org.kak +++ b/rc/filetype/org.kak @@ -137,8 +137,7 @@ declare-option -docstring "Org timestamp format: DATE TIME REPEATER-OR-DELAY" \ regex org_timestamp "%opt{org_date}(\h+%opt{org_time}(-%opt{org_time})?(\h+%opt{org_repeater_or_delay})?)?" -add-highlighter shared/org/inline/text/timestamp_active dynregex "<%opt{org_timestamp}(--%opt{org_timestamp})?>" 0:keyword -add-highlighter shared/org/inline/text/timestamp_inactive dynregex "\[%opt{org_timestamp}(--%opt{org_timestamp})?\]" 0:comment +add-highlighter shared/org/inline/text/timestamp dynregex "[\[<]%opt{org_timestamp}([\]>]--[\[<]%opt{org_timestamp})?[\]>]" 0:variable # Markup ## FORMAT: PRE MARKER CONTENTS MARKER POST @@ -173,7 +172,7 @@ add-highlighter shared/org/inline/text/export regex "@@[a-zA-Z-]+:.*?@@" 0:mono add-highlighter shared/org/inline/text/footnote regex "\[fn:([\w-_]+)?(:[^\n]+)?\]" 0:link # Links -add-highlighter shared/org/inline/text/link1 regex "<[^<>\n]+:[^<>\n\]]+?>" 0:link +add-highlighter shared/org/inline/text/link1 regex "<[^<>\n\d]+:[^<>\n\]]+?>" 0:link add-highlighter shared/org/inline/text/link2 regex "(?:^|\h)([\[]{2}[^\n]*?[\]]{2})\W" 0:link # Targets From 838cc0db37e25e9dfea9b9af8a25a9fd954c353d Mon Sep 17 00:00:00 2001 From: Andrey Orst Date: Mon, 29 Apr 2019 14:10:55 +0300 Subject: [PATCH 45/56] provide orgmode module --- rc/filetype/org.kak | 3 +++ 1 file changed, 3 insertions(+) diff --git a/rc/filetype/org.kak b/rc/filetype/org.kak index 72b5d5506f..5310527a74 100644 --- a/rc/filetype/org.kak +++ b/rc/filetype/org.kak @@ -1,6 +1,7 @@ # https://orgmode.org/ - your life in plain text # ‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾ +provide-module orgmode %& # Faces # ‾‾‾‾‾ @@ -237,3 +238,5 @@ hook global WinSetOption filetype=org %{ hook window InsertChar \n -group org-indent org-indent-on-new-line hook -once -always window WinSetOption filetype=.* %{ remove-hooks window org-.+ } } + +& From 8458cb0c0837557188e2a6c42b7c7889eb99db19 Mon Sep 17 00:00:00 2001 From: Andrey Orst Date: Mon, 29 Apr 2019 15:03:36 +0300 Subject: [PATCH 46/56] create new faces based on existing ones, adjust detection --- rc/filetype/org.kak | 63 ++++++++++++++++++++++++--------------------- 1 file changed, 34 insertions(+), 29 deletions(-) diff --git a/rc/filetype/org.kak b/rc/filetype/org.kak index 5310527a74..2f7bac4326 100644 --- a/rc/filetype/org.kak +++ b/rc/filetype/org.kak @@ -1,14 +1,40 @@ # https://orgmode.org/ - your life in plain text # ‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾ +# Detection +# ‾‾‾‾‾‾‾‾‾ + +hook global BufCreate .*[.]org %{ + set-option buffer filetype org +} + +# Initialization +# ‾‾‾‾‾‾‾‾‾‾‾‾‾‾ + +hook global WinSetOption filetype=org %{ + require-module orgmode + hook window InsertChar \n -group org-indent org-indent-on-new-line + hook -once -always window WinSetOption filetype=.* %{ remove-hooks window org-.+ } + org-parse-file +} + +hook -group org-highlight global WinSetOption filetype=org %{ + add-highlighter window/org ref org + hook -once -always window WinSetOption filetype=.* %{ remove-highlighter window/org } +} + provide-module orgmode %& # Faces # ‾‾‾‾‾ -set-face global org_todo red+b -set-face global org_done green+b -set-face global org_priority value +set-face global org_todo default,default+b@Error +set-face global org_done default,default+b@string +set-face global org_priority default,default@value +set-face global org_heading default,default+b@header +set-face global org_section default,default@function +set-face global org_subsection default,default@variable +set-face global org_subsubsection default,default@module # Options # ‾‾‾‾‾‾‾ @@ -30,14 +56,6 @@ declare-option -docstring "Org Mode priorities. You can customize this option di Colors for priority items can be customized with `org_priority' face." \ regex org_priority "A|C|B" -# Detection -# ‾‾‾‾‾‾‾‾‾ - -hook global BufCreate .*[.]org %{ - set-option buffer filetype org - # Update `org_todo_items' and `org_priority_items' when opening file - org-parse-file -} # Highlighters # ‾‾‾‾‾‾‾‾‾‾‾‾ @@ -105,10 +123,10 @@ add-highlighter shared/org/inline/text/ordered-lists regex '^\h*(\d+[.)])\h+' 1: # Headings. Also includes highlighting groups for TODO and PRIORITIES # format: STARS TODO PRIORITY TEXT TAGS -add-highlighter shared/org/inline/text/heading regex '^(?:[*]{1}|[*]{5}|[*]{9})\h+[^\n]*?(:[^:\n]*?:)?\n' 0:header 1:module -add-highlighter shared/org/inline/text/section regex '^(?:[*]{2}|[*]{6}|[*]{10})\h+[^\n]*?(:[^:\n]*?:)?\n' 0:section 1:module -add-highlighter shared/org/inline/text/subsection regex '^(?:[*]{3}|[*]{7}|[*]{11})\h+[^\n]*?(:[^:\n]*?:)?\n' 0:subsection 1:module -add-highlighter shared/org/inline/text/subsubsection regex '^(?:[*]{4}|[*]{8}|[*]{12,})\h+[^\n]*?(:[^:\n]*?:)?\n' 0:subsubsection 1:module +add-highlighter shared/org/inline/text/heading regex '^(?:[*]{1}|[*]{5}|[*]{9})\h+[^\n]*?(:[^:\n]*?:)?\n' 0:org_heading 1:module +add-highlighter shared/org/inline/text/section regex '^(?:[*]{2}|[*]{6}|[*]{10})\h+[^\n]*?(:[^:\n]*?:)?\n' 0:org_section 1:module +add-highlighter shared/org/inline/text/subsection regex '^(?:[*]{3}|[*]{7}|[*]{11})\h+[^\n]*?(:[^:\n]*?:)?\n' 0:org_subsection 1:module +add-highlighter shared/org/inline/text/subsubsection regex '^(?:[*]{4}|[*]{8}|[*]{12,})\h+[^\n]*?(:[^:\n]*?:)?\n' 0:org_subsubsection 1:module add-highlighter shared/org/inline/text/heading_todo dynregex '^[*]+\h+(?:%opt{org_todo})' 1:org_todo 2:org_done add-highlighter shared/org/inline/text/heading_priority dynregex '^[*]+\h+[^\n\[]*(\[#(?:%opt{org_priority})\])' 1:org_priority # (?:(?:%opt{org_todo})\h+)?(\[#(?:%opt{org_priority})\])? @@ -197,7 +215,7 @@ define-command -hidden org-indent-on-new-line %{ } } -define-command -docstring "" \ +define-command -docstring "set up org TODO and PRIORITY items based on file contents" \ org-parse-file %{ evaluate-commands -save-regs '"/' %{ # Parse TODO items try %{ @@ -226,17 +244,4 @@ org-parse-file %{ evaluate-commands -save-regs '"/' %{ } }} -# Initialization -# ‾‾‾‾‾‾‾‾‾‾‾‾‾‾ - -hook -group org-highlight global WinSetOption filetype=org %{ - add-highlighter window/org ref org - hook -once -always window WinSetOption filetype=.* %{ remove-highlighter window/org } -} - -hook global WinSetOption filetype=org %{ - hook window InsertChar \n -group org-indent org-indent-on-new-line - hook -once -always window WinSetOption filetype=.* %{ remove-hooks window org-.+ } -} - & From e10e764bfefeac576bb7c45cd93bc08392a81064 Mon Sep 17 00:00:00 2001 From: Andrey Orst Date: Mon, 29 Apr 2019 15:07:26 +0300 Subject: [PATCH 47/56] remove section highlighters, as they are now declared by org.kak --- colors/base16.kak | 3 --- colors/default.kak | 3 --- colors/desertex.kak | 3 --- colors/github.kak | 3 --- colors/gruvbox.kak | 3 --- colors/lucius.kak | 3 --- colors/palenight.kak | 3 --- colors/red-phoenix.kak | 3 --- colors/reeder.kak | 3 --- colors/solarized-dark.kak | 3 --- colors/solarized-light.kak | 3 --- colors/tomorrow-night.kak | 3 --- colors/zenburn.kak | 3 --- 13 files changed, 39 deletions(-) diff --git a/colors/base16.kak b/colors/base16.kak index 50afdca1e1..fd0d668b04 100644 --- a/colors/base16.kak +++ b/colors/base16.kak @@ -36,9 +36,6 @@ evaluate-commands %sh{ echo " face global title blue face global header ${cyan_light} - face global section ${cyan_light} - face global subsection ${purple_dark} - face global subsubsection ${magenta_dark} face global bold ${orange_light}+b face global italic ${orange_dark}+i face global underline ${magenta_dark}+u diff --git a/colors/default.kak b/colors/default.kak index 1597bb8043..573217043a 100644 --- a/colors/default.kak +++ b/colors/default.kak @@ -17,9 +17,6 @@ face global builtin default+b # For markup face global title blue face global header cyan -face global section blue -face global subsection magenta -face global subsubsection red face global bold red+b face global italic yellow+i face global underline blue+u diff --git a/colors/desertex.kak b/colors/desertex.kak index 94f088f520..a56fd2167f 100644 --- a/colors/desertex.kak +++ b/colors/desertex.kak @@ -17,9 +17,6 @@ face global meta rgb:ee799f # Markup face global title blue face global header cyan -face global section blue -face global subsection magenta -face global subsubsection red face global bold red+b face global italic yellow+i face global underline blue+u diff --git a/colors/github.kak b/colors/github.kak index 34b504edb2..f03496f06e 100644 --- a/colors/github.kak +++ b/colors/github.kak @@ -20,9 +20,6 @@ face global builtin default+b ## markup face global title blue face global header cyan -face global section blue -face global subsection magenta -face global subsubsection red face global bold red+b face global italic yellow+i face global underline blue+u diff --git a/colors/gruvbox.kak b/colors/gruvbox.kak index b21fa5febf..2a07154fcf 100644 --- a/colors/gruvbox.kak +++ b/colors/gruvbox.kak @@ -40,9 +40,6 @@ evaluate-commands %sh{ # Markdown highlighting face global title ${green}+b face global header ${orange} - face global section ${aqua} - face global subsection ${blue} - face global subsubsection ${purple} face global bold ${fg}+b face global italic ${fg}+i face global underline ${fg}+u diff --git a/colors/lucius.kak b/colors/lucius.kak index 44dd24765d..f51abf1264 100644 --- a/colors/lucius.kak +++ b/colors/lucius.kak @@ -40,9 +40,6 @@ evaluate-commands %sh{ # and markup face global title ${lucius_light_blue} face global header ${lucius_light_green} - face global section ${lucius_light_blue} - face global subsection ${lucius_blue} - face global subsubsection ${lucius_dark_blue} face global bold ${lucius_blue}+b face global italic ${lucius_light_grey}+i face global underline ${lucius_green}+u diff --git a/colors/palenight.kak b/colors/palenight.kak index a61d905607..a080aa8e09 100644 --- a/colors/palenight.kak +++ b/colors/palenight.kak @@ -43,9 +43,6 @@ evaluate-commands %sh{ # Markup face global title $blue face global header $cyan - face global section $blue - face global subsection $purple - face global subsubsection $red face global bold $red+b face global italic $yellow+i face global underline $blue+u diff --git a/colors/red-phoenix.kak b/colors/red-phoenix.kak index 3dbf7bcbad..c974bbda9f 100644 --- a/colors/red-phoenix.kak +++ b/colors/red-phoenix.kak @@ -51,9 +51,6 @@ evaluate-commands %sh{ echo " face global title ${blue} face global header ${orange1} - face global section ${light_orange1} - face global subsection ${tan3} - face global subsubsection ${orange2} face global bold ${orange2}+b face global italic ${orange3}+i face global underline ${orange3}+u diff --git a/colors/reeder.kak b/colors/reeder.kak index 5eaedddbf0..459c961b55 100644 --- a/colors/reeder.kak +++ b/colors/reeder.kak @@ -38,9 +38,6 @@ evaluate-commands %sh{ # and markup face global title ${orange}+b face global header ${orange}+b - face global section ${orange} - face global subsection ${brown_light} - face global subsubsection ${brown_dark} face global bold default+b face global italic default+i face global underline default+u diff --git a/colors/solarized-dark.kak b/colors/solarized-dark.kak index 9dfce43279..6e685b16c5 100644 --- a/colors/solarized-dark.kak +++ b/colors/solarized-dark.kak @@ -36,9 +36,6 @@ evaluate-commands %sh{ # markup face global title ${blue}+b face global header ${blue} - face global section ${cyan} - face global subsection ${magenta} - face global subsubsection ${orange} face global bold ${base0}+b face global italic ${base0}+i face global underline ${base0}+u diff --git a/colors/solarized-light.kak b/colors/solarized-light.kak index ab28548cab..899d0b3240 100644 --- a/colors/solarized-light.kak +++ b/colors/solarized-light.kak @@ -36,9 +36,6 @@ evaluate-commands %sh{ # markup face global title ${blue}+b face global header ${blue} - face global section ${cyan} - face global subsection ${orange} - face global subsubsection ${magenta} face global bold ${base01}+b face global italic ${base01}+i face global underline ${base01}+u diff --git a/colors/tomorrow-night.kak b/colors/tomorrow-night.kak index 43d900101c..1411c5777e 100644 --- a/colors/tomorrow-night.kak +++ b/colors/tomorrow-night.kak @@ -41,9 +41,6 @@ evaluate-commands %sh{ echo " face global title ${blue} face global header ${aqua} - face global section ${aqua} - face global subsection ${purple} - face global subsubsection ${magenta} face global bold ${yellow}+b face global italic ${orange}+i face global underline ${blue}+u diff --git a/colors/zenburn.kak b/colors/zenburn.kak index f795f2ba1c..b6ddb970a7 100644 --- a/colors/zenburn.kak +++ b/colors/zenburn.kak @@ -47,9 +47,6 @@ evaluate-commands %sh{ # and markup face global title ${zenkeyword} face global header ${zenconstant} - face global section ${zenstring} - face global subsection ${zencomment} - face global subsubsection ${zenfunction} face global bold ${zenstorageClass}+b face global italic ${zenfunction}+i face global underline ${zenvariable}+u From 75b4bc2059996e2a86a68439b05adf5b37a99211 Mon Sep 17 00:00:00 2001 From: Andrey Orst Date: Mon, 29 Apr 2019 15:12:27 +0300 Subject: [PATCH 48/56] remove underline and strikethrough faces from builtin colorschemes, declare those in org.kak --- colors/base16.kak | 2 -- colors/default.kak | 2 -- colors/desertex.kak | 2 -- colors/github.kak | 2 -- colors/gruvbox.kak | 2 -- colors/lucius.kak | 2 -- colors/palenight.kak | 2 -- colors/red-phoenix.kak | 2 -- colors/reeder.kak | 2 -- colors/solarized-dark-termcolors.kak | 2 -- colors/solarized-dark.kak | 2 -- colors/solarized-light-termcolors.kak | 2 -- colors/solarized-light.kak | 2 -- colors/tomorrow-night.kak | 2 -- colors/zenburn.kak | 2 -- rc/filetype/org.kak | 12 ++++++++---- 16 files changed, 8 insertions(+), 34 deletions(-) diff --git a/colors/base16.kak b/colors/base16.kak index fd0d668b04..16cea18a67 100644 --- a/colors/base16.kak +++ b/colors/base16.kak @@ -38,8 +38,6 @@ evaluate-commands %sh{ face global header ${cyan_light} face global bold ${orange_light}+b face global italic ${orange_dark}+i - face global underline ${magenta_dark}+u - face global strikethrough ${cyan_light} face global mono ${green_dark} face global block ${orange_dark} face global link blue diff --git a/colors/default.kak b/colors/default.kak index 573217043a..ee87b58576 100644 --- a/colors/default.kak +++ b/colors/default.kak @@ -19,8 +19,6 @@ face global title blue face global header cyan face global bold red+b face global italic yellow+i -face global underline blue+u -face global strikethrough green face global mono green face global block magenta face global link cyan diff --git a/colors/desertex.kak b/colors/desertex.kak index a56fd2167f..8160bdf710 100644 --- a/colors/desertex.kak +++ b/colors/desertex.kak @@ -19,8 +19,6 @@ face global title blue face global header cyan face global bold red+b face global italic yellow+i -face global underline blue+u -face global strikethrough green face global mono green face global block magenta face global link cyan diff --git a/colors/github.kak b/colors/github.kak index f03496f06e..b662d5831f 100644 --- a/colors/github.kak +++ b/colors/github.kak @@ -22,8 +22,6 @@ face global title blue face global header cyan face global bold red+b face global italic yellow+i -face global underline blue+u -face global strikethrough green face global mono green face global block magenta face global link cyan diff --git a/colors/gruvbox.kak b/colors/gruvbox.kak index 2a07154fcf..9f5d25ebfe 100644 --- a/colors/gruvbox.kak +++ b/colors/gruvbox.kak @@ -42,8 +42,6 @@ evaluate-commands %sh{ face global header ${orange} face global bold ${fg}+b face global italic ${fg}+i - face global underline ${fg}+u - face global strikethrough ${fg} face global mono ${fg4} face global block ${aqua} face global link ${blue}+u diff --git a/colors/lucius.kak b/colors/lucius.kak index f51abf1264..d642e9bb21 100644 --- a/colors/lucius.kak +++ b/colors/lucius.kak @@ -42,8 +42,6 @@ evaluate-commands %sh{ face global header ${lucius_light_green} face global bold ${lucius_blue}+b face global italic ${lucius_light_grey}+i - face global underline ${lucius_green}+u - face global strikethrough ${lucius_dark_blue} face global mono ${lucius_light_green} face global block ${lucius_light_blue} face global link ${lucius_light_green} diff --git a/colors/palenight.kak b/colors/palenight.kak index a080aa8e09..1072140a05 100644 --- a/colors/palenight.kak +++ b/colors/palenight.kak @@ -45,8 +45,6 @@ evaluate-commands %sh{ face global header $cyan face global bold $red+b face global italic $yellow+i - face global underline $blue+u - face global strikethrough $green face global mono $green face global block $purple face global link $cyan diff --git a/colors/red-phoenix.kak b/colors/red-phoenix.kak index c974bbda9f..4a115f1f07 100644 --- a/colors/red-phoenix.kak +++ b/colors/red-phoenix.kak @@ -53,8 +53,6 @@ evaluate-commands %sh{ face global header ${orange1} face global bold ${orange2}+b face global italic ${orange3}+i - face global underline ${orange3}+u - face global strikethrough ${orange1} face global mono ${yellow1} face global block ${tan1} face global link ${blue} diff --git a/colors/reeder.kak b/colors/reeder.kak index 459c961b55..dc38c07e1a 100644 --- a/colors/reeder.kak +++ b/colors/reeder.kak @@ -40,8 +40,6 @@ evaluate-commands %sh{ face global header ${orange}+b face global bold default+b face global italic default+i - face global underline default+u - face global strikethrough default face global mono ${green_light} face global block ${green} face global link ${orange} diff --git a/colors/solarized-dark-termcolors.kak b/colors/solarized-dark-termcolors.kak index db491550ac..ffb891f449 100644 --- a/colors/solarized-dark-termcolors.kak +++ b/colors/solarized-dark-termcolors.kak @@ -20,8 +20,6 @@ face global title blue+b face global header blue face global bold bright-blue+b face global italic bright-blue+i -face global underline bright-blue+u -face global strikethrough bright-blue face global mono bright-cyan face global block cyan face global link bright-cyan diff --git a/colors/solarized-dark.kak b/colors/solarized-dark.kak index 6e685b16c5..cf1314f63d 100644 --- a/colors/solarized-dark.kak +++ b/colors/solarized-dark.kak @@ -38,8 +38,6 @@ evaluate-commands %sh{ face global header ${blue} face global bold ${base0}+b face global italic ${base0}+i - face global underline ${base0}+u - face global strikethrough ${base0} face global mono ${base1} face global block ${cyan} face global link ${base1} diff --git a/colors/solarized-light-termcolors.kak b/colors/solarized-light-termcolors.kak index 03dfa55036..07ded5a04f 100644 --- a/colors/solarized-light-termcolors.kak +++ b/colors/solarized-light-termcolors.kak @@ -20,8 +20,6 @@ face global title blue+b face global header blue face global bold bright-green+b face global italic bright-green+i -face global underline bright-green+u -face global strikethrough bright-green face global mono bright-cyan face global block cyan face global link bright-green diff --git a/colors/solarized-light.kak b/colors/solarized-light.kak index 899d0b3240..9402742a51 100644 --- a/colors/solarized-light.kak +++ b/colors/solarized-light.kak @@ -38,8 +38,6 @@ evaluate-commands %sh{ face global header ${blue} face global bold ${base01}+b face global italic ${base01}+i - face global underline ${base01}+u - face global strikethrough ${base01} face global mono ${base1} face global block ${cyan} face global link ${base01} diff --git a/colors/tomorrow-night.kak b/colors/tomorrow-night.kak index 1411c5777e..1d2ec0177f 100644 --- a/colors/tomorrow-night.kak +++ b/colors/tomorrow-night.kak @@ -43,8 +43,6 @@ evaluate-commands %sh{ face global header ${aqua} face global bold ${yellow}+b face global italic ${orange}+i - face global underline ${blue}+u - face global strikethrough ${red} face global mono ${green_dark} face global block ${orange} face global link blue diff --git a/colors/zenburn.kak b/colors/zenburn.kak index b6ddb970a7..3c6088ccd4 100644 --- a/colors/zenburn.kak +++ b/colors/zenburn.kak @@ -49,8 +49,6 @@ evaluate-commands %sh{ face global header ${zenconstant} face global bold ${zenstorageClass}+b face global italic ${zenfunction}+i - face global underline ${zenvariable}+u - face global strikethrough ${zenfunction} face global mono ${zennumber} face global block ${zenstatement} face global link ${zenstring} diff --git a/rc/filetype/org.kak b/rc/filetype/org.kak index 2f7bac4326..d574e2361a 100644 --- a/rc/filetype/org.kak +++ b/rc/filetype/org.kak @@ -35,6 +35,10 @@ set-face global org_heading default,default+b@header set-face global org_section default,default@function set-face global org_subsection default,default@variable set-face global org_subsubsection default,default@module +set-face global org_bold default,default+b +set-face global org_italic default,default+i +set-face global org_underline default,default+u +set-face global org_strikethrough default,default # Options # ‾‾‾‾‾‾‾ @@ -166,15 +170,15 @@ add-highlighter shared/org/inline/text/timestamp dynregex "[\[<]%opt{org_timesta ## BORDER: any non-whitespace, and not `,` `'` or `"` ## BODY: any character, can't be longer than tho lines ## POST: a whitespace character, `-`, `.`, `,`, `:`, `!`, `?`, `'`, `)`, `}` -add-highlighter shared/org/inline/text/italic regex "(^|[\h({'""])([/][^\h,'""][^\n]*?(\n[^\n]*?[^,'""\s])?[/])[\s.,:!?')}]" 2:italic -add-highlighter shared/org/inline/text/strikethrough regex "(^|[\h({'""])([+][^\h,'""][^\n]*?(\n[^\n]*?[^,'""\s])?[+])[\s.,:!?')}]" 2:strikethrough +add-highlighter shared/org/inline/text/italic regex "(^|[\h({'""])([/][^\h,'""][^\n]*?(\n[^\n]*?[^,'""\s])?[/])[\s.,:!?')}]" 2:org_italic +add-highlighter shared/org/inline/text/strikethrough regex "(^|[\h({'""])([+][^\h,'""][^\n]*?(\n[^\n]*?[^,'""\s])?[+])[\s.,:!?')}]" 2:org_strikethrough add-highlighter shared/org/inline/text/verbatim regex "(^|[\h({'""])([=][^\h,'""][^\n]*?(\n[^\n]*?[^,'""\s])?[=])[\s.,:!?')}]" 2:meta add-highlighter shared/org/inline/text/code regex "(^|[\h({'""])([~][^\h,'""][^\n]*?(\n[^\n]*?[^,'""\s])?[~])[\s.,:!?')}]" 2:mono -add-highlighter shared/org/inline/text/underlined regex "(^|[\h({'""])([_][^\h,'""][^\n]*?(\n[^\n]*?[^,'""\s])?[_])[\s.,:!?')}]" 2:underline +add-highlighter shared/org/inline/text/underlined regex "(^|[\h({'""])([_][^\h,'""][^\n]*?(\n[^\n]*?[^,'""\s])?[_])[\s.,:!?')}]" 2:org_underline ## will be deprecated in future releases of Org but currently is supported add-highlighter shared/org/inline/text/inline-math regex "(^|[\h({'""])([$][^\h,'""][^\n]*?(\n[^\n]*?[^,'""\s])?[$])[\s.,:!?')}]" 2:mono ## bold is kinda tricky because we need to HL everything but headings, so it's split up on several regexps -add-highlighter shared/org/inline/text/bold regex "(?:^|[\h({'""])([*][^\h,'""][^\n]*?(\n[^\n]*?[^,'""\s])?[*])[\s.,:!?')}]|([*]{3,})\n|\h([*]{3})[\s.,:!?')}]" 1:bold +add-highlighter shared/org/inline/text/bold regex "(?:^|[\h({'""])([*][^\h,'""][^\n]*?(\n[^\n]*?[^,'""\s])?[*])[\s.,:!?')}]|([*]{3,})\n|\h([*]{3})[\s.,:!?')}]" 1:org_bold # LaTeX add-highlighter shared/org/LaTeX region -match-capture '\\begin\{([A-Za-z0-9*]+)\}' '\\end\{([A-Za-z0-9*]+)\}' fill string From d60a6f85a539dc8961245ea446a9d1fb325e2059 Mon Sep 17 00:00:00 2001 From: Andrey Orst Date: Mon, 29 Apr 2019 15:17:56 +0300 Subject: [PATCH 49/56] remove modifications to themes completely --- colors/base16.kak | 4 ++-- colors/default.kak | 4 ++-- colors/desertex.kak | 4 ++-- colors/github.kak | 4 ++-- colors/gruvbox.kak | 4 ++-- colors/lucius.kak | 4 ++-- colors/palenight.kak | 4 ++-- colors/red-phoenix.kak | 4 ++-- colors/reeder.kak | 4 ++-- colors/tomorrow-night.kak | 4 ++-- colors/zenburn.kak | 4 ++-- 11 files changed, 22 insertions(+), 22 deletions(-) diff --git a/colors/base16.kak b/colors/base16.kak index 16cea18a67..677d35b75b 100644 --- a/colors/base16.kak +++ b/colors/base16.kak @@ -36,8 +36,8 @@ evaluate-commands %sh{ echo " face global title blue face global header ${cyan_light} - face global bold ${orange_light}+b - face global italic ${orange_dark}+i + face global bold ${orange_light} + face global italic ${orange_dark} face global mono ${green_dark} face global block ${orange_dark} face global link blue diff --git a/colors/default.kak b/colors/default.kak index ee87b58576..eb101049ee 100644 --- a/colors/default.kak +++ b/colors/default.kak @@ -17,8 +17,8 @@ face global builtin default+b # For markup face global title blue face global header cyan -face global bold red+b -face global italic yellow+i +face global bold red +face global italic yellow face global mono green face global block magenta face global link cyan diff --git a/colors/desertex.kak b/colors/desertex.kak index 8160bdf710..b6853d9159 100644 --- a/colors/desertex.kak +++ b/colors/desertex.kak @@ -17,8 +17,8 @@ face global meta rgb:ee799f # Markup face global title blue face global header cyan -face global bold red+b -face global italic yellow+i +face global bold red +face global italic yellow face global mono green face global block magenta face global link cyan diff --git a/colors/github.kak b/colors/github.kak index b662d5831f..f685553b3e 100644 --- a/colors/github.kak +++ b/colors/github.kak @@ -20,8 +20,8 @@ face global builtin default+b ## markup face global title blue face global header cyan -face global bold red+b -face global italic yellow+i +face global bold red +face global italic yellow face global mono green face global block magenta face global link cyan diff --git a/colors/gruvbox.kak b/colors/gruvbox.kak index 9f5d25ebfe..e3b19c7428 100644 --- a/colors/gruvbox.kak +++ b/colors/gruvbox.kak @@ -40,8 +40,8 @@ evaluate-commands %sh{ # Markdown highlighting face global title ${green}+b face global header ${orange} - face global bold ${fg}+b - face global italic ${fg}+i + face global bold ${fg} + face global italic ${fg} face global mono ${fg4} face global block ${aqua} face global link ${blue}+u diff --git a/colors/lucius.kak b/colors/lucius.kak index d642e9bb21..7deebbdb61 100644 --- a/colors/lucius.kak +++ b/colors/lucius.kak @@ -40,8 +40,8 @@ evaluate-commands %sh{ # and markup face global title ${lucius_light_blue} face global header ${lucius_light_green} - face global bold ${lucius_blue}+b - face global italic ${lucius_light_grey}+i + face global bold ${lucius_blue} + face global italic ${lucius_light_grey} face global mono ${lucius_light_green} face global block ${lucius_light_blue} face global link ${lucius_light_green} diff --git a/colors/palenight.kak b/colors/palenight.kak index 1072140a05..f231bca423 100644 --- a/colors/palenight.kak +++ b/colors/palenight.kak @@ -43,8 +43,8 @@ evaluate-commands %sh{ # Markup face global title $blue face global header $cyan - face global bold $red+b - face global italic $yellow+i + face global bold $red + face global italic $yellow face global mono $green face global block $purple face global link $cyan diff --git a/colors/red-phoenix.kak b/colors/red-phoenix.kak index 4a115f1f07..45fbfb8c13 100644 --- a/colors/red-phoenix.kak +++ b/colors/red-phoenix.kak @@ -51,8 +51,8 @@ evaluate-commands %sh{ echo " face global title ${blue} face global header ${orange1} - face global bold ${orange2}+b - face global italic ${orange3}+i + face global bold ${orange2} + face global italic ${orange3} face global mono ${yellow1} face global block ${tan1} face global link ${blue} diff --git a/colors/reeder.kak b/colors/reeder.kak index dc38c07e1a..7ddf96e419 100644 --- a/colors/reeder.kak +++ b/colors/reeder.kak @@ -38,8 +38,8 @@ evaluate-commands %sh{ # and markup face global title ${orange}+b face global header ${orange}+b - face global bold default+b - face global italic default+i + face global bold default + face global italic default face global mono ${green_light} face global block ${green} face global link ${orange} diff --git a/colors/tomorrow-night.kak b/colors/tomorrow-night.kak index 1d2ec0177f..b398020201 100644 --- a/colors/tomorrow-night.kak +++ b/colors/tomorrow-night.kak @@ -41,8 +41,8 @@ evaluate-commands %sh{ echo " face global title ${blue} face global header ${aqua} - face global bold ${yellow}+b - face global italic ${orange}+i + face global bold ${yellow} + face global italic ${orange} face global mono ${green_dark} face global block ${orange} face global link blue diff --git a/colors/zenburn.kak b/colors/zenburn.kak index 3c6088ccd4..a27c83201b 100644 --- a/colors/zenburn.kak +++ b/colors/zenburn.kak @@ -47,8 +47,8 @@ evaluate-commands %sh{ # and markup face global title ${zenkeyword} face global header ${zenconstant} - face global bold ${zenstorageClass}+b - face global italic ${zenfunction}+i + face global bold ${zenstorageClass} + face global italic ${zenfunction} face global mono ${zennumber} face global block ${zenstatement} face global link ${zenstring} From d9cbdf7d66ab0750e4c1ae3d78ba017f138ea435 Mon Sep 17 00:00:00 2001 From: Andrey Orst Date: Mon, 29 Apr 2019 15:22:18 +0300 Subject: [PATCH 50/56] remove modifications to themes completely --- colors/desertex.kak | 18 +++++++++--------- colors/gruvbox.kak | 18 +++++++++--------- colors/lucius.kak | 2 +- colors/palenight.kak | 18 +++++++++--------- colors/red-phoenix.kak | 6 +++--- colors/reeder.kak | 18 +++++++++--------- colors/tomorrow-night.kak | 2 +- 7 files changed, 41 insertions(+), 41 deletions(-) diff --git a/colors/desertex.kak b/colors/desertex.kak index b6853d9159..b30efbf67d 100644 --- a/colors/desertex.kak +++ b/colors/desertex.kak @@ -15,15 +15,15 @@ face global comment rgb:7ccd7c+i face global meta rgb:ee799f # Markup -face global title blue -face global header cyan -face global bold red -face global italic yellow -face global mono green -face global block magenta -face global link cyan -face global bullet cyan -face global list yellow +face global title blue +face global header cyan +face global bold red +face global italic yellow +face global mono green +face global block magenta +face global link cyan +face global bullet cyan +face global list yellow # Builtin # fg,bg+attributes diff --git a/colors/gruvbox.kak b/colors/gruvbox.kak index e3b19c7428..d2613e4624 100644 --- a/colors/gruvbox.kak +++ b/colors/gruvbox.kak @@ -38,15 +38,15 @@ evaluate-commands %sh{ face global builtin ${fg}+b # Markdown highlighting - face global title ${green}+b - face global header ${orange} - face global bold ${fg} - face global italic ${fg} - face global mono ${fg4} - face global block ${aqua} - face global link ${blue}+u - face global bullet ${yellow} - face global list ${fg} + face global title ${green}+b + face global header ${orange} + face global bold ${fg}+b + face global italic ${fg}+i + face global mono ${fg4} + face global block ${aqua} + face global link ${blue}+u + face global bullet ${yellow} + face global list ${fg} face global Default ${fg},${bg} face global PrimarySelection ${fg},${blue}+fg diff --git a/colors/lucius.kak b/colors/lucius.kak index 7deebbdb61..7bba885dfe 100644 --- a/colors/lucius.kak +++ b/colors/lucius.kak @@ -41,7 +41,7 @@ evaluate-commands %sh{ face global title ${lucius_light_blue} face global header ${lucius_light_green} face global bold ${lucius_blue} - face global italic ${lucius_light_grey} + face global italic ${lucius_green} face global mono ${lucius_light_green} face global block ${lucius_light_blue} face global link ${lucius_light_green} diff --git a/colors/palenight.kak b/colors/palenight.kak index f231bca423..a7fff18c88 100644 --- a/colors/palenight.kak +++ b/colors/palenight.kak @@ -41,15 +41,15 @@ evaluate-commands %sh{ face global meta $yellow # Markup - face global title $blue - face global header $cyan - face global bold $red - face global italic $yellow - face global mono $green - face global block $purple - face global link $cyan - face global bullet $cyan - face global list $yellow + face global title $blue + face global header $cyan + face global bold $red + face global italic $yellow + face global mono $green + face global block $purple + face global link $cyan + face global bullet $cyan + face global list $yellow # Builtin face global Default $white,$black diff --git a/colors/red-phoenix.kak b/colors/red-phoenix.kak index 45fbfb8c13..9573edfb4b 100644 --- a/colors/red-phoenix.kak +++ b/colors/red-phoenix.kak @@ -49,13 +49,13 @@ evaluate-commands %sh{ ## markup echo " - face global title ${blue} + face global title blue face global header ${orange1} face global bold ${orange2} face global italic ${orange3} face global mono ${yellow1} face global block ${tan1} - face global link ${blue} + face global link blue face global bullet ${gray1} face global list ${gray1} " @@ -71,7 +71,7 @@ evaluate-commands %sh{ face global SecondaryCursorEol black,${orange2}+fg face global LineNumbers ${text_light},${background} face global LineNumberCursor ${text},${gray1}+b - face global MenuForeground ${text_light},${blue} + face global MenuForeground ${text_light},blue face global MenuBackground ${orange1},${window} face global MenuInfo ${gray1} face global Information white,${window} diff --git a/colors/reeder.kak b/colors/reeder.kak index 7ddf96e419..a4fd06a6fe 100644 --- a/colors/reeder.kak +++ b/colors/reeder.kak @@ -36,15 +36,15 @@ evaluate-commands %sh{ face global builtin default+b # and markup - face global title ${orange}+b - face global header ${orange}+b - face global bold default - face global italic default - face global mono ${green_light} - face global block ${green} - face global link ${orange} - face global bullet ${brown_dark} - face global list ${black} + face global title ${orange}+b + face global header ${orange}+b + face global bold default+b + face global italic default+i + face global mono ${green_light} + face global block ${green} + face global link ${orange} + face global bullet ${brown_dark} + face global list ${black} # and built in faces face global Default ${black_light},${white} diff --git a/colors/tomorrow-night.kak b/colors/tomorrow-night.kak index b398020201..20a254801d 100644 --- a/colors/tomorrow-night.kak +++ b/colors/tomorrow-night.kak @@ -39,7 +39,7 @@ evaluate-commands %sh{ ## markup echo " - face global title ${blue} + face global title blue face global header ${aqua} face global bold ${yellow} face global italic ${orange} From 3de487475ff47abcccc956877afa27a0a076d164 Mon Sep 17 00:00:00 2001 From: Andrey Orst Date: Mon, 29 Apr 2019 15:34:57 +0300 Subject: [PATCH 51/56] add heading comments --- rc/filetype/org.kak | 1 + 1 file changed, 1 insertion(+) diff --git a/rc/filetype/org.kak b/rc/filetype/org.kak index d574e2361a..85b9bb90a2 100644 --- a/rc/filetype/org.kak +++ b/rc/filetype/org.kak @@ -131,6 +131,7 @@ add-highlighter shared/org/inline/text/heading regex '^(?:[*]{1}|[*]{ add-highlighter shared/org/inline/text/section regex '^(?:[*]{2}|[*]{6}|[*]{10})\h+[^\n]*?(:[^:\n]*?:)?\n' 0:org_section 1:module add-highlighter shared/org/inline/text/subsection regex '^(?:[*]{3}|[*]{7}|[*]{11})\h+[^\n]*?(:[^:\n]*?:)?\n' 0:org_subsection 1:module add-highlighter shared/org/inline/text/subsubsection regex '^(?:[*]{4}|[*]{8}|[*]{12,})\h+[^\n]*?(:[^:\n]*?:)?\n' 0:org_subsubsection 1:module +add-highlighter shared/org/inline/text/heading_comment regex '^[*]+\h+(COMMENT)\b' 1:comment add-highlighter shared/org/inline/text/heading_todo dynregex '^[*]+\h+(?:%opt{org_todo})' 1:org_todo 2:org_done add-highlighter shared/org/inline/text/heading_priority dynregex '^[*]+\h+[^\n\[]*(\[#(?:%opt{org_priority})\])' 1:org_priority # (?:(?:%opt{org_todo})\h+)?(\[#(?:%opt{org_priority})\])? From bae86c7ff6ac10a513891eaa9b5cea6a6e49428a Mon Sep 17 00:00:00 2001 From: Andrey Orst Date: Mon, 29 Apr 2019 15:36:17 +0300 Subject: [PATCH 52/56] use whitespace as Comment delimiter --- rc/filetype/org.kak | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rc/filetype/org.kak b/rc/filetype/org.kak index 85b9bb90a2..e0b0abbec4 100644 --- a/rc/filetype/org.kak +++ b/rc/filetype/org.kak @@ -131,7 +131,7 @@ add-highlighter shared/org/inline/text/heading regex '^(?:[*]{1}|[*]{ add-highlighter shared/org/inline/text/section regex '^(?:[*]{2}|[*]{6}|[*]{10})\h+[^\n]*?(:[^:\n]*?:)?\n' 0:org_section 1:module add-highlighter shared/org/inline/text/subsection regex '^(?:[*]{3}|[*]{7}|[*]{11})\h+[^\n]*?(:[^:\n]*?:)?\n' 0:org_subsection 1:module add-highlighter shared/org/inline/text/subsubsection regex '^(?:[*]{4}|[*]{8}|[*]{12,})\h+[^\n]*?(:[^:\n]*?:)?\n' 0:org_subsubsection 1:module -add-highlighter shared/org/inline/text/heading_comment regex '^[*]+\h+(COMMENT)\b' 1:comment +add-highlighter shared/org/inline/text/heading_comment regex '^[*]+\h+(COMMENT)\s' 1:comment add-highlighter shared/org/inline/text/heading_todo dynregex '^[*]+\h+(?:%opt{org_todo})' 1:org_todo 2:org_done add-highlighter shared/org/inline/text/heading_priority dynregex '^[*]+\h+[^\n\[]*(\[#(?:%opt{org_priority})\])' 1:org_priority # (?:(?:%opt{org_todo})\h+)?(\[#(?:%opt{org_priority})\])? From 6434ce9f5020583c5f0fc116771e68889f7e7f46 Mon Sep 17 00:00:00 2001 From: Andrey Orst Date: Mon, 29 Apr 2019 16:49:54 +0300 Subject: [PATCH 53/56] adjust comment face --- rc/filetype/org.kak | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rc/filetype/org.kak b/rc/filetype/org.kak index e0b0abbec4..f1b8db5cb5 100644 --- a/rc/filetype/org.kak +++ b/rc/filetype/org.kak @@ -131,7 +131,7 @@ add-highlighter shared/org/inline/text/heading regex '^(?:[*]{1}|[*]{ add-highlighter shared/org/inline/text/section regex '^(?:[*]{2}|[*]{6}|[*]{10})\h+[^\n]*?(:[^:\n]*?:)?\n' 0:org_section 1:module add-highlighter shared/org/inline/text/subsection regex '^(?:[*]{3}|[*]{7}|[*]{11})\h+[^\n]*?(:[^:\n]*?:)?\n' 0:org_subsection 1:module add-highlighter shared/org/inline/text/subsubsection regex '^(?:[*]{4}|[*]{8}|[*]{12,})\h+[^\n]*?(:[^:\n]*?:)?\n' 0:org_subsubsection 1:module -add-highlighter shared/org/inline/text/heading_comment regex '^[*]+\h+(COMMENT)\s' 1:comment +add-highlighter shared/org/inline/text/heading_comment regex '^[*]+\h+[^\n]*((?<=\h)COMMENT)\s' 1:comment add-highlighter shared/org/inline/text/heading_todo dynregex '^[*]+\h+(?:%opt{org_todo})' 1:org_todo 2:org_done add-highlighter shared/org/inline/text/heading_priority dynregex '^[*]+\h+[^\n\[]*(\[#(?:%opt{org_priority})\])' 1:org_priority # (?:(?:%opt{org_todo})\h+)?(\[#(?:%opt{org_priority})\])? From fa784ee6749dc0bf07c2223148937a06633bb3d4 Mon Sep 17 00:00:00 2001 From: Andrey Orst Date: Thu, 25 Jul 2019 11:55:45 +0300 Subject: [PATCH 54/56] support loading language modules like in #2924 --- rc/filetype/org.kak | 44 +++++++++++++++++++++++++++----------------- 1 file changed, 27 insertions(+), 17 deletions(-) diff --git a/rc/filetype/org.kak b/rc/filetype/org.kak index f1b8db5cb5..dacfefd943 100644 --- a/rc/filetype/org.kak +++ b/rc/filetype/org.kak @@ -23,7 +23,12 @@ hook -group org-highlight global WinSetOption filetype=org %{ hook -once -always window WinSetOption filetype=.* %{ remove-highlighter window/org } } -provide-module orgmode %& +hook -group org-load-languages global WinSetOption filetype=org %{ + hook -group org-load-languages window NormalIdle .* org-load-languages + hook -group org-load-languages window InsertIdle .* org-load-languages +} + +provide-module orgmode %§ # Faces # ‾‾‾‾‾ @@ -69,16 +74,14 @@ add-highlighter shared/org/inline default-region regions add-highlighter shared/org/inline/text default-region group evaluate-commands %sh{ - languages="arch-linux asciidoc c cabal clojure - cmake coffee cpp css cucumber d dart diff - dockerfile elixir elm emacs-lisp etc exherbo - fish gas git go haml haskell hbs html i3 ini - java javascript json julia justrc kickstart - latex lisp lua mail makefile markdown mercurial - moon nim objc ocaml org perl php pony protobuf - pug python ragel restructuredtext ruby rust sass - scala scheme scss sh sql swift systemd taskpaper - toml troff tupfile void-linux yaml" + languages="asciidoc c cabal clojure cmake coffee cpp css + cucumber d dart diff dockerfile elixir elm emacs-lisp + etc exherbo fish gas git go haml haskell hbs html i3 + ini java javascript json julia justrc kickstart latex + lisp lua makefile markdown mercurial moon nim objc + ocaml org perl php pony protobuf pug python ragel + restructuredtext ruby rust sass scala scheme scss sh + sql swift taskpaper toml troff tupfile yaml" for lang in ${languages}; do printf "%s\n" "add-highlighter shared/org/${lang} region '#\+(?i)BEGIN_SRC(?I)\h+${lang}\b' '(?i)#\+END_SRC' regions" @@ -164,13 +167,13 @@ regex org_timestamp "%opt{org_date}(\h+%opt{org_time}(-%opt{org_time})?(\h+%opt{ add-highlighter shared/org/inline/text/timestamp dynregex "[\[<]%opt{org_timestamp}([\]>]--[\[<]%opt{org_timestamp})?[\]>]" 0:variable # Markup -## FORMAT: PRE MARKER CONTENTS MARKER POST -## PRE: whitespace `(`, `{`, `'`, `"` or beginning of the line +## FORMAT: PRE MARKER `CONTENTS` MARKER POST +## PRE: whitespace, `(`, `{`, `'`, `"`, or beginning of the line ## MARKER: `/`, `+`, `=`, `~`, `_`, or `$` ## CONTENTS FORMAT: BORDER BODY BORDER -## BORDER: any non-whitespace, and not `,` `'` or `"` -## BODY: any character, can't be longer than tho lines -## POST: a whitespace character, `-`, `.`, `,`, `:`, `!`, `?`, `'`, `)`, `}` +### BORDER: any non-whitespace, and not `,`, `'`, or `"` +### BODY: any character, can't be longer than tho lines +### POST: a whitespace character, `-`, `.`, `,`, `:`, `!`, `?`, `'`, `)`, `}` add-highlighter shared/org/inline/text/italic regex "(^|[\h({'""])([/][^\h,'""][^\n]*?(\n[^\n]*?[^,'""\s])?[/])[\s.,:!?')}]" 2:org_italic add-highlighter shared/org/inline/text/strikethrough regex "(^|[\h({'""])([+][^\h,'""][^\n]*?(\n[^\n]*?[^,'""\s])?[+])[\s.,:!?')}]" 2:org_strikethrough add-highlighter shared/org/inline/text/verbatim regex "(^|[\h({'""])([=][^\h,'""][^\n]*?(\n[^\n]*?[^,'""\s])?[=])[\s.,:!?')}]" 2:meta @@ -249,4 +252,11 @@ org-parse-file %{ evaluate-commands -save-regs '"/' %{ } }} -& +define-command -hidden org-load-languages %{ + evaluate-commands -draft %{ try %{ + execute-keys 'gtGbGls#\+(?i)BEGIN_SRC\h+\K[^\s]+' + evaluate-commands -itersel %{ require-module %val{selection} } + }} +} + +§ From 097fbd18e0aee9884b61d2f5d728b3afe84af8a6 Mon Sep 17 00:00:00 2001 From: Andrey Orst Date: Tue, 6 Aug 2019 17:19:57 +0300 Subject: [PATCH 55/56] regex simplifications; latex ref --- rc/filetype/org.kak | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/rc/filetype/org.kak b/rc/filetype/org.kak index dacfefd943..71e6bbc492 100644 --- a/rc/filetype/org.kak +++ b/rc/filetype/org.kak @@ -137,7 +137,6 @@ add-highlighter shared/org/inline/text/subsubsection regex '^(?:[*]{4}|[*]{8} add-highlighter shared/org/inline/text/heading_comment regex '^[*]+\h+[^\n]*((?<=\h)COMMENT)\s' 1:comment add-highlighter shared/org/inline/text/heading_todo dynregex '^[*]+\h+(?:%opt{org_todo})' 1:org_todo 2:org_done add-highlighter shared/org/inline/text/heading_priority dynregex '^[*]+\h+[^\n\[]*(\[#(?:%opt{org_priority})\])' 1:org_priority -# (?:(?:%opt{org_todo})\h+)?(\[#(?:%opt{org_priority})\])? # Options add-highlighter shared/org/inline/text/option regex "(?i)#\+[a-z]\w*\b[^\n]*" 0:module add-highlighter shared/org/inline/text/title regex "(?i)#\+title:([^\n]+)" 0:module 1:title @@ -149,7 +148,7 @@ add-highlighter shared/org/inline/text/drawer regex "^\h*([:][^\s][^\n]*?[^\s] # Timestamps declare-option -docstring "Org date format: YYYY-MM-DD DAYNAME" \ -regex org_date '\d\d\d\d-\d\d-\d\d\h+[^\s-+>\]\d]+' +regex org_date '\d{4}-\d{2}-\d{2}\h+[^\s-+>\]\d]+' declare-option -docstring "Org time format H:MM" \ @@ -185,12 +184,13 @@ add-highlighter shared/org/inline/text/inline-math regex "(^|[\h({'""])([$][^ add-highlighter shared/org/inline/text/bold regex "(?:^|[\h({'""])([*][^\h,'""][^\n]*?(\n[^\n]*?[^,'""\s])?[*])[\s.,:!?')}]|([*]{3,})\n|\h([*]{3})[\s.,:!?')}]" 1:org_bold # LaTeX -add-highlighter shared/org/LaTeX region -match-capture '\\begin\{([A-Za-z0-9*]+)\}' '\\end\{([A-Za-z0-9*]+)\}' fill string +require-module latex +add-highlighter shared/org/LaTeX region -match-capture '\\begin\{([A-Za-z0-9*]+)\}' '\\end\{([A-Za-z0-9*]+)\}' ref latex ## LaTeX Math -add-highlighter shared/org/math1 region '[$]{2}' '[$]{2}' fill mono # will be deprecated in future releases of Org but currently is supported -add-highlighter shared/org/math2 region '\\\[' '\\\]' fill mono -add-highlighter shared/org/math3 region '\\\(' '\\\)' fill mono +add-highlighter shared/org/math1 region '\${2}' '\${2}' ref latex # will be deprecated in future releases of Org but currently is supported +add-highlighter shared/org/math2 region '\\\[' '\\\]' ref latex +add-highlighter shared/org/math3 region '\\\(' '\\\)' ref latex # Export snippets add-highlighter shared/org/inline/text/export regex "@@[a-zA-Z-]+:.*?@@" 0:mono @@ -231,7 +231,7 @@ org-parse-file %{ evaluate-commands -save-regs '"/' %{ # This Perl code transforms these two lines to similar formats: # `word1 word2 word3 word4' to `(word1|word2|word3)|(word4)', # and `word1 word2 | word3 word4' to `(word1|word2)|(word3|word4)'. - # This regex is later used in to highlight todo items in headings. + # This regex is later used to highlight todo items in headings. set-option buffer org_todo %sh{ printf "%s\n" "${kak_opt_org_todo}" | perl -pe 'if (/^.*\|.*$/) { $_ =~ s/(.*)\|(.*)/($1)|($2)/; $_ =~ s/\(\s+/(/g; From 45ef1ddf32c11e7adedc5e51b75a696b2f26803f Mon Sep 17 00:00:00 2001 From: Andrey Orst Date: Sat, 4 Apr 2020 20:31:12 +0300 Subject: [PATCH 56/56] simplify priorities parsing --- rc/filetype/org.kak | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/rc/filetype/org.kak b/rc/filetype/org.kak index 71e6bbc492..24cdecf64e 100644 --- a/rc/filetype/org.kak +++ b/rc/filetype/org.kak @@ -245,11 +245,10 @@ org-parse-file %{ evaluate-commands -save-regs '"/' %{ }' } } # Parse priority items - try %{ - # this `execute-keys' selects first three letters in `#+PRIORITIES' line - execute-keys -draft '/(?i)^\h*#\+PRIORITIES:[^\n]+f:ls\h*\w(\s+)?(\w)?(\s+)?(\w)?\sy: set-option buffer org_priority %reg{dquote}' - set-option buffer org_priority %sh{ printf "%s\n" "${kak_opt_org_priority}" | sed -E "s/ /|/g" } - } + try %{ evaluate-commands -save-regs 'p' %{ + execute-keys -draft /(?i)^\h*#\+PRIORITIES:[^\n]+f:ll"py + set-option buffer org_priority %sh{ printf "%s\n" "${kak_reg_p}" | sed -E "s/\s+$//;s/\s+/|/g" } + }} }} define-command -hidden org-load-languages %{