~piotr-machura/dotfiles

3faa93912b0d55e549a902a00e64854575d9803f — Piotr Machura a month ago f33288f
Add prose filetype to kakoune
1 files changed, 17 insertions(+), 0 deletions(-)

M .config/kak/kakrc
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
}