diff --git a/programs/kakoune.nix b/programs/kakoune.nix index 067a16b..f842aa8 100644 --- a/programs/kakoune.nix +++ b/programs/kakoune.nix @@ -9,11 +9,10 @@ }; hooks = [ { + # When the filetype=latex option is set in a buffer context (automatically), add a new hook to build the latex file on write name = "BufSetOption"; option = "filetype=latex"; - commands = '' - set-option buffer makecmd latexmk -pvc -pdf -e '$pdf_previewer="xdg-open %S"' -e '$pdflatex="pdflatex -interaction=nonstopmode -synctex=1 %O %S"' %opt{documentsrc} - ''; + commands = "hook buffer BufWritePost .* %{ texlab-build }"; } ]; keyMappings = [ @@ -36,6 +35,12 @@ ]; }; extraConfig = '' + # highlight trailing whitespace + add-highlighter global/trailing-whitespace regex '\h+$' 0:Error + + # don't remove trailing indent + set global disabled_hooks .*-trim-indent + eval %sh{kak-lsp --kakoune -s $kak_session} lsp-enable '';