From 7589d38ec70ea98910e8779895231e21eb87ff30 Mon Sep 17 00:00:00 2001 From: vorboyvo Date: Fri, 14 Mar 2025 09:22:23 -0400 Subject: [PATCH] Removed manual tex building. Added wrap in Kakoune for text types. --- snippets/kakoune.nix | 30 +++++++++++++++++------------- 1 file changed, 17 insertions(+), 13 deletions(-) diff --git a/snippets/kakoune.nix b/snippets/kakoune.nix index 2ffe29f..9ee3b4a 100644 --- a/snippets/kakoune.nix +++ b/snippets/kakoune.nix @@ -25,22 +25,21 @@ commands = "set buffer filetype typst"; option = ".*\.typ"; } + # { + # # 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 = "hook buffer BufWritePost .* %{ texlab-build }"; + # } + { + name = "BufSetOption"; + option = "filetype=markdown"; + commands = "add-highlighter buffer/ wrap -word -indent -width 79"; + } { - # 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 = "hook buffer BufWritePost .* %{ texlab-build }"; - } - { - name = "BufSetOption"; - option = "filetype=typst"; - commands = "hook buffer BufWritePost .* %{ nop %sh{ typst compile $kak_buffile } }"; - } - { - # When the filetype=markdown option is set (automatically), set word wrap on - name = "WinSetOption"; - option = "filetype=markdown"; - commands = "set-option window lintcmd \"proselint\""; + commands = "add-highlighter buffer/ wrap -word -indent -width 79"; } { name = "BufSetOption"; @@ -52,6 +51,11 @@ option = ".*\.Rmd"; commands = "hook buffer BufWritePost .* %{ nop %sh{ Rscript -e \"rmarkdown::render(\\\"$kak_buffile\\\", 'pdf_document')\" } }"; } + { + name = "BufCreate"; + option = ".*\.qmd"; + commands = "hook buffer BufWritePost .* %{ echo %sh{ quarto render $kak_buffile --to pdf } }"; + } ]; keyMappings = [ # Define select all