As this module is the main entry point of all the LSP servers
configurations, it makes sense to rename it as init.lua and place it
under the directory grouping all the LSP related modules.
To give less sensation that only the settings key is configured within,
as some servers only accept parameters via the `cmd` key, for instance,
the file has now a more general name.
The remaining file for setting up Neovim as an LSP client, that was
still as vim-script, was already invoking all Lua functionality embedded
as a here-doc in vim-scrip.
It made more sense to finally migrate that one file, and call `lua require`
instead of `runtime!` when invoking inside `init.vim`.
Instead of adding some hook that secretly changes the command line for
the LSP server underneath, achieve the same behaviour but passing
options on server initialization.
Around an year ago, the capabilities for the `nvim-cmp` plugin have been
updated and there is a new default in Neovim. This change uses that new
default according to documentation from `nvim-cmp` plugin.
Added LSP servers' configurations for Rust and Haskell. Both languages
have been recurrently used and there is no reason not to include them in
default settings.
Now that code looks cleaner and there are less things going around, made
the different LSPs servers setups explicit. With this change there is a
clear picture of which LSP requires extra/custom options and which
don't.
Setting the completeopt option when initializing nvim-cmp is no longer a
standard recommendation from their docs. Since nvim-cmp has its own
completion menu, and as long as that menu is used instead of
`<C-x><C-o>` to launch the native ins-completion menu, there is no need
to change the default behavior of the option.
This was discussed here:
https://github.com/hrsh7th/nvim-cmp/discussions/941https://github.com/hrsh7th/nvim-cmp/pull/1442
This setting corresponds to setup need specifically by the nvim-cmp
plugin for working as a source within Neovim's ins-completion
(https://neovim.io/doc/user/insert.html#ins-completion) but otherwise
not needed to be set to something different than its default.
For local imports of modules, move the corresponding definitions into
module's scope, instead of restricting their declaration to the
function/s where they are later used.
With this change, one same import can be reused in different parts of
the module.
As this auto-command is meant to configure how nvim-cmp provides
completions for the specific gitcommit file type, those settings belong
to the completions Lua module.
The lspkind settings only apply to the completion menu, then, it makes a
lot more sense to have those settings in the same auto-command as the
rest of settings related to completion, specially because all those
settings are related to the same plugins family (nvim-cmp).
With this replacement, same as for keymaps, now, the on_attach argument
on LSP servers setup can be completely avoided. This change ends up
simplifying the LSP-server setup step making it more general.
Instead of calling the function that sets all the custom keymaps at the
end of the custom `on_attach` function, directly add the function as a
hook to the LspAttach event.
With this change more modularization is possible, being able to move all
the keymaps settings to other parts of the config files.
Added a default separation of 4 (instead of the previous 2 for 1366×720)
between windows when in tiled positions. After that default separation,
distances had to bee adjusted a little bit.
Instead of relying on constantly keeping up to date the list of ensured
installed parsers, auto-install them as long as they are being needed by
the editor (when a buffer of a new filetype is opened).