M .config/kak/kakrc => .config/kak/kakrc +17 -0
@@ 150,3 150,20 @@ hook global WinSetOption filetype=(html|javascript|css|scss|json|yaml) %{
set-option buffer indentwidth 2
set-option buffer formatcmd "prettier --parser %opt{filetype}"
}
+
+# PROSE
+# -----
+define-command -hidden prose-detect %{
+ evaluate-commands %sh{
+ if [ -d "$(dirname $kak_buffile)/.words" ]
+ then
+ echo "set-option buffer filetype prose"
+ fi
+ }
+}
+hook global BufOpenFile .*\.txt prose-detect
+hook global BufOpenFile .*\.txt prose-detect
+hook global WinSetOption filetype=prose %{
+ add-highlighter buffer/ wrap -word -marker '' -width %opt{fmtwidth}
+ noexpandtab
+}