Kakoune restructure
This commit is contained in:
@@ -0,0 +1,19 @@
|
||||
declare-option -hidden str-list filetype_modules
|
||||
|
||||
define-command -hidden -params 1 filetype-module-load %{
|
||||
evaluate-commands %sh{
|
||||
ft="$1"
|
||||
file="$kak_config/filetypes/$ft.kak"
|
||||
[ -f "$file" ] || exit 0
|
||||
for loaded in $kak_opt_filetype_modules; do
|
||||
[ "$loaded" = "$ft" ] && exit 0
|
||||
done
|
||||
printf 'set-option -add global filetype_modules %%{%s}\n' "$ft"
|
||||
printf 'source %%{%s}\n' "$file"
|
||||
printf 'try %%{ filetype-%s }\n' "$ft"
|
||||
}
|
||||
}
|
||||
|
||||
hook global WinSetOption filetype=(.+) %{
|
||||
filetype-module-load %val{hook_param_capture_1}
|
||||
}
|
||||
Reference in New Issue
Block a user