summaryrefslogtreecommitdiff
path: root/rc/filetype/toml.kak
diff options
context:
space:
mode:
authorJustin Frank <justinpfrank@protonmail.com>2019-04-11 15:54:58 -0700
committerJustin Frank <justinpfrank@protonmail.com>2019-04-11 15:54:58 -0700
commit6512eafa6006976bd65336ab94d6f1ebd54022e4 (patch)
treed3c11193a4166f41537b1182cb797d2460028774 /rc/filetype/toml.kak
parentc2b32ebaa77aed64a0b27d199e4f3dd5907014c6 (diff)
Update remaining files to new provide/require format
Diffstat (limited to 'rc/filetype/toml.kak')
-rw-r--r--rc/filetype/toml.kak31
1 files changed, 15 insertions, 16 deletions
diff --git a/rc/filetype/toml.kak b/rc/filetype/toml.kak
index 141a21fd..4a7ad81c 100644
--- a/rc/filetype/toml.kak
+++ b/rc/filetype/toml.kak
@@ -8,10 +8,24 @@ hook global BufCreate .*\.(toml) %{
set-option buffer filetype toml
}
-hook -once global BufSetOption filetype=toml %{
+# Initialization
+# ‾‾‾‾‾‾‾‾‾‾‾‾‾‾
+
+hook global WinSetOption filetype=toml %{
require-module toml
+
+ hook window ModeChange insert:.* -group toml-trim-indent toml-trim-indent
+ hook window InsertChar \n -group toml-indent toml-indent-on-new-line
+
+ hook -once -always window WinSetOption filetype=.* %{ remove-hooks window toml-.+ }
}
+hook -group toml-highlight global WinSetOption filetype=toml %{
+ add-highlighter window/toml ref toml
+ hook -once -always window WinSetOption filetype=.* %{ remove-highlighter window/toml }
+}
+
+
provide-module toml %{
# Highlighters
@@ -53,19 +67,4 @@ define-command -hidden toml-indent-on-new-line %{
}
}
-# Initialization
-# ‾‾‾‾‾‾‾‾‾‾‾‾‾‾
-
-hook -group toml-highlight global WinSetOption filetype=toml %{
- add-highlighter window/toml ref toml
- hook -once -always window WinSetOption filetype=.* %{ remove-highlighter window/toml }
-}
-
-hook global WinSetOption filetype=toml %{
- hook window ModeChange insert:.* -group toml-trim-indent toml-trim-indent
- hook window InsertChar \n -group toml-indent toml-indent-on-new-line
-
- hook -once -always window WinSetOption filetype=.* %{ remove-hooks window toml-.+ }
-}
-
}