diff --git a/rc/base/clojure.kak b/rc/base/clojure.kak index af584516..6413285d 100644 --- a/rc/base/clojure.kak +++ b/rc/base/clojure.kak @@ -31,16 +31,16 @@ def -hidden _clojure_indent_on_new_line _lisp_indent_on_new_line # Initialization # ‾‾‾‾‾‾‾‾‾‾‾‾‾‾ +hook -group clojure-highlight global WinSetOption filetype=clojure %{ addhl ref clojure } hook global WinSetOption filetype=clojure %[ - addhl ref clojure - hook window InsertEnd .* -group clojure-hooks _clojure_filter_around_selections hook window InsertChar \n -group clojure-indent _clojure_indent_on_new_line ] +hook -group clojure-highlight WinSetOption filetype=(?!clojure).* %{ rmhl clojure } + hook global WinSetOption filetype=(?!clojure).* %{ - rmhl clojure rmhooks window clojure-indent rmhooks window clojure-hooks } diff --git a/rc/base/css.kak b/rc/base/css.kak index a8af297b..8ebc6a8a 100644 --- a/rc/base/css.kak +++ b/rc/base/css.kak @@ -66,9 +66,9 @@ def -hidden _css_indent_on_closing_curly_brace %[ # Initialization # ‾‾‾‾‾‾‾‾‾‾‾‾‾‾ -hook global WinSetOption filetype=css %[ - addhl ref css +hook -group css-highlight global WinSetOption filetype=css %{ addhl ref css } +hook global WinSetOption filetype=css %[ hook window InsertEnd .* -group css-hooks _css_filter_around_selections hook window InsertChar \n -group css-indent _css_indent_on_new_line hook window InsertChar \} -group css-indent _css_indent_on_closing_curly_brace @@ -76,8 +76,9 @@ hook global WinSetOption filetype=css %[ set comment_line_chars "" ] +hook -group css-highlight global WinSetOption filetype=(?!css).* %{ rmhl css } + hook global WinSetOption filetype=(?!css).* %{ - rmhl css rmhooks window css-indent rmhooks window css-hooks } diff --git a/rc/base/dlang.kak b/rc/base/dlang.kak index b8de00c4..31143876 100644 --- a/rc/base/dlang.kak +++ b/rc/base/dlang.kak @@ -102,9 +102,9 @@ def -hidden _dlang-indent-on-closing-curly-brace %[ # Initialization # ‾‾‾‾‾‾‾‾‾‾‾‾‾‾ -hook global WinSetOption filetype=dlang %{ - addhl ref dlang +hook -group dlang-highlight global WinSetOption filetype=dlang %{ addhl ref dlang } +hook global WinSetOption filetype=dlang %{ # cleanup trailing whitespaces when exiting insert mode hook window InsertEnd .* -group dlang-hooks %{ try %{ exec -draft s^\h+$d } } hook window InsertChar \n -group dlang-indent _dlang-indent-on-new-line @@ -115,9 +115,9 @@ hook global WinSetOption filetype=dlang %{ set window comment_selection_chars "/+:+/" } -hook global WinSetOption filetype=(?!dlang).* %{ - rmhl dlang +hool -group dlang-highlight global WinSetOption filetype=(?!dlang).* %{ rmhl dlang } +hook global WinSetOption filetype=(?!dlang).* %{ rmhooks window dlang-hooks rmhooks window dlang-indent } diff --git a/rc/base/etc.kak b/rc/base/etc.kak index f27b94b2..bcb26d2d 100644 --- a/rc/base/etc.kak +++ b/rc/base/etc.kak @@ -17,50 +17,50 @@ addhl -group / group etc-resolv-conf addhl -group /etc-resolv-conf regex ^#.*?$ 0:comment addhl -group /etc-resolv-conf regex ^(nameserver|server|domain|sortlist|options)[\s\t]+(.*?)$ 1:type 2:attribute -hook global WinSetOption filetype=etc-resolv-conf %{ addhl ref etc-resolv-conf } -hook global WinSetOption filetype=(?!etc-resolv-conf).* %{ rmhl etc-resolv-conf } +hook -group etc-resolv-conf-highlight global WinSetOption filetype=etc-resolv-conf %{ addhl ref etc-resolv-conf } +hook -group etc-resolv-conf-highlight global WinSetOption filetype=(?!etc-resolv-conf).* %{ rmhl etc-resolv-conf } ## /etc/hosts addhl -group / group etc-hosts addhl -group /etc-hosts regex ^(.+?)[\s\t]+?(.*?)$ 1:type 2:attribute addhl -group /etc-hosts regex \#.*?$ 0:comment -hook global WinSetOption filetype=etc-hosts %{ addhl ref etc-hosts } -hook global WinSetOption filetype=(?!etc-hosts).* %{ rmhl etc-hosts } +hook -group etc-hosts-highlight global WinSetOption filetype=etc-hosts %{ addhl ref etc-hosts } +hook -group etc-hosts-highlight global WinSetOption filetype=(?!etc-hosts).* %{ rmhl etc-hosts } ## /etc/fstab addhl -group / group etc-fstab addhl -group /etc-fstab regex ^(\S{1,})\s+?(\S{1,})\s+?(\S{1,})\s+?(\S{1,})\s+?(\S{1,})\s+?(\S{1,})(?:\s+)?$ 1:keyword 2:value 3:type 4:string 5:attribute 6:attribute addhl -group /etc-fstab regex \#.*?$ 0:comment -hook global WinSetOption filetype=etc-fstab %{ addhl ref etc-fstab } -hook global WinSetOption filetype=(?!etc-fstab).* %{ rmhl etc-fstab } +hook -group etc-fstab-highlight global WinSetOption filetype=etc-fstab %{ addhl ref etc-fstab } +hook -group etc-fstab-highlight global WinSetOption filetype=(?!etc-fstab).* %{ rmhl etc-fstab } ## /etc/group addhl -group / group etc-group addhl -group /etc-group regex ^(\S+?):(\S+?)?:(\S+?)?:(\S+?)?$ 1:keyword 2:type 3:value 4:string -hook global WinSetOption filetype=etc-group %{ addhl ref etc-group } -hook global WinSetOption filetype=(?!etc-group).* %{ rmhl etc-group } +hook -group etc-group-highlight global WinSetOption filetype=etc-group %{ addhl ref etc-group } +hook -group etc-group-highlight global WinSetOption filetype=(?!etc-group).* %{ rmhl etc-group } ## /etc/gshadow addhl -group / group etc-gshadow addhl -group /etc-gshadow regex ^(\S+?):(\S+?)?:(\S+?)?:(\S+?)?$ 1:keyword 2:type 3:value 4:string -hook global WinSetOption filetype=etc-gshadow %{ addhl ref etc-gshadow } -hook global WinSetOption filetype=(?!etc-gshadow).* %{ rmhl etc-gshadow } +hook -group etc-gshadow-highlight global WinSetOption filetype=etc-gshadow %{ addhl ref etc-gshadow } +hook -group etc-gshadow-highlight global WinSetOption filetype=(?!etc-gshadow).* %{ rmhl etc-gshadow } ## /etc/shadow addhl -group / group etc-shadow addhl -group /etc-shadow regex ^(\S+?):(\S+?):([0-9]+?):([0-9]+?)?:([0-9]+?)?:([0-9]+?)?:([0-9]+?)?:([0-9]+?)?:(.*?)?$ 1:keyword 2:type 3:value 4:value 5:value 6:value 7:value 8:value -hook global WinSetOption filetype=etc-shadow %{ addhl ref etc-shadow } -hook global WinSetOption filetype=(?!etc-shadow).* %{ rmhl etc-shadow } +hook -group etc-shadow-highlight global WinSetOption filetype=etc-shadow %{ addhl ref etc-shadow } +hook -group etc-shadow-highlight global WinSetOption filetype=(?!etc-shadow).* %{ rmhl etc-shadow } ## /etc/passwd addhl -group / group etc-passwd addhl -group /etc-passwd regex ^(\S+?):(\S+?):([0-9]+?):([0-9]+?):(.*?)?:(.+?):(.+?)$ 1:keyword 2:type 3:value 4:value 5:string 6:attribute 7:attribute -hook global WinSetOption filetype=etc-passwd %{ addhl ref etc-passwd } -hook global WinSetOption filetype=(?!etc-passwd).* %{ rmhl etc-passwd } +hook -group etc-passwd-highlight global WinSetOption filetype=etc-passwd %{ addhl ref etc-passwd } +hook -group etc-passwd-highlight global WinSetOption filetype=(?!etc-passwd).* %{ rmhl etc-passwd } diff --git a/rc/base/fish.kak b/rc/base/fish.kak index 08211278..e5e7b050 100644 --- a/rc/base/fish.kak +++ b/rc/base/fish.kak @@ -63,16 +63,17 @@ def -hidden _fish_indent_on_new_line %{ # Initialization # ‾‾‾‾‾‾‾‾‾‾‾‾‾‾ -hook global WinSetOption filetype=fish %{ - addhl ref fish +hook -group fish-highlight global WinSetOption filetype=fish %{ addhl ref fish } +hook global WinSetOption filetype=fish %{ hook window InsertEnd .* -group fish-hooks _fish_filter_around_selections hook window InsertChar .* -group fish-indent _fish_indent_on_char hook window InsertChar \n -group fish-indent _fish_indent_on_new_line } +hool -group fish-highlight global WinSetOption filetype=(?!fish).* %{ rmhl fish } + hook global WinSetOption filetype=(?!fish).* %{ - rmhl fish rmhooks window fish-indent rmhooks window fish-hooks } diff --git a/rc/base/gas.kak b/rc/base/gas.kak index 822eec8f..c2254126 100644 --- a/rc/base/gas.kak +++ b/rc/base/gas.kak @@ -85,14 +85,14 @@ def -hidden _gas_indent_on_new_line %~ > ~ -hook global WinSetOption filetype=gas %{ - addhl ref gas +hook -group gas-highlight global WinSetOption filetype=gas %{ addhl ref gas } +hook global WinSetOption filetype=gas %{ hook window InsertChar \n -group gas-indent _gas_indent_on_new_line } -hook global WinSetOption filetype=(?!gas).* %{ - rmhl gas +hool -group gas-highlight global WinSetOption filetype=(?!gas).* %{ rmhl gas } +hook global WinSetOption filetype=(?!gas).* %{ rmhooks window gas-indent } diff --git a/rc/base/git.kak b/rc/base/git.kak index 765a2041..947589df 100644 --- a/rc/base/git.kak +++ b/rc/base/git.kak @@ -2,7 +2,7 @@ hook global BufCreate .*COMMIT_EDITMSG %{ set buffer filetype git-commit } -hook global WinSetOption filetype=git-commit %{ +hook -group git-commit-highlight global WinSetOption filetype=git-commit %{ addhl group git-commit-highlight addhl -group git-commit-highlight regex "\`[^\n]{1,50}" 0:yellow addhl -group git-commit-highlight regex "\`[^\n]*\n\h*(?!#)([^\n]*)\n?" 1:default,red @@ -11,20 +11,16 @@ hook global WinSetOption filetype=git-commit %{ addhl -group git-commit-highlight ref diff # highlight potential diffs from the -v option } -hook global WinSetOption filetype=(?!git-commit).* %{ - rmhl git-commit-highlight -} +hook -group git-commit-highlight global WinSetOption filetype=(?!git-commit).* %{ rmhl git-commit-highlight } hook global BufCreate .*git-rebase-todo %{ set buffer filetype git-rebase } -hook global WinSetOption filetype=git-rebase %{ +hook -group git-rebase-highlight global WinSetOption filetype=git-rebase %{ addhl group git-rebase-highlight addhl -group git-rebase-highlight regex "#[^\n]*\n" 0:cyan,default addhl -group git-rebase-highlight regex "^(pick|edit|reword|squash|fixup|exec|[persfx]) (\w+)" 1:green 2:magenta } -hook global WinSetOption filetype=(?!git-rebase).* %{ - rmhl git-rebase-highlight -} +hook -group git-rebase-highlight global WinSetOption filetype=(?!git-rebase).* %{ rmhl git-rebase-highlight } diff --git a/rc/base/golang.kak b/rc/base/golang.kak index 37d6c95d..9d7ff315 100644 --- a/rc/base/golang.kak +++ b/rc/base/golang.kak @@ -96,9 +96,9 @@ hook global WinSetOption filetype=golang %{ set window formatcmd "gofmt" } -hook global WinSetOption filetype=(?!golang).* %{ - rmhl golang +hool -group golang-highlight global WinSetOption filetype=(?!golang).* %{ rmhl golang } +hook global WinSetOption filetype=(?!golang).* %{ rmhooks window golang-hooks rmhooks window golang-indent } diff --git a/rc/base/haskell.kak b/rc/base/haskell.kak index 90f35685..d8ee7f71 100644 --- a/rc/base/haskell.kak +++ b/rc/base/haskell.kak @@ -58,15 +58,16 @@ def -hidden _haskell_indent_on_new_line %{ # Initialization # ‾‾‾‾‾‾‾‾‾‾‾‾‾‾ -hook global WinSetOption filetype=haskell %{ - addhl ref haskell +hook -group haskell-highlight global WinSetOption filetype=haskell %{ addhl ref haskell } +hook global WinSetOption filetype=haskell %{ hook window InsertEnd .* -group haskell-hooks _haskell_filter_around_selections hook window InsertChar \n -group haskell-indent _haskell_indent_on_new_line } +hool -group haskell-highlight global WinSetOption filetype=(?!haskell).* %{ rmhl haskell } + hook global WinSetOption filetype=(?!haskell).* %{ - rmhl haskell rmhooks window haskell-indent rmhooks window haskell-hooks } diff --git a/rc/base/html.kak b/rc/base/html.kak index 8a7eb9e0..643c9351 100644 --- a/rc/base/html.kak +++ b/rc/base/html.kak @@ -63,9 +63,9 @@ def -hidden _html_indent_on_new_line %{ # Initialization # ‾‾‾‾‾‾‾‾‾‾‾‾‾‾ -hook global WinSetOption filetype=html %{ - addhl ref html +hook -group html-highlight global WinSetOption filetype=html %{ addhl ref html } +hook global WinSetOption filetype=html %{ hook window InsertEnd .* -group html-hooks _html_filter_around_selections hook window InsertChar .* -group html-indent _html_indent_on_char hook window InsertChar \n -group html-indent _html_indent_on_new_line @@ -73,8 +73,9 @@ hook global WinSetOption filetype=html %{ set window comment_selection_chars '' } +hool -group html-highlight global WinSetOption filetype=(?!html).* %{ rmhl html } + hook global WinSetOption filetype=(?!html).* %{ - rmhl html rmhooks window html-indent rmhooks window html-hooks } diff --git a/rc/base/ini.kak b/rc/base/ini.kak index 2267d622..85f4029e 100644 --- a/rc/base/ini.kak +++ b/rc/base/ini.kak @@ -10,10 +10,5 @@ addhl -group /ini/code regex "^\h*([^\[][^=\n]*=)([^\n]*)" 1:identifier 2:value addhl -group /ini/comment fill comment -hook global WinSetOption filetype=ini %{ - addhl ref ini -} - -hook global WinSetOption filetype=(?!ini).* %{ - rmhl ini -} +hook -group ini-highlight global WinSetOption filetype=ini %{ addhl ref ini } +hook -group ini-highlight global WinSetOption filetype=(?!ini).* %{ rmhl ini } diff --git a/rc/base/java.kak b/rc/base/java.kak index ca9d3f01..606f0318 100644 --- a/rc/base/java.kak +++ b/rc/base/java.kak @@ -19,10 +19,5 @@ addhl -group /java/code regex "\b(void|int|char|unsigned|float|boolean|double)\b addhl -group /java/code regex "\b(while|for|if|else|do|static|switch|case|default|class|interface|goto|break|continue|return|import|try|catch|throw|new|package|extends|implements)\b" 0:keyword addhl -group /java/code regex "\b(final|public|protected|private|abstract)\b" 0:attribute -hook global WinSetOption filetype=java %{ - addhl ref java -} - -hook global WinSetOption filetype=(?!java).* %{ - rmhl java -} +hook -group java-highlight global WinSetOption filetype=java %{ addhl ref java } +hook -group java-highlight global WinSetOption filetype=(?!java).* %{ rmhl java } diff --git a/rc/base/javascript.kak b/rc/base/javascript.kak index 2b6053cc..2526d16f 100644 --- a/rc/base/javascript.kak +++ b/rc/base/javascript.kak @@ -66,16 +66,17 @@ def -hidden _javascript_indent_on_new_line %< # Initialization # ‾‾‾‾‾‾‾‾‾‾‾‾‾‾ -hook global WinSetOption filetype=javascript %{ - addhl ref javascript +hook -group javascript-highlight global WinSetOption filetype=javascript %{ addhl ref javascript } +hook global WinSetOption filetype=javascript %{ hook window InsertEnd .* -group javascript-hooks _javascript_filter_around_selections hook window InsertChar .* -group javascript-indent _javascript_indent_on_char hook window InsertChar \n -group javascript-indent _javascript_indent_on_new_line } +hool -group javascript-highlight global WinSetOption filetype=(?!javascript).* %{ rmhl javascript } + hook global WinSetOption filetype=(?!javascript).* %{ - rmhl javascript rmhooks window javascript-indent rmhooks window javascript-hooks } diff --git a/rc/base/json.kak b/rc/base/json.kak index edbc8dbf..4b24d99d 100644 --- a/rc/base/json.kak +++ b/rc/base/json.kak @@ -51,16 +51,17 @@ def -hidden _json_indent_on_new_line %< # Initialization # ‾‾‾‾‾‾‾‾‾‾‾‾‾‾ -hook global WinSetOption filetype=json %{ - addhl ref json +hook -group json-highlight global WinSetOption filetype=json %{ addhl ref json } +hook global WinSetOption filetype=json %{ hook window InsertEnd .* -group json-hooks _json_filter_around_selections hook window InsertChar .* -group json-indent _json_indent_on_char hook window InsertChar \n -group json-indent _json_indent_on_new_line } +hool -group json-highlight global WinSetOption filetype=(?!json).* %{ rmhl json } + hook global WinSetOption filetype=(?!json).* %{ - rmhl json rmhooks window json-indent rmhooks window json-hooks } diff --git a/rc/base/julia.kak b/rc/base/julia.kak index db7c1d2d..74a4caf1 100644 --- a/rc/base/julia.kak +++ b/rc/base/julia.kak @@ -26,5 +26,5 @@ addhl -group /julia/code regex \b(Number|Real|BigInt|Integer|UInt|UInt8|UInt16|U # Initialization # ‾‾‾‾‾‾‾‾‾‾‾‾‾‾ -hook global WinSetOption filetype=julia %{ addhl ref julia } -hook global WinSetOption filetype=(?!julia).* %{ rmhl julia } +hook -group julia-highlight global WinSetOption filetype=julia %{ addhl ref julia } +hook -group julia-highlight global WinSetOption filetype=(?!julia).* %{ rmhl julia } diff --git a/rc/base/lisp.kak b/rc/base/lisp.kak index e2405c6d..e6c63b70 100644 --- a/rc/base/lisp.kak +++ b/rc/base/lisp.kak @@ -47,15 +47,16 @@ def -hidden _lisp_indent_on_new_line %{ # Initialization # ‾‾‾‾‾‾‾‾‾‾‾‾‾‾ -hook global WinSetOption filetype=lisp %{ - addhl ref lisp +hook -group lisp-highlight global WinSetOption filetype=lisp %{ addhl ref lisp } +hook global WinSetOption filetype=lisp %{ hook window InsertEnd .* -group lisp-hooks _lisp_filter_around_selections hook window InsertChar \n -group lisp-indent _lisp_indent_on_new_line } +hool -group lisp-highlight global WinSetOption filetype=(?!lisp).* %{ rmhl lisp } + hook global WinSetOption filetype=(?!lisp).* %{ - rmhl lisp rmhooks window lisp-indent rmhooks window lisp-hooks } diff --git a/rc/base/lua.kak b/rc/base/lua.kak index c72ca832..36a59c26 100644 --- a/rc/base/lua.kak +++ b/rc/base/lua.kak @@ -95,9 +95,9 @@ def -hidden _lua_indent_on_new_line %{ # Initialization # ‾‾‾‾‾‾‾‾‾‾‾‾‾‾ -hook global WinSetOption filetype=lua %{ - addhl ref lua +hook -group lua-highlight global WinSetOption filetype=lua %{ addhl ref lua } +hook global WinSetOption filetype=lua %{ hook window InsertEnd .* -group lua-hooks _lua_filter_around_selections hook window InsertChar .* -group lua-indent _lua_indent_on_char hook window InsertChar \n -group lua-indent _lua_indent_on_new_line @@ -108,8 +108,9 @@ hook global WinSetOption filetype=lua %{ set window comment_selection_chars '\Q--[[:]]' } +hool -group lua-highlight global WinSetOption filetype=(?!lua).* %{ rmhl lua } + hook global WinSetOption filetype=(?!lua).* %{ - rmhl lua rmhooks window lua-indent rmhooks window lua-hooks diff --git a/rc/base/mail.kak b/rc/base/mail.kak index 6316c4cb..b5d99f8c 100644 --- a/rc/base/mail.kak +++ b/rc/base/mail.kak @@ -5,5 +5,5 @@ addhl -group /mail regex ^(From|To|Cc|Bcc|Subject|Reply-To|In-Reply-To):([^\n]*( addhl -group /mail regex <[^@>]+@.*?> 0:string addhl -group /mail regex ^>.*?$ 0:comment -hook global WinSetOption filetype=mail %{ addhl ref mail } -hook global WinSetOption filetype=(?!mail).* %{ rmhl mail } +hook -group mail-highlight global WinSetOption filetype=mail %{ addhl ref mail } +hook -group mail-highlight global WinSetOption filetype=(?!mail).* %{ rmhl mail } diff --git a/rc/base/markdown.kak b/rc/base/markdown.kak index c1f06237..7aae5359 100644 --- a/rc/base/markdown.kak +++ b/rc/base/markdown.kak @@ -140,12 +140,14 @@ def -hidden _markdown_indent_on_new_line %{ # Initialization # ‾‾‾‾‾‾‾‾‾‾‾‾‾‾ +hook -group markdown-highlight global WinSetOption filetype=markdown %{ addhl ref markdown } + hook global WinSetOption filetype=markdown %{ - addhl ref markdown hook window InsertChar \n -group markdown-indent _markdown_indent_on_new_line } +hool -group markdown-highlight global WinSetOption filetype=(?!markdown).* %{ rmhl markdown } + hook global WinSetOption filetype=(?!markdown).* %{ - rmhl markdown rmhooks window markdown-indent } diff --git a/rc/base/perl.kak b/rc/base/perl.kak index 8ca8b624..6230dcea 100644 --- a/rc/base/perl.kak +++ b/rc/base/perl.kak @@ -109,9 +109,9 @@ def -hidden _perl-indent-on-closing-curly-brace %[ # Initialization # ‾‾‾‾‾‾‾‾‾‾‾‾‾‾ -hook global WinSetOption filetype=perl %{ - addhl ref perl +hook -group perl-highlight global WinSetOption filetype=perl %{ addhl ref perl } +hook global WinSetOption filetype=perl %{ # cleanup trailing whitespaces when exiting insert mode hook window InsertEnd .* -group perl-hooks %{ try %{ exec -draft s^\h+$d } } hook window InsertChar \n -group perl-indent _perl-indent-on-new-line @@ -123,9 +123,9 @@ hook global WinSetOption filetype=perl %{ set window comment_line_chars "#" } -hook global WinSetOption filetype=(?!perl).* %{ - rmhl perl +hool -group perl-highlight global WinSetOption filetype=(?!perl).* %{ rmhl perl } +hook global WinSetOption filetype=(?!perl).* %{ rmhooks window perl-hooks rmhooks window perl-indent } diff --git a/rc/base/ruby.kak b/rc/base/ruby.kak index c137cf94..0568ffa4 100644 --- a/rc/base/ruby.kak +++ b/rc/base/ruby.kak @@ -150,9 +150,9 @@ def -hidden _ruby_insert_on_new_line %{ # Initialization # ‾‾‾‾‾‾‾‾‾‾‾‾‾‾ -hook global WinSetOption filetype=ruby %{ - addhl ref ruby +hook -group ruby-highlight global WinSetOption filetype=ruby %{ addhl ref ruby } +hook global WinSetOption filetype=ruby %{ hook window InsertChar .* -group ruby-indent _ruby_indent_on_char hook window InsertChar \n -group ruby-indent _ruby_indent_on_new_line hook window InsertChar \n -group ruby-insert _ruby_insert_on_new_line @@ -168,8 +168,9 @@ hook global WinSetOption filetype=ruby %{ set window formatcmd 'rubocop --auto-correct --stdin - -o /dev/null | sed 1d' } +hool -group ruby-highlight global WinSetOption filetype=(?!ruby).* %{ rmhl ruby } + hook global WinSetOption filetype=(?!ruby).* %{ - rmhl ruby rmhooks window ruby-indent rmhooks window ruby-insert diff --git a/rc/base/rust.kak b/rc/base/rust.kak index 7321fbba..c7561d99 100644 --- a/rc/base/rust.kak +++ b/rc/base/rust.kak @@ -76,17 +76,18 @@ def -hidden _rust_indent_on_closing_curly_brace %[ # Initialization # ‾‾‾‾‾‾‾‾‾‾‾‾‾‾ -hook global WinSetOption filetype=rust %[ - addhl ref rust +hook -group rust-highlight global WinSetOption filetype=rust %{ addhl ref rust } +hook global WinSetOption filetype=rust %[ hook window InsertEnd .* -group rust-hooks _rust_filter_around_selections hook window InsertChar \n -group rust-indent _rust_indent_on_new_line hook window InsertChar \{ -group rust-indent _rust_indent_on_opening_curly_brace hook window InsertChar \} -group rust-indent _rust_indent_on_closing_curly_brace ] +hool -group rust-highlight global WinSetOption filetype=(?!rust).* %{ rmhl rust } + hook global WinSetOption filetype=(?!rust).* %{ - rmhl rust rmhooks window rust-indent rmhooks window rust-hooks } diff --git a/rc/base/scala.kak b/rc/base/scala.kak index 2f3a4088..24f192e1 100644 --- a/rc/base/scala.kak +++ b/rc/base/scala.kak @@ -66,16 +66,17 @@ def -hidden _scala_indent_on_closing_curly_brace %[ # Initialization # ‾‾‾‾‾‾‾‾‾‾‾‾‾‾ -hook global WinSetOption filetype=scala %[ - addhl ref scala +hook -group scala-highlight global WinSetOption filetype=scala %{ addhl ref scala } +hook global WinSetOption filetype=scala %[ hook window InsertEnd .* -group scala-hooks _scala_filter_around_selections hook window InsertChar \n -group scala-indent _scala_indent_on_new_line hook window InsertChar \} -group scala-indent _scala_indent_on_closing_curly_brace ] +hool -group scala-highlight global WinSetOption filetype=(?!scala).* %{ rmhl scala } + hook global WinSetOption filetype=(?!scala).* %{ - rmhl scala rmhooks window scala-indent rmhooks window scala-hooks } diff --git a/rc/base/swift.kak b/rc/base/swift.kak index 37fe584a..f12612a1 100644 --- a/rc/base/swift.kak +++ b/rc/base/swift.kak @@ -23,10 +23,5 @@ addhl -group /swift/code regex "\<(Bool|String|UInt|UInt16|UInt32|UInt64|UInt8)\ addhl -group /swift/code regex "\<(IBAction|IBOutlet)\>" 0:attribute addhl -group /swift/code regex "@\w+\>" 0:attribute -hook global WinSetOption filetype=swift %{ - addhl ref swift -} - -hook global WinSetOption filetype=(?!swift).* %{ - rmhl swift -} +hook -group swift-highlight global WinSetOption filetype=swift %{ addhl ref swift } +hook -group swift-highlight global WinSetOption filetype=(?!swift).* %{ rmhl swift } diff --git a/rc/base/yaml.kak b/rc/base/yaml.kak index bfa3b6b7..413e5bcf 100644 --- a/rc/base/yaml.kak +++ b/rc/base/yaml.kak @@ -52,15 +52,16 @@ def -hidden _yaml_indent_on_new_line %{ # Initialization # ‾‾‾‾‾‾‾‾‾‾‾‾‾‾ -hook global WinSetOption filetype=yaml %{ - addhl ref yaml +hook -group yaml-highlight global WinSetOption filetype=yaml %{ addhl ref yaml } +hook global WinSetOption filetype=yaml %{ hook window InsertEnd .* -group yaml-hooks _yaml_filter_around_selections hook window InsertChar \n -group yaml-indent _yaml_indent_on_new_line } +hool -group yaml-highlight global WinSetOption filetype=(?!yaml).* %{ rmhl yaml } + hook global WinSetOption filetype=(?!yaml).* %{ - rmhl yaml rmhooks window yaml-indent rmhooks window yaml-hooks } diff --git a/rc/core/asciidoc.kak b/rc/core/asciidoc.kak index 7420687a..a7bb1539 100644 --- a/rc/core/asciidoc.kak +++ b/rc/core/asciidoc.kak @@ -28,5 +28,5 @@ addhl -group /asciidoc regex ^:[-\w]+: 0:meta # Initialization # ‾‾‾‾‾‾‾‾‾‾‾‾‾‾ # -hook global WinSetOption filetype=asciidoc %{ addhl ref asciidoc } -hook global WinSetOption filetype=(?!asciidoc).* %{ rmhl asciidoc } +hook -group asciidoc-highlight global WinSetOption filetype=asciidoc %{ addhl ref asciidoc } +hook -group asciidoc-highlight global WinSetOption filetype=(?!asciidoc).* %{ rmhl asciidoc } diff --git a/rc/core/c-family.kak b/rc/core/c-family.kak index f2bb5792..293c7335 100644 --- a/rc/core/c-family.kak +++ b/rc/core/c-family.kak @@ -252,14 +252,14 @@ hook global WinSetOption filetype=(?!(c|cpp|objc)$).* %[ unalias window alt c-family-alternative-file ] -hook global WinSetOption filetype=c %[ addhl ref c ] -hook global WinSetOption filetype=(?!c$).* %[ rmhl c ] +hook -group c-highlight global WinSetOption filetype=c %[ addhl ref c ] +hook -group c-highlight global WinSetOption filetype=(?!c$).* %[ rmhl c ] -hook global WinSetOption filetype=cpp %[ addhl ref cpp ] -hook global WinSetOption filetype=(?!cpp$).* %[ rmhl cpp ] +hook -group cpp-highlight global WinSetOption filetype=cpp %[ addhl ref cpp ] +hook -group cpp-highlight global WinSetOption filetype=(?!cpp$).* %[ rmhl cpp ] -hook global WinSetOption filetype=objc %[ addhl ref objc ] -hook global WinSetOption filetype=(?!objc$).* %[ rmhl objc ] +hook -group objc-highlight global WinSetOption filetype=objc %[ addhl ref objc ] +hook -group objc-highlight global WinSetOption filetype=(?!objc$).* %[ rmhl objc ] decl str c_include_guard_style "ifdef" def -hidden _c-family-insert-include-guards %{ diff --git a/rc/core/diff.kak b/rc/core/diff.kak index adab2aa8..f481b5a0 100644 --- a/rc/core/diff.kak +++ b/rc/core/diff.kak @@ -7,5 +7,5 @@ addhl -group /diff regex "^\+[^\n]*\n" 0:green,default addhl -group /diff regex "^-[^\n]*\n" 0:red,default addhl -group /diff regex "^@@[^\n]*@@" 0:cyan,default -hook global WinSetOption filetype=diff %{ addhl ref diff } -hook global WinSetOption filetype=(?!diff).* %{ rmhl diff } +hook -group diff-highlight global WinSetOption filetype=diff %{ addhl ref diff } +hook -group diff-highlight global WinSetOption filetype=(?!diff).* %{ rmhl diff } diff --git a/rc/core/grep.kak b/rc/core/grep.kak index 75e6ab49..3973bdd3 100644 --- a/rc/core/grep.kak +++ b/rc/core/grep.kak @@ -23,14 +23,21 @@ def -params .. -file-completion \ }" }} -hook global WinSetOption filetype=grep %{ +hook -group grep-highlight global WinSetOption filetype=grep %{ addhl group grep addhl -group grep regex "^((?:\w:)?[^:]+):(\d+):(\d+)?" 1:cyan 2:green 3:green addhl -group grep line %{%opt{_grep_current_line}} default+b +} + +hook global WinSetOption filetype=grep %{ hook buffer -group grep-hooks NormalKey grep-jump } -hook global WinSetOption filetype=(?!grep).* %{ rmhl grep; rmhooks buffer grep-hooks } +hool -group grep-highlight global WinSetOption filetype=(?!grep).* %{ rmhl grep } + +hook global WinSetOption filetype=(?!grep).* %{ + rmhooks buffer grep-hooks +} decl str jumpclient diff --git a/rc/core/kakrc.kak b/rc/core/kakrc.kak index e1366bff..9c54e807 100644 --- a/rc/core/kakrc.kak +++ b/rc/core/kakrc.kak @@ -37,5 +37,5 @@ addhl -group /kakrc/single_string fill string addhl -group /kakrc/comment fill comment addhl -group /kakrc/shell ref sh -hook global WinSetOption filetype=kak %{ addhl ref kakrc } -hook global WinSetOption filetype=(?!kak).* %{ rmhl kakrc } +hook -group kak-highlight global WinSetOption filetype=kak %{ addhl ref kakrc } +hook -group kak-highlight global WinSetOption filetype=(?!kak).* %{ rmhl kakrc } diff --git a/rc/core/make.kak b/rc/core/make.kak index d9629ea7..1661420d 100644 --- a/rc/core/make.kak +++ b/rc/core/make.kak @@ -22,12 +22,17 @@ addhl -group / group make addhl -group /make regex "^((?:\w:)?[^:\n]+):(\d+):(?:(\d+):)?\h+(?:((?:fatal )?error)|(warning)|(note)|(required from(?: here)?))?.*?$" 1:cyan 2:green 3:green 4:red 5:yellow 6:blue 7:yellow addhl -group /make line %{%opt{_make_current_error_line}} default+b +hook -group make-highlight global WinSetOption filetype=make %{ addhl ref make } + hook global WinSetOption filetype=make %{ - addhl ref make hook buffer -group make-hooks NormalKey make-jump } -hook global WinSetOption filetype=(?!make).* %{ rmhl make; rmhooks buffer make-hooks } +hool -group make-highlight global WinSetOption filetype=(?!make).* %{ rmhl make } + +hook global WinSetOption filetype=(?!make).* %{ + rmhooks buffer make-hooks +} decl str jumpclient diff --git a/rc/core/makefile.kak b/rc/core/makefile.kak index 08fbdfd0..4ac5b17d 100644 --- a/rc/core/makefile.kak +++ b/rc/core/makefile.kak @@ -54,16 +54,17 @@ def -hidden _makefile-indent-on-new-line %{ # Initialization # ‾‾‾‾‾‾‾‾‾‾‾‾‾‾ -hook global WinSetOption filetype=makefile %{ - addhl ref makefile +hook -group makefile-highlight global WinSetOption filetype=makefile %{ addhl ref makefile } +hook global WinSetOption filetype=makefile %{ hook window InsertChar \n -group makefile-indent _makefile-indent-on-new-line set window comment_selection_chars "" set window comment_line_chars "#" } +hool -group makefile-highlight global WinSetOption filetype=(?!makefile).* %{ rmhl makefile } + hook global WinSetOption filetype=(?!makefile).* %{ - rmhl makefile rmhooks window makefile-indent } diff --git a/rc/core/man.kak b/rc/core/man.kak index ac1ba94c..a86b6d24 100644 --- a/rc/core/man.kak +++ b/rc/core/man.kak @@ -2,7 +2,7 @@ decl str docsclient decl -hidden str _manpage -hook global WinSetOption filetype=man %{ +hook -group man-highlight global WinSetOption filetype=man %{ addhl group man-highlight # Sections addhl -group man-highlight regex ^\S.*?$ 0:blue @@ -12,14 +12,17 @@ hook global WinSetOption filetype=man %{ addhl -group man-highlight regex '^ {7}-[^\s,]+(,\s+-[^\s,]+)*' 0:yellow # References to other manpages addhl -group man-highlight regex [-a-zA-Z0-9_.]+\(\d\) 0:green +} +hook global WinSetOption filetype=man %{ hook -group man-hooks window WinResize .* %{ _man %opt{_manpage} } } +hool -group man-highlight global WinSetOption filetype=(?!man).* %{ rmhl man-highlight } + hook global WinSetOption filetype=(?!man).* %{ - rmhl man-higlight rmhooks window man-hooks } diff --git a/rc/core/python.kak b/rc/core/python.kak index 37d72e6e..51e447ae 100644 --- a/rc/core/python.kak +++ b/rc/core/python.kak @@ -69,8 +69,9 @@ def -hidden _python_indent_on_new_line %{ # Initialization # ‾‾‾‾‾‾‾‾‾‾‾‾‾‾ +hook -group python-highlight global WinSetOption filetype=python %{ addhl ref python } + hook global WinSetOption filetype=python %{ - addhl ref python hook window InsertChar \n -group python-indent _python_indent_on_new_line # cleanup trailing whitespaces on current line insert end hook window InsertEnd .* -group python-indent %{ try %{ exec -draft \; s ^\h+$ d } } @@ -78,7 +79,8 @@ hook global WinSetOption filetype=python %{ set window formatcmd "autopep8 -" } +hool -group python-highlight global WinSetOption filetype=(?!python).* %{ rmhl python } + hook global WinSetOption filetype=(?!python).* %{ - rmhl python rmhooks window python-indent } diff --git a/rc/core/sh.kak b/rc/core/sh.kak index 0e1cf76b..7588f679 100644 --- a/rc/core/sh.kak +++ b/rc/core/sh.kak @@ -39,5 +39,5 @@ addhl -group /sh/code regex ^\h*(\w+)\h*\(\) 1:identifier addhl -group /sh/code regex \$(\w+|\{.+?\}|#|@|\?|\$|!|-|\*) 0:identifier addhl -group /sh/double_string regex \$(\w+|\{.+?\}) 0:identifier -hook global WinSetOption filetype=sh %{ addhl ref sh } -hook global WinSetOption filetype=(?!sh).* %{ rmhl sh } +hook -group sh-highlight global WinSetOption filetype=sh %{ addhl ref sh } +hook -group sh-highlight global WinSetOption filetype=(?!sh).* %{ rmhl sh } diff --git a/rc/extra/cabal.kak b/rc/extra/cabal.kak index 575672c5..e76a4560 100644 --- a/rc/extra/cabal.kak +++ b/rc/extra/cabal.kak @@ -63,17 +63,18 @@ def -hidden _cabal_indent_on_closing_curly_brace %[ # Initialization # ‾‾‾‾‾‾‾‾‾‾‾‾‾‾ -hook global WinSetOption filetype=cabal %[ - addhl ref cabal +hook -group cabal-highlight global WinSetOption filetype=cabal %{ addhl ref cabal } +hook global WinSetOption filetype=cabal %[ hook window InsertEnd .* -group cabal-hooks _cabal_filter_around_selections hook window InsertChar \n -group cabal-indent _cabal_indent_on_new_line hook window InsertChar \{ -group cabal-indent _cabal_indent_on_opening_curly_brace hook window InsertChar \} -group cabal-indent _cabal_indent_on_closing_curly_brace ] +hool -group cabal-highlight global WinSetOption filetype=(?!cabal).* %{ rmhl cabal } + hook global WinSetOption filetype=(?!cabal).* %{ - rmhl cabal rmhooks window cabal-indent rmhooks window cabal-hooks } diff --git a/rc/extra/coffee.kak b/rc/extra/coffee.kak index b69b2443..94e33da7 100644 --- a/rc/extra/coffee.kak +++ b/rc/extra/coffee.kak @@ -75,9 +75,9 @@ def -hidden _coffee_indent_on_new_line %{ # Initialization # ‾‾‾‾‾‾‾‾‾‾‾‾‾‾ -hook global WinSetOption filetype=coffee %{ - addhl ref coffee +hook -group coffee-highlight global WinSetOption filetype=coffee %{ addhl ref coffee } +hook global WinSetOption filetype=coffee %{ hook window InsertEnd .* -group coffee-hooks _coffee_filter_around_selections hook window InsertChar \n -group coffee-indent _coffee_indent_on_new_line @@ -85,8 +85,9 @@ hook global WinSetOption filetype=coffee %{ set window comment_selection_chars '###:###' } +hool -group coffee-highlight global WinSetOption filetype=(?!coffee).* %{ rmhl coffee } + hook global WinSetOption filetype=(?!coffee).* %{ - rmhl coffee rmhooks window coffee-indent rmhooks window coffee-hooks } diff --git a/rc/extra/cucumber.kak b/rc/extra/cucumber.kak index 85915ca5..ea3c78e7 100644 --- a/rc/extra/cucumber.kak +++ b/rc/extra/cucumber.kak @@ -81,15 +81,16 @@ def -hidden _cucumber_indent_on_new_line %{ # Initialization # ‾‾‾‾‾‾‾‾‾‾‾‾‾‾ -hook global WinSetOption filetype=cucumber %{ - addhl ref cucumber +hook -group cucumber-highlight global WinSetOption filetype=cucumber %{ addhl ref cucumber } +hook global WinSetOption filetype=cucumber %{ hook window InsertEnd .* -group cucumber-hooks _cucumber_filter_around_selections hook window InsertChar \n -group cucumber-indent _cucumber_indent_on_new_line } +hool -group cucumber-highlight global WinSetOption filetype=(?!cucumber).* %{ rmhl cucumber } + hook global WinSetOption filetype=(?!cucumber).* %{ - rmhl cucumber rmhooks window cucumber-indent rmhooks window cucumber-hooks } diff --git a/rc/extra/dockerfile.kak b/rc/extra/dockerfile.kak index 48874d65..39769c32 100644 --- a/rc/extra/dockerfile.kak +++ b/rc/extra/dockerfile.kak @@ -38,10 +38,5 @@ addhl -group /dockerfile/comment fill comment # Initialization # ‾‾‾‾‾‾‾‾‾‾‾‾‾‾ -hook global WinSetOption filetype=dockerfile %{ - addhl ref dockerfile -} - -hook global WinSetOption filetype=(?!dockerfile).* %{ - rmhl dockerfile -} +hook -group dockerfile-highlight global WinSetOption filetype=dockerfile %{ addhl ref dockerfile } +hook -group dockerfile-highlight global WinSetOption filetype=(?!dockerfile).* %{ rmhl dockerfile } diff --git a/rc/extra/exherbo.kak b/rc/extra/exherbo.kak index 1f6a0576..a8f325d2 100644 --- a/rc/extra/exherbo.kak +++ b/rc/extra/exherbo.kak @@ -34,8 +34,8 @@ addhl -group /exheres-0-metadata regex ^(?:[\s\t]+)?[\S]+[\s\t]+=[\s\t]+\[.+?[\s addhl -group /exheres-0-metadata regex ^(?:[\s\t]+)?(\S+)\s\[\[$ 0:type addhl -group /exheres-0-metadata regex ^(?:[\s\t]+)?\]\]$ 0:type -hook global WinSetOption filetype=exheres-0-metadata %{ addhl ref exheres-0-metadata } -hook global WinSetOption filetype=(?!exheres-0-metadata).* %{ rmhl exheres-0-metadata } +hook -group exheres-0-metadata-highlight global WinSetOption filetype=exheres-0-metadata %{ addhl ref exheres-0-metadata } +hook -group exheres-0-metadata-highlight global WinSetOption filetype=(?!exheres-0-metadata).* %{ rmhl exheres-0-metadata } ## exheres-0 options descriptions addhl -group / group exheres-0-options-descriptions @@ -44,8 +44,8 @@ addhl -group /exheres-0-options-descriptions regex ^(?:[\s\t]+)?[\S]+[\s\t]+-[\s addhl -group /exheres-0-options-descriptions regex ^(?:[\s\t]+)?(\S+)\s\[\[$ 0:type addhl -group /exheres-0-options-descriptions regex ^(?:[\s\t]+)?\]\]$ 0:type -hook global WinSetOption filetype=exheres-0-options-descriptions %{ addhl ref exheres-0-options-descriptions } -hook global WinSetOption filetype=(?!exheres-0-options-descriptions).* %{ rmhl exheres-0-options-descriptions } +hook -group exheres-0-options-descriptions-highlight global WinSetOption filetype=exheres-0-options-descriptions %{ addhl ref exheres-0-options-descriptions } +hook -group exheres-0-options-descriptions-highlight global WinSetOption filetype=(?!exheres-0-options-descriptions).* %{ rmhl exheres-0-options-descriptions } ## metadata/licence_groups.conf addhl -group / group exheres-0-licence-groups @@ -53,8 +53,8 @@ addhl -group /exheres-0-licence-groups regex [\s\t]+(\S+(?:[\s\t]+))*$ 0:attribu addhl -group /exheres-0-licence-groups regex ^(\S+) 0:type addhl -group /exheres-0-licence-groups regex ^#.*?$ 0:comment -hook global WinSetOption filetype=exheres-0-licence-groups %{ addhl ref exheres-0-licence-groups } -hook global WinSetOption filetype=(?!exheres-0-licence-groups).* %{ rmhl exheres-0-licence-groups } +hook -group exheres-0-licence-groups-highlight global WinSetOption filetype=exheres-0-licence-groups %{ addhl ref exheres-0-licence-groups } +hook -group exheres-0-licence-groups-highlight global WinSetOption filetype=(?!exheres-0-licence-groups).* %{ rmhl exheres-0-licence-groups } ## Paludis configurations ### options.conf @@ -67,24 +67,24 @@ addhl -group /paludis-options-conf regex [\s\t](-\S+)(.*?) 1:red addhl -group /paludis-options-conf regex ^(\S+/\S+) 0:type addhl -group /paludis-options-conf regex ^#.*?$ 0:comment -hook global WinSetOption filetype=paludis-options-conf %{ addhl ref paludis-options-conf } -hook global WinSetOption filetype=(?!paludis-options-conf).* %{ rmhl paludis-options-conf } +hook -group paludis-options-conf-highlight global WinSetOption filetype=paludis-options-conf %{ addhl ref paludis-options-conf } +hook -group paludis-options-conf-highlight global WinSetOption filetype=(?!paludis-options-conf).* %{ rmhl paludis-options-conf } ## general.conf, repository.template addhl -group / group paludis-key-value-conf addhl -group /paludis-key-value-conf regex ^[\s\t]?(\S+)[\s\t+]=[\s\t+](.*?)$ 1:attribute 2:value addhl -group /paludis-key-value-conf regex ^#.*?$ 0:comment -hook global WinSetOption filetype=paludis-key-value-conf %{ addhl ref paludis-key-value-conf } -hook global WinSetOption filetype=(?!paludis-key-value-conf).* %{ rmhl paludis-key-value-conf } +hook -group paludis-key-value-conf-highlight global WinSetOption filetype=paludis-key-value-conf %{ addhl ref paludis-key-value-conf } +hook -group paludis-key-value-conf-highlight global WinSetOption filetype=(?!paludis-key-value-conf).* %{ rmhl paludis-key-value-conf } ## mirrors.conf addhl -group / group paludis-mirrors-conf addhl -group /paludis-mirrors-conf regex ^[\s\t+]?(\S+)[\s\t+](.*?)$ 1:type 2:value addhl -group /paludis-mirrors-conf regex ^#.*?$ 0:comment -hook global WinSetOption filetype=paludis-mirrors-conf %{ addhl ref paludis-mirrors-conf } -hook global WinSetOption filetype=(?!paludis-mirrors-conf).* %{ rmhl paludis-mirrors-conf } +hook -group paludis-mirrors-conf-highlight global WinSetOption filetype=paludis-mirrors-conf %{ addhl ref paludis-mirrors-conf } +hook -group paludis-mirrors-conf-highlight global WinSetOption filetype=(?!paludis-mirrors-conf).* %{ rmhl paludis-mirrors-conf } ## package_(unmask|mask).conf, platforms.conf addhl -group / group paludis-specs-conf @@ -92,8 +92,8 @@ addhl -group /paludis-specs-conf regex [\s\t]+(\S+(?:[\s\t]+))*$ 0:attribute addhl -group /paludis-specs-conf regex ^(\S+/\S+) 0:type addhl -group /paludis-specs-conf regex ^#.*?$ 0:comment -hook global WinSetOption filetype=paludis-specs-conf %{ addhl ref paludis-specs-conf } -hook global WinSetOption filetype=(?!paludis-specs-conf).* %{ rmhl paludis-specs-conf } +hook -group paludis-specs-conf-highlight global WinSetOption filetype=paludis-specs-conf %{ addhl ref paludis-specs-conf } +hook -group paludis-specs-conf-highlight global WinSetOption filetype=(?!paludis-specs-conf).* %{ rmhl paludis-specs-conf } ## News items (GLEP42) addhl -group / group glep42 @@ -101,5 +101,5 @@ addhl -group /glep42 regex ^(Title|Author|Translator|Content-Type|Posted|Revisio addhl -group /glep42 regex <[^@>]+@.*?> 0:string addhl -group /glep42 regex ^>.*?$ 0:comment -hook global WinSetOption filetype=glep42 %{ addhl ref glep42 } -hook global WinSetOption filetype=(?!glep42).* %{ rmhl glep42 } +hook -group glep42-highlight global WinSetOption filetype=glep42 %{ addhl ref glep42 } +hook -group glep42-highlight global WinSetOption filetype=(?!glep42).* %{ rmhl glep42 } diff --git a/rc/extra/git-tools.kak b/rc/extra/git-tools.kak index 216e74b7..5478d298 100644 --- a/rc/extra/git-tools.kak +++ b/rc/extra/git-tools.kak @@ -1,24 +1,20 @@ decl str docsclient -hook global WinSetOption filetype=git-log %{ +hook -group git-log-highlight global WinSetOption filetype=git-log %{ addhl group git-log-highlight addhl -group git-log-highlight regex '^(commit) ([0-9a-f]+)$' 1:yellow 2:red addhl -group git-log-highlight regex '^([a-zA-Z_-]+:) (.*?)$' 1:green 2:magenta addhl -group git-log-highlight ref diff # highlight potential diffs from the -p option } -hook global WinSetOption filetype=(?!git-log).* %{ - rmhl git-log-highlight -} +hook -group git-log-highlight global WinSetOption filetype=(?!git-log).* %{ rmhl git-log-highlight } -hook global WinSetOption filetype=git-status %{ +hook -group git-status-highlight global WinSetOption filetype=git-status %{ addhl group git-status-highlight addhl -group git-status-highlight regex '^\h+(?:((?:both )?modified:)|(added:|new file:)|(deleted(?: by \w+)?:)|(renamed:)|(copied:))(?:.*?)$' 1:yellow 2:green 3:red 4:cyan 5:blue 6:magenta } -hook global WinSetOption filetype=(?!git-status).* %{ - rmhl git-status-highlight -} +hook -group git-status-highlight global WinSetOption filetype=(?!git-status).* %{ rmhl git-status-highlight } decl line-flags git_blame_flags decl line-flags git_diff_flags diff --git a/rc/extra/haml.kak b/rc/extra/haml.kak index 65e09a31..2bb07251 100644 --- a/rc/extra/haml.kak +++ b/rc/extra/haml.kak @@ -58,15 +58,16 @@ def -hidden _haml_indent_on_new_line %{ # Initialization # ‾‾‾‾‾‾‾‾‾‾‾‾‾‾ -hook global WinSetOption filetype=haml %{ - addhl ref haml +hook -group haml-highlight global WinSetOption filetype=haml %{ addhl ref haml } +hook global WinSetOption filetype=haml %{ hook window InsertEnd .* -group haml-hooks _haml_filter_around_selections hook window InsertChar \n -group haml-indent _haml_indent_on_new_line } +hool -group haml-highlight global WinSetOption filetype=(?!haml).* %{ rmhl haml } + hook global WinSetOption filetype=(?!haml).* %{ - rmhl haml rmhooks window haml-indent rmhooks window haml-hooks } diff --git a/rc/extra/kickstart.kak b/rc/extra/kickstart.kak index 16ecb379..08c8f0a1 100644 --- a/rc/extra/kickstart.kak +++ b/rc/extra/kickstart.kak @@ -26,10 +26,5 @@ addhl -group /kickstart/shell regex '^\h*%end\b' 0:type addhl -group /kickstart/shell ref sh -hook global WinSetOption filetype=kickstart %{ - addhl ref kickstart -} - -hook global WinSetOption filetype=(?!kickstart).* %{ - rmhl kickstart -} +hook -group kickstart-highlight global WinSetOption filetype=kickstart %{ addhl ref kickstart } +hook -group kickstart-highlight global WinSetOption filetype=(?!kickstart).* %{ rmhl kickstart } diff --git a/rc/extra/latex.kak b/rc/extra/latex.kak index 00cef5d2..86889365 100644 --- a/rc/extra/latex.kak +++ b/rc/extra/latex.kak @@ -33,12 +33,10 @@ addhl -group /latex/content regex '\\textbf\{([^}]+)\}' 1:default+b # Initialization # ‾‾‾‾‾‾‾‾‾‾‾‾‾‾ -hook global WinSetOption filetype=latex %{ - addhl ref latex +hook -group latex-highlight global WinSetOption filetype=latex %{ addhl ref latex } +hook global WinSetOption filetype=latex %{ set window comment_line_chars '%' } -hook global WinSetOption filetype=(?!latex).* %{ - rmhl latex -} +hook -group latex-highlight global WinSetOption filetype=(?!latex).* %{ rmhl latex } diff --git a/rc/extra/moon.kak b/rc/extra/moon.kak index 4edb36b6..9f96f03b 100644 --- a/rc/extra/moon.kak +++ b/rc/extra/moon.kak @@ -98,9 +98,9 @@ def -hidden _moon_indent_on_new_line %{ # Initialization # ‾‾‾‾‾‾‾‾‾‾‾‾‾‾ -hook global WinSetOption filetype=moon %{ - addhl ref moon +hook -group moon-highlight global WinSetOption filetype=moon %{ addhl ref moon } +hook global WinSetOption filetype=moon %{ hook window InsertEnd .* -group moon-hooks _moon_filter_around_selections hook window InsertChar .* -group moon-indent _moon_indent_on_char hook window InsertChar \n -group moon-indent _moon_indent_on_new_line @@ -111,8 +111,9 @@ hook global WinSetOption filetype=moon %{ set window comment_selection_chars '' } +hool -group moon-highlight global WinSetOption filetype=(?!moon).* %{ rmhl moon } + hook global WinSetOption filetype=(?!moon).* %{ - rmhl moon rmhooks window moon-indent rmhooks window moon-hooks diff --git a/rc/extra/pug.kak b/rc/extra/pug.kak index ce3bd0d2..0a4d29a5 100644 --- a/rc/extra/pug.kak +++ b/rc/extra/pug.kak @@ -69,15 +69,16 @@ def -hidden _pug_indent_on_new_line %{ # Initialization # ‾‾‾‾‾‾‾‾‾‾‾‾‾‾ -hook global WinSetOption filetype=pug %{ - addhl ref pug +hook -group pug-highlight global WinSetOption filetype=pug %{ addhl ref pug } +hook global WinSetOption filetype=pug %{ hook window InsertEnd .* -group pug-hooks _pug_filter_around_selections hook window InsertChar \n -group pug-indent _pug_indent_on_new_line } +hool -group pug-highlight global WinSetOption filetype=(?!pug).* %{ rmhl pug } + hook global WinSetOption filetype=(?!pug).* %{ - rmhl pug rmhooks window pug-indent rmhooks window pug-hooks } diff --git a/rc/extra/ragel.kak b/rc/extra/ragel.kak index 7fcf8fb7..65263f47 100644 --- a/rc/extra/ragel.kak +++ b/rc/extra/ragel.kak @@ -62,16 +62,17 @@ def -hidden _ragel_indent_on_new_line %< # Initialization # ‾‾‾‾‾‾‾‾‾‾‾‾‾‾ -hook global WinSetOption filetype=ragel %{ - addhl ref ragel +hook -group ragel-highlight global WinSetOption filetype=ragel %{ addhl ref ragel } +hook global WinSetOption filetype=ragel %{ hook window InsertEnd .* -group ragel-hooks _ragel_filter_around_selections hook window InsertChar .* -group ragel-indent _ragel_indent_on_char hook window InsertChar \n -group ragel-indent _ragel_indent_on_new_line } +hool -group ragel-highlight global WinSetOption filetype=(?!ragel).* %{ rmhl ragel } + hook global WinSetOption filetype=(?!ragel).* %{ - rmhl ragel rmhooks window ragel-indent rmhooks window ragel-hooks } diff --git a/rc/extra/sass.kak b/rc/extra/sass.kak index ba66f2a8..df49ebd5 100644 --- a/rc/extra/sass.kak +++ b/rc/extra/sass.kak @@ -54,15 +54,16 @@ def -hidden _sass_indent_on_new_line %{ # Initialization # ‾‾‾‾‾‾‾‾‾‾‾‾‾‾ -hook global WinSetOption filetype=sass %{ - addhl ref sass +hook -group sass-highlight global WinSetOption filetype=sass %{ addhl ref sass } +hook global WinSetOption filetype=sass %{ hook window InsertEnd .* -group sass-hooks _sass_filter_around_selections hook window InsertChar \n -group sass-indent _sass_indent_on_new_line } +hool -group sass-highlight global WinSetOption filetype=(?!sass).* %{ rmhl sass } + hook global WinSetOption filetype=(?!sass).* %{ - rmhl sass rmhooks window sass-indent rmhooks window sass-hooks } diff --git a/rc/extra/scss.kak b/rc/extra/scss.kak index e52e4d22..7627c095 100644 --- a/rc/extra/scss.kak +++ b/rc/extra/scss.kak @@ -33,16 +33,17 @@ def -hidden _scss_indent_on_closing_curly_brace _css_indent_on_closing_curly_bra # Initialization # ‾‾‾‾‾‾‾‾‾‾‾‾‾‾ -hook global WinSetOption filetype=scss %[ - addhl ref scss +hook -group scss-highlight global WinSetOption filetype=scss %{ addhl ref scss } +hook global WinSetOption filetype=scss %[ hook window InsertEnd .* -group scss-hooks _scss_filter_around_selections hook window InsertChar \n -group scss-indent _scss_indent_on_new_line hook window InsertChar \} -group scss-indent _scss_indent_on_closing_curly_brace ] +hool -group scss-highlight global WinSetOption filetype=(?!scss).* %{ rmhl scss } + hook global WinSetOption filetype=(?!scss).* %{ - rmhl scss rmhooks window scss-indent rmhooks window scss-hooks } diff --git a/rc/extra/tupfile.kak b/rc/extra/tupfile.kak index a8ac0e02..438d6b54 100644 --- a/rc/extra/tupfile.kak +++ b/rc/extra/tupfile.kak @@ -29,10 +29,5 @@ addhl -group /tupfile/code regex "\b(\&?[\w_]+)\s*[:+]?=" 1:keyword # Initialization # ‾‾‾‾‾‾‾‾‾‾‾‾‾‾ -hook global WinSetOption filetype=tupfile %{ - addhl ref tupfile -} - -hook global WinSetOption filetype=(?!tupfile).* %{ - rmhl tupfile -} +hook -group tupfile-highlight global WinSetOption filetype=tupfile %{ addhl ref tupfile } +hook -group tupfile-highlight global WinSetOption filetype=(?!tupfile).* %{ rmhl tupfile }