diff --git a/rc/filetype/clojure.kak b/rc/filetype/clojure.kak index d19708af..062e4f0c 100644 --- a/rc/filetype/clojure.kak +++ b/rc/filetype/clojure.kak @@ -1,8 +1,6 @@ # http://clojure.org # ‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾ -# require lisp.kak - # Detection # ‾‾‾‾‾‾‾‾‾ @@ -16,6 +14,8 @@ hook -once global BufSetOption filetype=clojure %{ provide-module clojure %{ +require-module lisp + # Highlighters # ‾‾‾‾‾‾‾‾‾‾‾‾ diff --git a/rc/filetype/etc.kak b/rc/filetype/etc.kak index 1e2067fe..29c6296d 100644 --- a/rc/filetype/etc.kak +++ b/rc/filetype/etc.kak @@ -11,7 +11,32 @@ hook global BufCreate .*/etc/env.d/.* %{ set-option buffer fil hook global BufCreate .*/etc/profile(\.(csh|env))? %{ set-option buffer filetype sh } hook global BufCreate .*/etc/profile\.d/.* %{ set-option buffer filetype sh } + +hook -once global BufSetOption filetype=etc-hosts %{ + require-module etc-hosts +} +hook -once global BufSetOption filetype=etc-resolv-conf %{ + require-module etc-resolv-conf +} +hook -once global BufSetOption filetype=etc-shadow %{ + require-module etc-shadow +} +hook -once global BufSetOption filetype=etc-passwd %{ + require-module etc-passwd +} +hook -once global BufSetOption filetype=etc-gshadow %{ + require-module etc-gshadow +} +hook -once global BufSetOption filetype=etc-group %{ + require-module etc-group +} +hook -once global BufSetOption filetype=etc-fstab %{ + require-module etc-fstab +} + # Highlighters + +provide-module etc-resolv-conf %{ ## /etc/resolv.conf add-highlighter shared/etc-resolv-conf group add-highlighter shared/etc-resolv-conf/ regex ^#.*?$ 0:comment @@ -20,8 +45,9 @@ add-highlighter shared/etc-resolv-conf/ regex ^(nameserver|server|domain|sortlis hook -group etc-resolv-conf-highlight global WinSetOption filetype=etc-resolv-conf %{ add-highlighter window/etc-resolv-conf ref etc-resolv-conf hook -once -always window WinSetOption filetype=.* %{ remove-highlighter window/etc-resolv-conf } -} +}} +provide-module etc-hosts %{ ## /etc/hosts add-highlighter shared/etc-hosts group add-highlighter shared/etc-hosts/ regex ^(.+?)[\s\t]+?(.*?)$ 1:type 2:attribute @@ -30,8 +56,9 @@ add-highlighter shared/etc-hosts/ regex '#.*?$' 0:comment hook -group etc-hosts-highlight global WinSetOption filetype=etc-hosts %{ add-highlighter window/etc-hosts ref etc-hosts hook -once -always window WinSetOption filetype=.* %{ remove-highlighter window/etc-hosts } -} +}} +provide-module etc-fstab %{ ## /etc/fstab add-highlighter shared/etc-fstab group add-highlighter shared/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 @@ -40,8 +67,9 @@ add-highlighter shared/etc-fstab/ regex '#.*?$' 0:comment hook -group etc-fstab-highlight global WinSetOption filetype=etc-fstab %{ add-highlighter window/etc-fstab ref etc-fstab hook -once -always window WinSetOption filetype=.* %{ remove-highlighter window/etc-fstab } -} +}} +provide-module etc-group %{ ## /etc/group add-highlighter shared/etc-group group add-highlighter shared/etc-group/ regex ^(\S+?):(\S+?)?:(\S+?)?:(\S+?)?$ 1:keyword 2:type 3:value 4:string @@ -49,8 +77,9 @@ add-highlighter shared/etc-group/ regex ^(\S+?):(\S+?)?:(\S+?)?:(\S+?)?$ 1:keywo hook -group etc-group-highlight global WinSetOption filetype=etc-group %{ add-highlighter window/etc-group ref etc-group hook -once -always window WinSetOption filetype=.* %{ remove-highlighter window/etc-group } -} +}} +provide-module etc-gshadow %{ ## /etc/gshadow add-highlighter shared/etc-gshadow group add-highlighter shared/etc-gshadow/ regex ^(\S+?):(\S+?)?:(\S+?)?:(\S+?)?$ 1:keyword 2:type 3:value 4:string @@ -58,8 +87,9 @@ add-highlighter shared/etc-gshadow/ regex ^(\S+?):(\S+?)?:(\S+?)?:(\S+?)?$ 1:key hook -group etc-gshadow-highlight global WinSetOption filetype=etc-gshadow %{ add-highlighter window/etc-gshadow ref etc-gshadow hook -once -always window WinSetOption filetype=.* %{ remove-highlighter window/etc-gshadow } -} +}} +provide-module etc-shadow %{ ## /etc/shadow add-highlighter shared/etc-shadow group add-highlighter shared/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 @@ -67,8 +97,9 @@ add-highlighter shared/etc-shadow/ regex ^(\S+?):(\S+?):([0-9]+?):([0-9]+?)?:([0 hook -group etc-shadow-highlight global WinSetOption filetype=etc-shadow %{ add-highlighter window/etc-shadow ref etc-shadow hook -once -always window WinSetOption filetype=.* %{ remove-highlighter window/etc-shadow } -} +}} +provide-module etc-passwd %{ ## /etc/passwd add-highlighter shared/etc-passwd group add-highlighter shared/etc-passwd/ regex ^(\S+?):(\S+?):([0-9]+?):([0-9]+?):(.*?)?:(.+?):(.+?)$ 1:keyword 2:type 3:value 4:value 5:string 6:attribute 7:attribute @@ -76,4 +107,4 @@ add-highlighter shared/etc-passwd/ regex ^(\S+?):(\S+?):([0-9]+?):([0-9]+?):(.*? hook -group etc-passwd-highlight global WinSetOption filetype=etc-passwd %{ add-highlighter window/etc-passwd ref etc-passwd hook -once -always window WinSetOption filetype=.* %{ remove-highlighter window/etc-passwd } -} +}} diff --git a/rc/filetype/fish.kak b/rc/filetype/fish.kak index 24da9d20..db62a354 100644 --- a/rc/filetype/fish.kak +++ b/rc/filetype/fish.kak @@ -8,6 +8,12 @@ hook global BufCreate .*[.](fish) %{ set-option buffer filetype fish } +hook -once global BufSetOption filetype=fish %{ + require-module fish +} + +provide-module fish %{ + # Highlighters # ‾‾‾‾‾‾‾‾‾‾‾‾ @@ -71,3 +77,5 @@ hook global WinSetOption filetype=fish %{ hook -once -always window WinSetOption filetype=.* %{ remove-hooks window fish-.+ } } + +} diff --git a/rc/filetype/gas.kak b/rc/filetype/gas.kak index 0c1f79f8..ba32472a 100644 --- a/rc/filetype/gas.kak +++ b/rc/filetype/gas.kak @@ -4,6 +4,12 @@ hook global BufCreate .*\.(s|S|asm)$ %{ set-option buffer filetype gas } +hook -once global BufSetOption filetype=gas %{ + require-module gas +} + +provide-module gas %{ + add-highlighter shared/gas regions add-highlighter shared/gas/code default-region group add-highlighter shared/gas/string region '"' (?]+@.*?> 0:string @@ -11,3 +17,5 @@ hook -group mail-highlight global WinSetOption filetype=mail %{ add-highlighter window/mail ref mail hook -once -always window WinSetOption filetype=.* %{ remove-highlighter window/mail } } + +} diff --git a/rc/filetype/mercurial.kak b/rc/filetype/mercurial.kak index 3f84eea2..5c014ee7 100644 --- a/rc/filetype/mercurial.kak +++ b/rc/filetype/mercurial.kak @@ -8,6 +8,17 @@ hook global BufCreate .*hg-editor-\w+\.txt$ %{ set-option buffer filetype hg-commit } +hook -once global BufSetOption filetype=hg-commit %{ + require-module hg-commit +} + +provide-module hg-commit %{ + +# Faces +# ‾‾‾‾‾ + +set-face global MercurialCommitComment cyan + # Highlighters # ‾‾‾‾‾‾‾‾‾‾‾‾ @@ -16,3 +27,5 @@ hook -group hg-commit-highlight global WinSetOption filetype=hg-commit %{ add-highlighter window/hg-commit-highlight regex '^HG:[^\n]*' 0:comment hook -once -always window WinSetOption filetype=.* %{ remove-highlighter window/hg-commit-highlight } } + +} diff --git a/rc/filetype/rust.kak b/rc/filetype/rust.kak index 28cb98c3..7018ff31 100644 --- a/rc/filetype/rust.kak +++ b/rc/filetype/rust.kak @@ -8,6 +8,12 @@ hook global BufCreate .*[.](rust|rs) %{ set-option buffer filetype rust } +hook -once global BufSetOption filetype=rust %{ + require-module rust +} + +provide-module rust %🦀 + # Highlighters # ‾‾‾‾‾‾‾‾‾‾‾‾ @@ -93,3 +99,5 @@ hook global WinSetOption filetype=rust %[ hook global WinSetOption filetype=rust %[ set window formatcmd 'rustfmt' ] + +🦀 diff --git a/rc/filetype/scala.kak b/rc/filetype/scala.kak index 1e62e2ad..ce890058 100644 --- a/rc/filetype/scala.kak +++ b/rc/filetype/scala.kak @@ -8,6 +8,12 @@ hook global BufCreate .*[.](scala) %{ set-option buffer filetype scala } +hook -once global BufSetOption filetype=scala %{ + require-module scala +} + +provide-module scala %{ + # Highlighters # ‾‾‾‾‾‾‾‾‾‾‾‾ @@ -73,3 +79,5 @@ hook global WinSetOption filetype=scala %[ hook -once -always window WinSetOption filetype=.* %{ remove-hooks window scala-.+ } ] + +} diff --git a/rc/filetype/swift.kak b/rc/filetype/swift.kak index 1526cadb..4cf71613 100644 --- a/rc/filetype/swift.kak +++ b/rc/filetype/swift.kak @@ -2,6 +2,12 @@ hook global BufCreate .*\.(swift) %{ set-option buffer filetype swift } +hook -once global BufSetOption filetype=swift %{ + require-module swift +} + +provide-module swift %{ + add-highlighter shared/swift regions add-highlighter shared/swift/code default-region group add-highlighter shared/swift/string region %{(?