Neovim for Minimalists — Package Manager and Snippets

Configure the package manager plugin and snippets.

alpha2phi

--

Neovim for Minimalists — Package Manager and Snippets

In this article, we will refactor our minimal configuration to use the mason.nvim package manager plugin. Besides LSP completion, we will also configure snippets completion using LuaSnip.

This article is part of the Neovim for Minimalists series.

The Neovim configuration files are available in this repository.

Package Manager using mason.nvim

We configured thenvim-lsp-installer plugin in the previous article. Since this plugin is deprecated, we will refactor our code to use mason.nvim.

In the init.lua file, we remove nvim-lsp-installer and add the lines to install mason.nvim, mason-lspconfig.nvim, and LuaSnip.

In the lua/config/lsp.lua file, we configure mason.nvim, and mason-lspconfig.nvim plugins.

For more advanced configuration, check out this article!

Restart Neovim and the language servers should be installed automatically. Once installed, LSP completion should work.

LSP Completion

Snippets using LuaSnip

By default, the mini.completion module does not support snippets. We have to configure key mappings and auto commands…

--

--

alpha2phi

Software engineer, Data Science and ML practitioner.