Commit Graph

692 Commits

Author SHA1 Message Date
Dionisio E Alonso 8f7134b3bb feat(Neovim/Vim): Add context plugins for both editors
Added context plugins that keep block-starting lines at the top of the
editing window, to have some context of where is located the code one is
editing.
2024-04-16 16:05:57 -03:00
Dionisio E Alonso a7a7066fe0
feat(Neovim/Vim): Tune statusline a little bit
Removed the first-line a warning/error occurs, info from the status-line
for both, Neovim's LSP server and Vim's CoC.  That information can be
obtained when going through the quickfix list of diagnostics, instead of
seeing only the first and then the second, if the first gets fixed.

Also, as a bonus, enabled the global-status-line setting in Neovim.
2024-04-16 14:25:05 -03:00
Dionisio E Alonso b45ed9b96b feat(LSP): Add some keymaps to LSP functionality
Added keymaps for the *code-formatting* and *inlay-hints toggle*
functionalities provided by some LSP servers.
2024-04-16 11:30:02 -03:00
Dionisio E Alonso 71bd1fc4f0 feat: Prioritize symbols font in fontconfig
If using the Symbols Only version of the NerdFonts, prioritize that
fontface in order for it's glyphs to appear prior other fonts using the
same codes.

This patch still relies on an unpatched fontface for monospaced fonts,
but adds immediately, as a second option, the fontface of symbols from
NerdFont.
2024-04-16 08:55:25 -03:00
Dionisio E Alonso fd78a1fc25 feat(treesitter): Add Tree-sitter plugin for navigating source
Some movements, selection, etc. from Vim, usually don't work properly
when trying to detect the start/end of functions/classes scope and other
languages symbols when, for instance, language blocks are not
curly-bracket-based.

This Tree-sitter plugin aims to solve those issues using the AST of the
source file.
2024-04-10 22:36:52 -03:00
Dionisio E Alonso 465dfb7080 feat(vim-airline): Change icon shown for UNIX file format
Although it is nice to see the corresponding GNU/Linux distro logo in
the status bar; there is no relation between Debian, Fedora, Arch, etc,
and the file having UNIX line endings.

This patch anonymizes that by making the status bar show just a Tux then
the file has UNIX line-ending terminations.
2024-04-10 21:57:37 -03:00
Dionisio E Alonso 4d95556967 refactor(Neovim/Vim): Adapt settings according to docs
Used docs recommendations for concatenating strings in Neovim and Vim
settings.
2024-04-04 23:10:35 -03:00
Dionisio E Alonso 4da012f342 feat(Vim): Group all Neovim's defaults in a separate module
Put together all the defaults brought from Neovim, in a separate runtime
file in Vim's config dir.
2024-04-04 23:07:56 -03:00
Dionisio E Alonso e3979594cb feat(Vim): Add nice default for number of tabs 2024-04-04 15:27:33 -03:00
Dionisio E Alonso ac555813a9 fix(Neovim/Vim): Correct airline mapping of modes 2024-04-04 12:45:18 -03:00
Dionisio E Alonso 6dcaeacfd3 docs(Neovim/Vim): Add disclaimer for differences among settings 2024-04-04 12:41:45 -03:00
Dionisio E Alonso 10255c0b55 feat(vim-plugins): Replace deprecated plugin
Vim's plugin auto-pairs has been unmaintained for several years now.  A
new project has risen as a fork of the original one.

This patch uses the new fork and sets some defaults existing in the
previous plugin.
2024-04-03 21:43:23 -03:00
Dionisio E Alonso 22a64f89f9 feat(vim-plugins): Delete unmaintained plugin for (Neo)Vim
indentLine has had support dropped since mid-2023.  There is no
replacement that works on both Neovim and Vim; but almost the same
behavior can be achieved with `listchars` and some autocmd magic.

So the plugin is getting removed as dependency from this repo.
2024-04-03 15:36:26 -03:00
Dionisio E Alonso e839064e12 feat(vim-plugins): Move some behavior away from plugins
indentLine is archived since last year and with that, there are no
further updates.  But the project's GitHub states that the same behavior
can be achieved with Vim's listchars, so this patch does that.
2024-04-03 15:22:53 -03:00
Dionisio E Alonso 3b4ddd41ba fix(treesitter): Correct query override for Python classes
The override in place for Python classes highlighting wasn't having
effect.  The issue is that now user queries need to explicitly extend,
with the keyword `;extend` the scheme rules they are overriding.
2024-03-20 22:53:57 -03:00
Dionisio E Alonso e93b853fa9 Merge branch 'pylsp-settings' 2024-03-02 18:12:30 -03:00
Dionisio E Alonso b15b9178c6 feat(LSP): Modify the way a virtual env is located
Changed the hard-coded virtual environment directory name used to look
for Python related binaries to whatever directory is defined in the
`VIRTUAL_ENV` environment variable.  That variable's value is more
reliable, even more when Python virtual environments are located in a
central location, not near the repository.
2024-03-02 17:29:42 -03:00
Dionisio E Alonso 8d626d2188 feat(LSP): Refactor alternative executables for linters
Test for new executables, for different checkers, for Python LSP only if
the virtual environment directory has been found.

