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" })