From 044dc613c8a30ed7a718d593d950892f0d6cd3da Mon Sep 17 00:00:00 2001 From: "Christoph J. Scherr" Date: Wed, 4 Sep 2024 10:12:12 +0200 Subject: [PATCH] pin typst --- lua/custom/autocmds.lua | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/lua/custom/autocmds.lua b/lua/custom/autocmds.lua index fa72636..0bc6d70 100644 --- a/lua/custom/autocmds.lua +++ b/lua/custom/autocmds.lua @@ -79,3 +79,17 @@ vim.api.nvim_create_autocmd('ColorScheme', { vim.cmd [[highlight Comment gui=NONE]] -- no italics for comments end, }) + +-- pin main.typ for typst projects +vim.api.nvim_create_autocmd('FileType', { + group = augroup, + pattern = { + 'typst', + }, + callback = function() + -- pin the main file + vim.lsp.buf.execute_command { command = 'tinymist.pinMain', arguments = { vim.api.nvim_buf_get_name(0) } } + -- -- unpin the main file + -- vim.lsp.buf.execute_command { command = 'tinymist.pinMain', arguments = { nil } } + end, +})