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, +})