mirror of
https://codeberg.org/leana8959/.files.git
synced 2025-12-06 06:39:14 +00:00
nvim/typst: lazyload snippets only once
This commit is contained in:
parent
b9fae994cb
commit
5f34897169
1 changed files with 34 additions and 30 deletions
|
|
@ -2,13 +2,16 @@ vim.bo.shiftwidth = 2
|
||||||
vim.bo.tabstop = 2
|
vim.bo.tabstop = 2
|
||||||
vim.bo.textwidth = 100
|
vim.bo.textwidth = 100
|
||||||
|
|
||||||
vim.keymap.set("n", "<leader>f", function()
|
local once = require("once")
|
||||||
|
|
||||||
|
once.test_and_load("ft_typst", 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"]])
|
||||||
vim.fn.winrestview(saved)
|
vim.fn.winrestview(saved)
|
||||||
end, { desc = "ft(typst): Format with typstyle" })
|
end, { desc = "ft(typst): Format with typstyle" })
|
||||||
|
|
||||||
do
|
do
|
||||||
local luasnip = require("luasnip")
|
local luasnip = require("luasnip")
|
||||||
local s = luasnip.snippet
|
local s = luasnip.snippet
|
||||||
local t = luasnip.text_node
|
local t = luasnip.text_node
|
||||||
|
|
@ -33,4 +36,5 @@ do
|
||||||
cr(),
|
cr(),
|
||||||
}),
|
}),
|
||||||
})
|
})
|
||||||
end
|
end
|
||||||
|
end)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue