.files/.config/nvim/ftplugin/typst.lua

9 lines
278 B
Lua

vim.bo.shiftwidth = 2
vim.bo.tabstop = 2
vim.bo.textwidth = 100
vim.keymap.set("n", "<leader>f", function()
local saved = vim.fn.winsaveview()
vim.cmd([[silent exec "%!typstyle -c 100"]])
vim.fn.winrestview(saved)
end, { desc = "ft(typst): Format with typstyle" })