.files/.config/nvim/ftplugin/typst.lua
Léana 江 c8e4bcc675
nvim: refactor luasnip as plugin
luasnip works better as a plugin and not a ftplugin
2025-08-09 09:00:25 +02:00

10 lines
328 B
Lua

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