add(nvim): mason tools

This commit is contained in:
Léana 江 2023-11-12 10:47:39 +01:00 committed by Léana 江
parent ba2a0432f5
commit e36ba1db12
3 changed files with 21 additions and 5 deletions

View file

@ -1,3 +1,5 @@
local map = vim.keymap.set
----------------------
-- Language servers --
----------------------
@ -17,6 +19,7 @@ local servers = {
texlab = {}, -- texlab
tsserver = {}, -- TypeScript
typst_lsp = { exportPdf = "never" },
vimls = {}, -- vim
lua_ls = {
Lua = {
format = {
@ -33,11 +36,20 @@ local servers = {
},
}
------------------
-- Linters, etc --
------------------
-- NOTE: uses mason's package names
local tools = {
"shellcheck", -- bash
"shfmt",
"vint", -- vim script
"commitlint" -- git commit
}
-------------
-- Helpers --
-------------
local map = vim.keymap.set
local on_attach = function(client, bufno)
vim.api.nvim_buf_set_option(bufno, "omnifunc", "v:lua.vim.lsp.omnifunc")
local ts = require "telescope.builtin"
@ -112,13 +124,15 @@ mason_lspconfig.setup_handlers {
function(server_name)
require "lspconfig"[server_name].setup {
capabilities = capabilities,
on_attach = on_attach,
settings = servers[server_name],
filetypes = (servers[server_name] or {}).filetypes,
on_attach = on_attach,
settings = servers[server_name],
filetypes = (servers[server_name] or {}).filetypes,
}
end,
}
require "mason-tool-installer".setup { ensure_installed = tools }
------------------------
-- Standalone plugins --
------------------------