From 8c729cea42ee787cf87d8bcf8c422c85f1159e4a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?L=C3=A9ana=20=E6=B1=9F?= Date: Fri, 1 Aug 2025 15:10:45 +0200 Subject: [PATCH] typst: textwidth aware formatting --- .config/nvim/ftplugin/typst.lua | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.config/nvim/ftplugin/typst.lua b/.config/nvim/ftplugin/typst.lua index 9d1df8fe..07959d82 100644 --- a/.config/nvim/ftplugin/typst.lua +++ b/.config/nvim/ftplugin/typst.lua @@ -6,8 +6,9 @@ local once = require("once") once.test_and_load("ft_typst", function() vim.keymap.set("n", "f", function() + local tw = vim.bo.textwidth local saved = vim.fn.winsaveview() - vim.cmd([[silent exec "%!typstyle -c 100"]]) + vim.cmd('silent exec "%!typstyle -c ' .. tostring(tw) .. ' "') vim.fn.winrestview(saved) end, { desc = "ft(typst): Format with typstyle" })