From e436a4e493912af9ff2e337ddbcfed033c5a5bbe Mon Sep 17 00:00:00 2001 From: Jan Hensel <ja_he@uni-bremen.de> Date: Wed, 19 Jun 2024 19:24:30 +0200 Subject: [PATCH] nvim: Replace typst-lsp with tinymist (including mason now) --- .config/nvim/lua/plugins.lua | 8 +++++++ .config/nvim/lua/ztf/lsp.lua | 43 ++++++++++++++++++++++-------------- 2 files changed, 35 insertions(+), 16 deletions(-) diff --git a/.config/nvim/lua/plugins.lua b/.config/nvim/lua/plugins.lua index 3e1afab..d7c1b3e 100644 --- a/.config/nvim/lua/plugins.lua +++ b/.config/nvim/lua/plugins.lua @@ -39,6 +39,14 @@ local plugins = { config = function() require("ztf.configure.dapui") end, dependencies = { "mfussenegger/nvim-dap" }, }, + { + "williamboman/mason.nvim", + opts = { + ensure_installed = { + "tinymist", + }, + }, + }, -- rust { 'simrat39/rust-tools.nvim', diff --git a/.config/nvim/lua/ztf/lsp.lua b/.config/nvim/lua/ztf/lsp.lua index 9f77063..b335c1c 100644 --- a/.config/nvim/lua/ztf/lsp.lua +++ b/.config/nvim/lua/ztf/lsp.lua @@ -14,22 +14,33 @@ local configs = require 'lspconfig.configs' lspconfig.gopls.setup {} -lspconfig.typst_lsp.setup{ - root_dir = function(path) - local strip_dir_pat = '/([^/]+)$' - local strip_sep_pat = '/$' - if not path or #path == 0 then - return - end - local result = path:gsub(strip_sep_pat, ''):gsub(strip_dir_pat, '') - if #result == 0 then - if vim.loop.os_uname().version:match 'Windows' then - return path:sub(1, 2):upper() - else - return '/' - end - end - return result +-- lspconfig.typst_lsp.setup { +-- root_dir = function(path) +-- local strip_dir_pat = '/([^/]+)$' +-- local strip_sep_pat = '/$' +-- if not path or #path == 0 then +-- return +-- end +-- local result = path:gsub(strip_sep_pat, ''):gsub(strip_dir_pat, '') +-- if #result == 0 then +-- if vim.loop.os_uname().version:match 'Windows' then +-- return path:sub(1, 2):upper() +-- else +-- return '/' +-- end +-- end +-- return result +-- end, +-- } + +-- tinymist is an LS for typst +lspconfig.tinymist.setup { + settings = { + exportPdf = "onType", + outputPath = "$dir/live/$name", + }, + root_dir = function(fname) + return lspconfig.util.path.dirname(fname) end, } lspconfig.vimls.setup {} -- GitLab