diff --git a/lua/plugins/nvim-lspconfig.lua b/lua/plugins/nvim-lspconfig.lua index 5b84c58ca70eacf0538c9dc48a55525a77fc9d0d..c13aa26244ba97d8f9e5d848f848bba83af45fda 100644 --- a/lua/plugins/nvim-lspconfig.lua +++ b/lua/plugins/nvim-lspconfig.lua @@ -169,9 +169,32 @@ return { -- LSP Configuration & Plugins local servers = { clangd = {}, gopls = {}, - pylsp = {}, + basedpyright = {}, rust_analyzer = {}, marksman = {}, + tinymist = { + on_attach = function(client, bufnr) + client.server_capabilities.documentFormattingProvider = true + + if client.server_capabilities.documentFormattingProvider then + -- Set up an autocommand to format on save + vim.api.nvim_create_autocmd("BufWritePre", { + buffer = bufnr, + callback = function() + vim.lsp.buf.format({ async = false }) -- Synchronous formatting + end, + }) + end + end, + capabilities = require('cmp_nvim_lsp').default_capabilities(vim.lsp.protocol.make_client_capabilities()), + -- offset_encoding = "utf-8", + settings = { + exportPdf = "onSave", + outputPath = "$root/target/$dir/$name", + formatterMode = "typstfmt", + formatterPrintWidth = 80, + } + }, -- ... etc. See `:help lspconfig-all` for a list of all the pre-configured LSPs -- -- Some languages (like typescript) have entire language plugins that can be useful: @@ -209,14 +232,20 @@ return { -- LSP Configuration & Plugins -- for you, so that they are available from within Neovim. local ensure_installed = vim.tbl_keys(servers or {}) vim.list_extend(ensure_installed, { + 'bashls', 'clangd', + 'docker_compose_language_service', + 'dockerls', 'gopls', + 'intelephense', 'lua_ls', 'marksman', - 'pylsp', - 'rust-analyzer', + 'basedpyright', + 'rust_analyzer', + 'stylua', + 'tinymist', + 'ts_ls', 'zls', - 'stylua', -- Used to format Lua code }) require('mason-tool-installer').setup { ensure_installed = ensure_installed }