From 85f0b8bddd31ef67540a931ac2c12462c624e280 Mon Sep 17 00:00:00 2001 From: Daniel Fichtinger Date: Mon, 23 Jun 2025 18:20:16 -0400 Subject: [PATCH] AutoYADM commit: 2025-06-23 18:20:16 --- .config/kak/autoload/filetype.kak | 2 ++ .config/kak/autoload/filetype/latex.kak | 15 +++++++++++++++ .config/kak/autoload/lsp.kak | 4 ++-- 3 files changed, 19 insertions(+), 2 deletions(-) create mode 100644 .config/kak/autoload/filetype/latex.kak diff --git a/.config/kak/autoload/filetype.kak b/.config/kak/autoload/filetype.kak index c3143d90..80db42a6 100644 --- a/.config/kak/autoload/filetype.kak +++ b/.config/kak/autoload/filetype.kak @@ -33,6 +33,8 @@ hook global WinSetOption filetype=latex %{ unset-option window formatcmd remove-hooks window latex-auto-format } + # declare-filetype-mode latex + # map window latex i } hook global WinSetOption filetype=go %{ diff --git a/.config/kak/autoload/filetype/latex.kak b/.config/kak/autoload/filetype/latex.kak new file mode 100644 index 00000000..af196c55 --- /dev/null +++ b/.config/kak/autoload/filetype/latex.kak @@ -0,0 +1,15 @@ +hook global WinSetOption filetype=latex %{ + set-option window formatcmd "tex-fmt --stdin" + set-option window autowrap_fmtcmd 'tex-fmt --stdin -l %c' + set-option window autowrap_format_paragraph true + hook -group latex-auto-format window BufWritePre .* %{ + try format + } + hook -once -always window WinSetOption filetype=.* %{ + unset-option window formatcmd + remove-hooks window latex-auto-format + } + # declare-filetype-mode latex + # map window latex i +} + diff --git a/.config/kak/autoload/lsp.kak b/.config/kak/autoload/lsp.kak index 090b95d6..7be5c61a 100644 --- a/.config/kak/autoload/lsp.kak +++ b/.config/kak/autoload/lsp.kak @@ -274,12 +274,12 @@ hook -group lsp-filetype-latex global BufSetOption filetype=latex %{ # printf %s "$kak_opt_lsp_servers" | kak -f "$(printf 'dictionary =s\\[.*\\]]_a, "%s"' "$kak_selection")" # } # } - declare-user-mode latex + declare-filetype-mode latex map -docstring 'PDF preview search' buffer latex / ': texlab-forward-search' map -docstring 'add selection to ltex dictionary' buffer latex a ': ltex-dictionary-add' map -docstring 'refresh ltex dictionary' buffer latex r ': ltex-dictionary-load' map -docstring 'edit ltex dictionary' buffer latex e ': ltex-dictionary-edit' - map -docstring 'texlab build' buffer latex b ': texlab-build' + map -docstring 'texlab build' buffer latex B ': texlab-build' try lsp-progress-disable }