summaryrefslogtreecommitdiff
path: root/rc/filetype/yaml.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/yaml.kak
parentc2b32ebaa77aed64a0b27d199e4f3dd5907014c6 (diff)
Update remaining files to new provide/require format
Diffstat (limited to 'rc/filetype/yaml.kak')
-rw-r--r--rc/filetype/yaml.kak29
1 files changed, 14 insertions, 15 deletions
diff --git a/rc/filetype/yaml.kak b/rc/filetype/yaml.kak
index 8e0f3487..ac8a9823 100644
--- a/rc/filetype/yaml.kak
+++ b/rc/filetype/yaml.kak
@@ -8,10 +8,23 @@ hook global BufCreate .*[.](ya?ml) %{
set-option buffer filetype yaml
}
-hook -once global BufSetOption filetype=yaml %{
+# Initialization
+# ‾‾‾‾‾‾‾‾‾‾‾‾‾‾
+
+hook global WinSetOption filetype=yaml %{
require-module yaml
+
+ hook window ModeChange insert:.* -group yaml-trim-indent yaml-trim-indent
+ hook window InsertChar \n -group yaml-indent yaml-indent-on-new-line
+ hook -once -always window WinSetOption filetype=.* %{ remove-hooks window yaml-.+ }
}
+hook -group yaml-highlight global WinSetOption filetype=yaml %{
+ add-highlighter window/yaml ref yaml
+ hook -once -always window WinSetOption filetype=.* %{ remove-highlighter window/yaml }
+}
+
+
provide-module yaml %{
# Highlighters
@@ -49,18 +62,4 @@ define-command -hidden yaml-indent-on-new-line %{
}
}
-# Initialization
-# ‾‾‾‾‾‾‾‾‾‾‾‾‾‾
-
-hook -group yaml-highlight global WinSetOption filetype=yaml %{
- add-highlighter window/yaml ref yaml
- hook -once -always window WinSetOption filetype=.* %{ remove-highlighter window/yaml }
-}
-
-hook global WinSetOption filetype=yaml %{
- hook window ModeChange insert:.* -group yaml-trim-indent yaml-trim-indent
- hook window InsertChar \n -group yaml-indent yaml-indent-on-new-line
- hook -once -always window WinSetOption filetype=.* %{ remove-hooks window yaml-.+ }
-}
-
}