nvim/typst: lazyload snippets only once

This commit is contained in:
Primrose 2025-07-28 00:23:28 +02:00
parent b9fae994cb
commit 5f34897169
Signed by: primrose
GPG key ID: 4E887A4CA9714ADA

View file

@ -2,6 +2,9 @@ vim.bo.shiftwidth = 2
vim.bo.tabstop = 2 vim.bo.tabstop = 2
vim.bo.textwidth = 100 vim.bo.textwidth = 100
local once = require("once")
once.test_and_load("ft_typst", function()
vim.keymap.set("n", "<leader>f", function() vim.keymap.set("n", "<leader>f", function()
local saved = vim.fn.winsaveview() local saved = vim.fn.winsaveview()
vim.cmd([[silent exec "%!typstyle -c 100"]]) vim.cmd([[silent exec "%!typstyle -c 100"]])
@ -34,3 +37,4 @@ do
}), }),
}) })
end end
end)