Commit Graph

692 Commits

Author SHA1 Message Date
Dionisio E Alonso 724587d5e5 feat(Vim): Add some LSP servers to CoC
Also reordered the configuration a little bit.
2024-01-22 15:29:37 -03:00
Dionisio E Alonso 6955551138 feat(Neovim): Update font and window sizes
Updated the font and window sizes used in a 15inches 1080p display
resolution.
2024-01-22 11:53:13 -03:00
Dionisio E Alonso b183c9027c feat(Neovim): Update a keybinding to use current API function
The function called in the keybinding is being deprecated.  But there
has been suggested a new function, that is being used now.
2024-01-21 18:47:09 -03:00
Dionisio E Alonso 2a8118e694 feat(Neovim/Vim): Update default indentation rules
Stopped enforcing a different indentation size for C files, it now uses
the same 4 character width as for other filetypes.

Also, instead of hardcoding the value of softtabstop to the same value
as shiftwidth, set it to a negative value; which makes it behave exactly
like that, according to documentation.
2024-01-20 12:07:14 -03:00
Dionisio E Alonso 66c4be90c7 feat(Neovim): Correct defaults for restore-cursor
When restoring the cursor to last file's position, there was an
inconsistency between Neovim and Vim for commit files.  That was because
Neovim's defaults didn't properly detect the filetype in such cases.
The current patch corrects that with a recipe copied from Neovim's help
docs.
2024-01-20 11:57:55 -03:00
Dionisio E Alonso 19df5c58a7 Merge branch 'refactor-lua-configs' into HEAD 2024-01-20 11:53:29 -03:00
Dionisio E Alonso 035e74b485 feat(LSP): Normalize configs between Neovim and Vim
Rename the LSP module in Vim to mimic naming used in Neovim's great
refactor.
2024-01-20 11:40:53 -03:00
Dionisio E Alonso 6288f4c3c4 Merge branch 'pylsp-settings' 2024-01-17 17:41:26 -03:00
Dionisio E Alonso 7c711a5f33 feat(LSP): Correct some sections in pylintrc file 2024-01-17 17:36:39 -03:00
Dionisio E Alonso 8fbfbd37cf feat(LSP): Install flake8 plugins when installing PyLSP
Added a hook to also install some flake8 plugins immediately after Mason
successfully installs the python-lsp-server.  This step saves some
after-installation setup.

Also, set some new defaults to Ruff linter.  This new defaults have the
intention to mimic just the behavior in Flake8 and Pylint, as long as
Ruff implements the missing error codes.
2024-01-17 17:35:55 -03:00
Dionisio E Alonso 293a907b2a feat(LSP): Move comments for setting up Pylint
Instead of having codes commented out in the LSP configuration file, as
all specific settings of the linters are being moved into the
corresponding configuration file, move all the accompanying comments as
well.

The moved commented-out settings are there as a reference, but now it
makes more sense to preserve that reference in the correct configuration
file.
2024-01-10 23:15:59 -03:00
Dionisio E Alonso 5fa39e888f feat(LSP): Move comments for setting up Flake8
Instead of having codes commented out in the LSP configuration file, as
all specific settings of the linters are being moved into the
corresponding configuration file, move all the accompanying comments as
well.

