5
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

neovim mason-lspconfigの自動インストールと有効化(setup_handlers)

Posted at

概要

いちいちlspを:MasonInstallするのは面倒です。
そのため、自動インストールと設定の有効化をします。

mason-config.luaの設定

mason-config.luaで設定をしました。ファイル名は好きに変えてください。

mason-config.lua
require("mason").setup()
require("mason-lspconfig").setup {
	ensure_installed = {
			"lua_ls",
			"bashls",
			"clangd",
			"cmake",
			"cssls",
			"dockerls",
			"docker_compose_language_service",
			"gopls",
			"html",
			"jsonls",
			"tsserver",
			"marksman",
			"nimls",
			"pylsp",
	}
}

-- auto lspconfig setting
require('mason-lspconfig').setup_handlers {
  function(server_name)
    require('lspconfig')[server_name].setup {}
  end,
}

init.lua
require('mason-config')

参考

こちら素晴らしい記事です。

:h mason-lspconfig.setup_handlers()

5
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
5
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?