mirror of
https://codeberg.org/leana8959/.files.git
synced 2025-12-06 06:39:14 +00:00
typst: textwidth aware formatting
This commit is contained in:
parent
4cc165fd7f
commit
8c729cea42
1 changed files with 2 additions and 1 deletions
|
|
@ -6,8 +6,9 @@ local once = require("once")
|
|||
|
||||
once.test_and_load("ft_typst", function()
|
||||
vim.keymap.set("n", "<leader>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" })
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue