From aacc7a510ca31da7e4c7ba75773f9090a4b10ef0 Mon Sep 17 00:00:00 2001 From: gwslingerland Date: Thu, 8 Jan 2026 14:24:17 +0100 Subject: [PATCH] added typst --- ftplugin/typst.lua | 3 +++ init.lua | 31 +++++++++++++++++++++++++++++-- 2 files changed, 32 insertions(+), 2 deletions(-) diff --git a/ftplugin/typst.lua b/ftplugin/typst.lua index 574e0434..26f561c3 100644 --- a/ftplugin/typst.lua +++ b/ftplugin/typst.lua @@ -3,3 +3,6 @@ local opt = vim.opt_local opt.wrap = true opt.linebreak = true opt.textwidth = 0 + +opt.spell = true +opt.spelllang = { 'en_gb' } diff --git a/init.lua b/init.lua index 029b3d75..27b38761 100644 --- a/init.lua +++ b/init.lua @@ -710,7 +710,32 @@ require('lazy').setup({ }, }, }, - tinymist = {}, + + tinymist = { + on_attach = function(client, bufnr) + vim.keymap.set('n', 'tp', function() + client:exec_cmd({ + + title = 'pin', + + command = 'tinymist.pinMain', + + arguments = { vim.api.nvim_buf_get_name(0) }, + }, { bufnr = bufnr }) + end, { desc = '[T]inymist [P]in', noremap = true }) + + vim.keymap.set('n', 'tu', function() + client:exec_cmd({ + + title = 'unpin', + + command = 'tinymist.pinMain', + + arguments = { vim.v.null }, + }, { bufnr = bufnr }) + end, { desc = '[T]inymist [U]npin', noremap = true }) + end, + }, } -- Ensure the servers and tools above are installed @@ -729,6 +754,7 @@ require('lazy').setup({ local ensure_installed = vim.tbl_keys(servers or {}) vim.list_extend(ensure_installed, { 'stylua', -- Used to format Lua code + 'typstyle', }) require('mason-tool-installer').setup { ensure_installed = ensure_installed } @@ -781,6 +807,7 @@ require('lazy').setup({ end, formatters_by_ft = { lua = { 'stylua' }, + typst = { 'typstyle' }, -- Conform can also run multiple formatters sequentially -- python = { "isort", "black" }, -- @@ -941,7 +968,7 @@ require('lazy').setup({ main = 'nvim-treesitter.configs', -- Sets main module to use for opts -- [[ Configure Treesitter ]] See `:help nvim-treesitter` opts = { - ensure_installed = { 'bash', 'c', 'diff', 'html', 'lua', 'luadoc', 'markdown', 'markdown_inline', 'query', 'vim', 'vimdoc' }, + ensure_installed = { 'bash', 'c', 'diff', 'html', 'lua', 'luadoc', 'markdown', 'markdown_inline', 'query', 'vim', 'vimdoc', 'typst' }, -- Autoinstall languages that are not installed auto_install = true, highlight = {