The previous behavior could have found executables for such linters on
different places, as they could have been appearing outside a virtual
environment directory (if the `venv_dir` variable tested as an empty
string).  Such behavior could lead to undefined behaviors.
2024-03-02 17:17:53 -03:00
Dionisio E Alonso 8418e53327 feat(LSP): Change default python executable
On most Linux distros python3 is the default, even more, there is no
Python version 2 to be installed anyways, hence there is no need to
distinguish which python version to load anymore.

The default python executable has come to be `python` even though the
Python version is 3.x.  Furthermore, on all virtual environments
`python` exists and is linked to point to a Python 3.x executable.
2024-03-02 17:00:09 -03:00
Dionisio E Alonso fe8b7b0238 feat(LSP): Delete unnecessary settings
Third-party installed plugins are enabled by default, hence there is no
need to explicitly enable it.

Ruff plugin doesn't come with standard PyLSP, and is one (along with
pylsp-mypy) of the manually added plugins.
2024-02-26 12:43:53 -03:00
Dionisio E Alonso bd435b7730 feat(template): Make pre-commit hooks read configs from config files
When possible, for pre-commit hooks, instead of receiving arguments via
command line, make them read their config from a configuration file to
achieve the same behavior as invoking the corresponding tool outside
pre-commit.
2024-02-26 11:32:51 -03:00
Dionisio E Alonso 5d6c98a528 feat(templates): Reorganise some hook's arguments
Some of the arguments in the pip-tools hook were for an older version of
the hook, which didn't work with pyproject.toml files.

Since Python 3.6 is long deprecated now, the template is being bumped at
least to the 3.7 version.
2024-02-26 11:22:07 -03:00
Dionisio E Alonso 695f0977d6 feat(templates): Add new python hook for pre-commit
For the pre-commit-config.yaml added the Ruff hook and, as Ruff is being
configured via TOML file instead of inline command line arguments, also
added the toml checker.
2024-02-26 11:18:36 -03:00
Dionisio E Alonso a22d0b22d1 Merge branch 'pylsp-settings' 2024-02-26 11:11:06 -03:00
Dionisio E Alonso d89fbb2f40 feat(LSP): Reorganise PyLSP blocks of code
Although the block of code moved is programmatic configuration taking
place before the actual on/off of settings (which could be interpreted
as metadata config), the block of code in question had nothing to do
with the setting of other LSPs than PyLSP.

The whole block is for pre-installing plugins for PyLSP server, or its
plugins'.
2024-02-26 10:00:09 -03:00
Dionisio E Alonso 41115cdd19 feat(LSP): Override pretty flag for Mypy
As the `--pretty` flat for Mypy provides nicer output, the soft word
wrap it uses makes editors receive part of the message.  Hence the
setting has to be overridden inside editors (the flag is kept on
because invoking Mypy from terminal benefits from the extra output
information).
2024-02-25 23:00:39 -03:00
Dionisio E Alonso 1493b3ceb5 feat(LSP): Move some comments between config files
Some Pylint settings that are more probable to occur on medium-big
projects were move to the pyproject.toml template, in order to have it
near when a new project is started.

On the other hand, those checks were never going to be on for regular
Python programming.
2024-02-24 20:37:50 -03:00
Dionisio E Alonso 85838e4521 feat(LSP): Delete unnecessary line in configs
The deleted line was already commented out.  There is no need for the
line anyways as the mccabe plugin comes already disabled by default.

Furthermore the option is a duplication, enabling the plugin and setting
a value to the `threshold` has the same effect as setting the
`maxComplexity` value on Flake8's plugin.