The moved commented out settings are there as a reference, but now it
makes more sense to preserve that reference in the correct configuration
file.
2024-01-10 22:56:53 -03:00
Dionisio E Alonso 3f37701e0e feat(LSP): Add mypy configs into dotfiles 2024-01-10 21:12:24 -03:00
Dionisio E Alonso a62af9725c feat(LSP): Add some defaults to Ruff
To start with some Ruff checks similar to what other linters would
check, added these defaults to the toml config file.
2024-01-10 15:10:52 -03:00
Dionisio E Alonso 0a378dbc3d feat(LSP): Use the same approach as with Flake8 for Pylint
Moved configurations from the LSP setup to more general configuration
files, such as user's config or project's config files.
2024-01-10 13:52:45 -03:00
Dionisio E Alonso 97954c8aca feat(LSP): Remove maxLineLength setting from LSP configuration
Flake8 can read its settings from various sources (user's config files,
project's config files, pyproject.toml with a plugin).  Having this
setting in the LSP setup overrides many of those other sources (mainly
when Flake8-pyproject is used).

Another advantages of this approach is that having Flake8's settings in
its own files, other editors can benefit from the same settings, no
extra configuration required; and setting the LSP server becomes
simpler.
2024-01-10 12:55:44 -03:00
Dionisio E Alonso 3bcf9552f2 feat(LSP): Delete unused setting for PyLSP
There is no need to have pycodestyle as a configuration source since its
been disabled, as all the checks are covered by Flake8.

Instead, having Flake8's as a configuration source only, makes more
sense either having those settings read from the user's config files or
from the project's one.
2024-01-10 12:51:50 -03:00
Dionisio E Alonso 78f6b9b423 feat(LSP): Generalise some path creation for pylsp plugins
Instead of having the pylsp plugins command hard-coded, compute it from
Neovim standard installation paths.  Also enabled Ruff plugin as default
linter for pylsp
2024-01-07 17:23:15 -03:00
Dionisio E Alonso ceab39a86c feat(LSP): Add a hook on pylsp install for plugins
Instead of manually running PylspInstall to have some pyslp plugins
installed, install them via configuration on successfully installation
of the LSP server.
2024-01-07 16:21:23 -03:00
Dionisio E Alonso 61993b21c9 Merge branch 'refactor-lua-configs' 2024-01-06 18:10:19 -03:00
Dionisio E Alonso b2a699cc02 feat(LSP): Move all server settings file into same directory
Group all the files corresponding to servers' specific settings, to the
same directory.
2024-01-06 17:40:29 -03:00
Dionisio E Alonso 37da48aaf5 feat(LSP): Rename the servers' configurations entry point
Put the main entry point for different servers' customizations into its
own module to group all the servers' related files under the same scope.
2024-01-06 16:05:56 -03:00
Dionisio E Alonso b87d50b6a9 feat(LSP): Rename the main LSP configuration module
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.
2024-01-06 15:21:07 -03:00
Dionisio E Alonso 3f0f6f9f85 feat(LSP): Restore sub-modules call to lsp_client_settings
This is an intermediate step, those calls were OK there beforehand.
2024-01-06 13:14:11 -03:00
Dionisio E Alonso d201a98346 feat(LSP): Rename workpace configs file
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.
2024-01-05 21:52:02 -03:00
Dionisio E Alonso a41548bc0b feat(LSP): Correct module for fortls LSP
Now that the fortls configuration is by options, the previous module
name has no sense for current contents of the file.
2024-01-05 19:41:13 -03:00
Dionisio E Alonso 3016873438 feat(TreeSitter): Migrate tree-sitter settings file to Lua
Exactly the same modifications as in previous commit for the Neovim
native LSP client configuration, but this time with the tree-sitter
module.
2024-01-05 19:38:55 -03:00
Dionisio E Alonso d38abb38a7 feat(LSP): Migrate remaining LSP related files to Lua
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`.
2024-01-05 19:26:33 -03:00
Dionisio E Alonso 10762c34c8 feat(LSP): Move all LSP sub-modules into LSP initialization 2024-01-05 19:19:15 -03:00
Dionisio E Alonso d256e4ccc6 feat(LSP): Refactor repeated statements
Instead of defining the same table (capabilities) for each configured
server, save that value in a variable and use the variable later on.
2024-01-05 19:17:15 -03:00
Dionisio E Alonso fd9a401c09 feat(LSP): Set fortls options explicitly
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.
2024-01-05 19:08:48 -03:00
Dionisio E Alonso b527a82099 Merge branch 'master' into refactor-lua-configs 2024-01-05 17:47:04 -03:00
Dionisio E Alonso 96731b1e3d feat(LSP): Add first attempt to support inlayHints 2024-01-05 17:45:30 -03:00
Dionisio E Alonso 052565cba4 fix(LSP): Update capabilities usage according to docs
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.
2024-01-05 16:07:35 -03:00
Dionisio E Alonso 538afba5d4 feat(LSP): Correct comments in LSP config example
There is no need, with current configuration, to use a custom
`on_attach` function on LSP setup.  Hence, this has been removed from
the comments.
2024-01-05 15:23:22 -03:00
Dionisio E Alonso d89024cbd6 feat(LSP): Add some optional server's settings
This LSP server is not usually used, but configuration is not trivial
and this configs serve as reference.
2024-01-05 15:05:38 -03:00
Dionisio E Alonso 53c0b334d5 feat(LSP): Add LSP servers for some new languages
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.
2024-01-05 14:52:15 -03:00
Dionisio E Alonso b9eed1129e Merge branch 'refactor-lua-configs' 2024-01-04 20:09:46 -03:00
Dionisio E Alonso d89dbf5458 feat(LSP): Final part of the refactor. Explicit call of LSPs
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.
2024-01-04 17:01:58 -03:00
Dionisio E Alonso 8ca87ed93d feat(LSP): Change scope in variable definition 2024-01-04 09:49:48 -03:00
Dionisio E Alonso b34e086af0 feat(nvim-cmp): Delete setting for completeopt
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/941
https://github.com/hrsh7th/nvim-cmp/pull/1442
2024-01-04 09:40:24 -03:00
Dionisio E Alonso 2d6fe48209 feat(LSP): Move completeopt setting into completion module
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.
2024-01-04 09:38:08 -03:00
Dionisio E Alonso b220ce5b78 feat(LSP): Move declarations to module scope
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.
2024-01-04 07:59:58 -03:00
Dionisio E Alonso d377565fae feat(LSP): Regroup modules and settings in Vim's module
Keeping the same semantics, reordered all the module loading inside the
Neovim's LSP client configuration module.
2024-01-04 07:39:52 -03:00
Dionisio E Alonso 9f9363fefb feat(LSP): Move Git completion autocmd into completion 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.
2024-01-04 07:31:25 -03:00
Dionisio E Alonso ff05144002 feat(LSP): Move LSP completion settings into its own module 2024-01-04 07:29:31 -03:00
Dionisio E Alonso d719941ac0 feat(LSP): Move lspkind settings into completion autocommand
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).
2024-01-04 07:18:03 -03:00
Dionisio E Alonso 3ffe14de35 feat(LSP): Move diagnostics signs into diagnostics module 2024-01-03 21:17:00 -03:00
Dionisio E Alonso ce1200c4fe feat(LSP): Move LSP diagnostics settings into its own module 2024-01-02 19:39:25 -03:00
Dionisio E Alonso 7cd667c4d8 feat(LSP): Move LSP keymaps into its own module 2024-01-02 19:38:02 -03:00