dotfiles/home/.config/nvim/lua/lsp/init.lua

32 lines
1.8 KiB
Lua

-- Neovim has built in support for the language server protocol (LSP). For
-- which reason I decided to utilize it directly instead of relying on plugins
-- such as COC, which reimplement it completely just to support default vim
-- too, since I don't need pure vim support, utilizing this built in support
-- makes a lot more sense and will be faster.
--
-- By default, setting up LSP doesn't technically require any plugins, however
-- I still do use the recommended neovim/nvim-lspconfig plugin, along with
-- williamboman/nvim-lsp-installer, because it makes things a lot easier to get
-- working. The lspconfig holds the default configurations for the individual
-- language servers, avoiding the need of tediously configuring them manually,
-- and the lspinstaller gives us a way to automatically install selected
-- language servers locally for nvim only, which means we won't need to look at
-- the install instructions for each language server and install it user or
-- system wide.
--
-- However, since this configuration shouldn't be plugin dependant, as it is
-- outside of the plugins/ directory and LSP is supported by neovim directly,
-- this folder is here to provide the non-plugin dependant LSP configuration,
-- but I do not manually define the configuration for each language server,
-- since I do actually utilize those plugins, but sturcturing like this still
-- does give space for completely custom configurations written from scratch
-- without relying on any external plugins at all. If you do want to do that,
-- this would be the place to set this up.
--
-- NOTE: With my current configuration, this file is only ran by being required
-- in the lsp plugin config file, if you don't wish to run with plugins, you'll
-- want to require this file from init.lua directly.
require("lsp.keymaps")
require("lsp.autoformat")