The only distinction is McCabe came, when enabled, with a default preset
value of 15 for `threshold`, which Flake8 hasn't for `maxComplexity`.
2024-02-24 14:03:39 -03:00
Dionisio E Alonso 773acf8ec4 feat(LSP): Correct Ruff config section to mimic covered linters
In order to make Ruff report, the best way possible, mimicking the
reports provided by both Flake8 and Pylint, disable some of the checks
that the latter linters don't have turned on by default.
2024-02-23 17:59:03 -03:00
Dionisio E Alonso 11a1962f09 feat(LSP): Correct Pylint's configuration indentation
Unify Pylint's config indentation like any other TOML file in this repo.
2024-02-23 17:51:36 -03:00
Dionisio E Alonso 4dfdba8ac7 feat(LSP): Bump configuration for Ruff
With latest Ruff version, some of the settings in the configuration
files were relocated.  This patch corrects those category names.
2024-02-23 17:42:29 -03:00
Dionisio E Alonso a1dbef0b64 feat(LSP): Copy behavior for Mypy on pyproject
The results achieved in the Mypy config files, translate them to the
pyproject.toml in order to have the very same behavior.
2024-02-23 17:39:06 -03:00
Dionisio E Alonso e139152080 Merge branch 'pylsp-settings' 2024-02-06 09:02:46 -03:00
Dionisio E Alonso b887f0b9ae feat(LSP): Add nice pretty output for Mypy 2024-02-06 09:02:19 -03:00
Dionisio E Alonso 7dfa03eb73 feat(LSP): Delete default flag from config
The flag being deleted already has its default value set to what was on
the configuration file.  Having the configuration was redundant.
2024-02-06 09:02:03 -03:00
Dionisio E Alonso 52cd15c96d feat(emacs): Upgrade package initialization syntax
Previously used syntax for adding Melpa's repository to Emacs was taken
from Melpa's site itself.  But some of those commands have become
standard Emacs that load on Emacs startup.  This changes are to make use
of newer techniques for incorporating 3rd party repos into Emacs.
2024-02-06 08:12:08 -03:00
Dionisio E Alonso f248c257bd fix(LSP): Correct pylsp configuration syntax
Eglot's configuration for LSP servers does not have a “false” literal in
Lisp.  Furthermore, the previously used `nil` value was being mapped to
JSON's `null` value instead of `false`; making the LSP server to load
defaults for those settings instead of setting those settings to false.
2024-02-06 08:08:24 -03:00
Dionisio E Alonso 6b5452f9d1 feat(LSP): Add pylint executable explicitly
Without telling python-lsp-server which the pylint executable is,
explicitly, the plugin never runs.  This modification ensures the plugin
is running.
2024-02-06 08:06:18 -03:00
Dionisio E Alonso aeaf9bc692 Merge branch 'pylsp-settings' 2024-02-04 18:36:39 -03:00
Dionisio E Alonso 54938dd02c feat(LSP): Add PyLSP configurations for eglot
Replicate the same base configuration used for python-lsp-server in
Neovim but for Emacs's Eglot LSP client.
2024-02-04 18:33:28 -03:00
Dionisio E Alonso af5a35e874 Merge branch 'emacs-refactor' into pylsp-settings 2024-02-04 18:28:04 -03:00
Dionisio E Alonso 6d2951b2b1 feat(LSP): Amend documentation
This is a minimal correction on the comments documenting the use of the
file.
2024-02-04 18:26:15 -03:00
Dionisio E Alonso 00a57f889c feat(mypy): Change configuration format
Changed mypy configuration INI format.  Python's configparser checks
boolean values in a case-insensitive manner, so it doesn't matter if
values start in Title-case or lower-case.  This way, the configuration
is easily translated to TOML format for writing a pyproject.toml file;
with the exception of string values which will have to be enclosed in
quotes anyways.
2024-02-04 18:20:09 -03:00
Dionisio E Alonso b3ff8ceca0 Merge branch 'emacs-refactor' 2024-02-03 20:32:37 -03:00
Dionisio E Alonso e5a65b3ea9 feat(emacs): Add some LSP functionality to Emacs
This feature requires for LSP servers to be already installed, and the
PATH variable to point to where the executables reside.
2024-02-03 20:30:16 -03:00
Dionisio E Alonso 13920d3841 feat(emacs): Delete unused option for typeface 2024-02-03 20:20:43 -03:00
Dionisio E Alonso 4ef1f32186 feat(emacs): Setup some packages for emacs
Similar to a plugin manager, Emacs has Elpa and Melpa repos.  Here,
Melpa repository is being added and then some packages (themes and
languages' modes) provided by that repo.
2024-02-03 20:17:30 -03:00
Dionisio E Alonso 7f3a8deede Merge branch 'emacs-refactor' 2024-02-03 15:40:51 -03:00
Dionisio E Alonso 584deb9575 feat(emacs): Remember last cursor position per file 2024-02-03 15:11:14 -03:00
Dionisio E Alonso a272a609a3 feat(emacs): Split lines in setting for readability 2024-02-03 15:08:07 -03:00