Compare commits

...

148 Commits

Author SHA1 Message Date
Dionisio E Alonso e1a17b02aa feat(Neovim): Bump sub-modules' versions upon new release
Neovim's 0.10.0 has been released.  Because of that, all sub-modules are
being bumped to their current version and saved as the starting version
point for the current sable release.
2024-05-17 12:23:36 -03:00
Dionisio E Alonso 43a256a488 Merge branch 'vscodium-upgrades' 2024-05-14 17:13:54 -03:00
Dionisio E Alonso a914ead1d8 feat(VSCodium): Add default Rust checker 2024-05-14 17:13:11 -03:00
Dionisio E Alonso 73a5104004 refactor(VSCodium): Minor changes in settings order 2024-05-14 17:10:27 -03:00
Dionisio E Alonso 34d3aa67be feat(VSCodium): Add some settings to user's file
Added the default container app as Podman instead of the default Docker;
and added the shortcut option to disable inlayHints.
2024-05-14 09:54:10 -03:00
Dionisio E Alonso c7da3fb632 feat(VSCodium): Add some defaults for Haskell 2024-05-09 14:57:39 -03:00
Dionisio E Alonso f031db10b9 feat(VSCodium): Reorder some settings
Minor refactoring in settings.  Also removed settings that were already
set to their default.

The `window.commandCenter` default is `true` when the custom title bar
is enabled.
2024-05-08 19:55:32 -03:00
Dionisio E Alonso 93e11c29d3 feat(VSCodium): Remove unused settings
This repository no longer uses an Atom syntax highlighting, instead the
default Dark+ is used for all editors (Vim/Neovim included); so there is
no need for that setting anymore.

The other unused setting is the toggle of the menu-bar, that is really
unnecessary now, in terms of vertical spaced wasted/gained when using
the custom title-bar setting.  It is a cleaner view to have it with
“toggle”, but is minimal.
2024-05-08 19:55:32 -03:00
Dionisio E Alonso 3864103606 feat(VSCodium): Update deprecated settings for Python
Some Python settings were part of the Text Editor's core settings, such
as the several Python linters.

The new approach from the editor is to move out all those
functionalities as extensions, and as such, many settings had their keys
changed, or completely removed if, for instance, it was only an “enable”
setting and now that is assumed when the extension is installed
explicitly.

The documentation about this migration is here:
https://github.com/microsoft/vscode-python/wiki/Migration-to-Python-Tools-Extensions
2024-05-08 19:53:13 -03:00
Dionisio E Alonso a45589b8b7 feat(VSCodium): Update font sizes for 1080p screens 2024-05-08 16:57:59 -03:00
Dionisio E Alonso 46c0ed311a feat(LSP): Correct API change in inlayHints 2024-04-19 12:16:35 -03:00
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
Dionisio E Alonso 881a3b70ce feat(emacs): Move font attributes outside custom-set-font
As with previous change, the custom-set-font interface reorders stuff
it's own way.  Moving this settings outside that scope makes the
settings stay put.
2024-02-03 15:08:07 -03:00
Dionisio E Alonso 7a260bf0da feat(emacs): Move settings outside customize
Emacs customization interface has it's own way to sort settings out.
With this change, the same settings' effects are achieved manually
without having to rely on the internal sorting the customize interface
intends.
2024-02-03 15:03:17 -03:00
Dionisio E Alonso cd10517361 Merge branch 'pylsp-settings' 2024-01-31 00:24:49 -03:00
Dionisio E Alonso 848d6377f1 feat(mypy): Change configuration format
Changed mypy configuration file format from INI to TOML.  It works all
the same and in this way there are more similarities with the format
inside pyproject.toml file.
2024-01-31 00:22:20 -03:00
Dionisio E Alonso 07b3b2a6df Merge branch 'master' into pylsp-settings 2024-01-31 00:21:38 -03:00
Dionisio E Alonso 1ca997c674 feat(mypy): Reorder some options in preference order 2024-01-31 00:20:04 -03:00
Dionisio E Alonso 9a003190ed feat(Vim): Turn off folding display by default 2024-01-29 05:47:24 -03:00
Dionisio E Alonso ea03e3300a feat(Neovim): Correct folding options
The function that added nice text for folded blocks was reverted in
https://github.com/neovim/neovim/pull/27217 in favor of the default text
generated by setting the folding-text option to `""`.
2024-01-29 05:43:31 -03:00
Dionisio E Alonso 1d2aa742e8 Merge branch 'refactor-lua-configs' 2024-01-26 13:53:22 -03:00
Dionisio E Alonso bd061bf7b3 feat(LSP): Delete unused variables
There is no need for these variables under this auto-command.
2024-01-26 13:50:01 -03:00
Dionisio E Alonso 97e4052934 feat(LSP): Delete erroneous argument `buffer`
The argument `buffer` us used for another type of autocmd's, those with
whole buffer scope.
2024-01-26 13:48:02 -03:00
Dionisio E Alonso 5971e6e019 feat(shells): Add an alias for vi to run nvim
This fallback is in case an app ignores the `EDITOR` env variable, and
directly runs the command `vi` as a default for tui text editor.
2024-01-26 12:30:44 -03:00
Dionisio E Alonso ae1d9a6043 feat(Fish): Set default editor to Neovim
Using the recommendation in the FAQ
(https://fishshell.com/docs/current/faq.html#why-doesn-t-set-ux-exported-universal-variables-seem-to-work),
set the `EDITOR` environment variable to `nvim`.
2024-01-26 10:04:08 -03:00
Dionisio E Alonso 72fc1f4244 feat(Vim): Add some extra folding functionality
Not quite working yet, but is the first attempt to mimic Treesitter's
functionality in Neovim.
2024-01-25 20:44:23 -03:00
Dionisio E Alonso fb843d5dbc Merge branch 'refactor-lua-configs' 2024-01-25 13:15:26 -03:00
Dionisio E Alonso 82d55e6231 feat(Neovim/Vim): Add some basic folding functionality 2024-01-25 13:11:17 -03:00
Dionisio E Alonso 9b659ae6dd feat(templates): Bump some hook's versions 2024-01-24 22:28:18 -03:00
Dionisio E Alonso 8c40b02eda feat(templates): Add a pre-commit template for Python project hooks 2024-01-24 22:23:04 -03:00
Dionisio E Alonso fa9077a603 feat(LSP): Change functionality in diagnostics pop-up
Now, the automatic pop-up that appears when the cursor is idle, appears
en both, Normal and Insert modes; and only displays messages under the
cursor, not the entire line.

For the other behavior, there is still the keybinding `<space>`+`e`.
2024-01-24 18:42:52 -03:00
Dionisio E Alonso 1880c45bc8 feat(templates): Update default C standard in Makefile 2024-01-24 17:25:27 -03:00
Dionisio E Alonso b204811426 feat(Git): Add nice default date format for blame 2024-01-24 17:16:19 -03:00
Dionisio E Alonso cc9b4d7582 Merge branch 'pylsp-settings' 2024-01-23 19:45:08 -03:00
Dionisio E Alonso 7ac935e2ca feat(templates): Add some nice defaults for Pylint 2024-01-23 19:43:13 -03:00
Dionisio E Alonso 56ca26d493 feat(Pylint): Add nice configurations to pytest
This configurations are intended to be used as either, user
configuration, or in a project.
2024-01-23 19:31:08 -03:00
Dionisio E Alonso 0d08a423d3 feat(LSP): Add minimum configuration to Fourmolu. 2024-01-23 19:29:10 -03:00
Dionisio E Alonso 741ad52052 feat(templates): Add some comments explaining 2024-01-23 19:25:52 -03:00
Dionisio E Alonso 4e30f2806f feat(templates): Add mypy base settings to pyproject.toml 2024-01-23 18:59:42 -03:00
Dionisio E Alonso 2f9692c1e3 feat(templates): Add defaults for Pylint in pyproject.toml
Also included some duplicated messages that can be excluded because they
are already covered by other linters.
2024-01-23 16:47:05 -03:00
Dionisio E Alonso 4025066a19 feat(templates): Add Flake8 defaults in pyproject.toml 2024-01-23 16:45:25 -03:00
Dionisio E Alonso 43bf852b71 feat(templates): Add default exclusion for Ruff 2024-01-23 16:43:44 -03:00
Dionisio E Alonso ede333abc5 feat(templates): Add first attempt at a pyproject.toml template
Added ruff rules copied from ruff.toml but changing the max-line-length
argument.
2024-01-23 16:29:06 -03:00
Dionisio E Alonso 0db220678a Merge branch 'master' into pylsp-settings 2024-01-23 16:26:06 -03:00
Dionisio E Alonso 83c1c4f10d feat(LSP): Add missing duplicate Pylint message
Added a newly found Pylint message that's duplicated by pycodestyle (via
Flake8).

This message wasn't on the documentation but has a PR and is awaiting
approval.
2024-01-23 16:24:07 -03:00
Dionisio E Alonso eb2204a567 feat(LSP): Minor whitespace fix 2024-01-23 16:23:05 -03:00
Dionisio E Alonso 8550e82f06 feat(templates): Add some templates for Makefiles
The purpose of this Makefile and base.mk files are to emulate the
behavior of command `make` when only given a build target (inferring the
source file to use); but using instead a custom set of building flags.

base.mk holds those custom set of building flags, Makefile is just the
wrapper to add get the target name and source file.
2024-01-23 12:54:24 -03:00
Dionisio E Alonso 5e8067677c feat(templates): Add a clang-format template file
As starting with the versioning of templates that can only be used as
per-project basis, the clang-format template file and a README are
added.
2024-01-23 11:53:31 -03:00
Dionisio E Alonso 7b1944e11a Merge branch 'pylsp-settings' 2024-01-23 11:28:40 -03:00
Dionisio E Alonso 7cbc5f95e5 feat(LSP): Add a default clangd configuration
In order to achieve the same linting as when compiling a C project, use
those default compilation options for linting inside text editors that
support clangd LSP.
2024-01-23 11:26:40 -03:00
Dionisio E Alonso 981abbc56b feat(LSP): Reorder some Pylint error codes in pylintrc file
Reordered in each subset of the “disable” sections, all the error codes
according to their numbered error code.

Also, renamed an error code documented as such
(https://pylint.rtfd.io/en/latest/user_guide/messages/convention/unneeded-not.html)
2024-01-23 11:18:57 -03:00
Dionisio E Alonso 29e38da242 Merge branch 'pylsp-settings' 2024-01-23 10:34:50 -03:00
Dionisio E Alonso 03294e28cc feat(LSP): Break some long lines in pylintrc.toml file 2024-01-23 10:33:55 -03:00
Dionisio E Alonso 927cfa6a95 feat(LSP): Unfold error message in Pylint disable
According to message convention, the “missing-docstring” message is
unfolded into three separate messages.  This change abides to that
documentation.
2024-01-23 10:26:34 -03:00
Dionisio E Alonso c774ccf89f feat(LSP): Uncomment disable for docstrings in Pylint
Disable the check for missing docstrings in Pylint.  The check is not
covered by other linters, but it will be disabled anyways.
2024-01-23 10:14:31 -03:00
Dionisio E Alonso b0cfeb9888 feat(LSP): Add some default disables for Pylint
Using the FAQ of the project, disabled some checks that are already
covered by Flake8.
2024-01-23 10:13:52 -03:00
Dionisio E Alonso 76d872d09a feat(Neovim): Add some fallbacks for pre-release
As some parts of the configuration are meant to work on the current
pre-release version.  To make the settings work on current release
version there were added some guards around the experimental code.
2024-01-23 08:25:01 -03:00
Dionisio E Alonso 20259cbb4e Merge branch 'refactor-lua-configs' 2024-01-22 21:42:59 -03:00
Dionisio E Alonso 49878a0ff4 feat(LSP): Reorder some diagnostics configurations 2024-01-22 21:39:45 -03:00
Dionisio E Alonso 0ec2c14a82 Merge branch 'coc-retouches' 2024-01-22 15:58:30 -03:00
Dionisio E Alonso 50a61778e7 feat(Vim): Change LSP for Python in CoC 2024-01-22 15:56:09 -03:00
Dionisio E Alonso fff98b3bf5 feat(Vim): Update diagnostics icons for CoC 2024-01-22 15:32:04 -03:00
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
67 changed files with 653 additions and 219 deletions

22
.gitmodules vendored
View File

@ -23,14 +23,9 @@
url = https://github.com/tomasiser/vim-code-dark.git
shallow = true
ignore = all
[submodule "vim/pack/misc/start/indentLine"]
path = vim/pack/misc/start/indentLine
url = https://github.com/Yggdroot/indentLine.git
shallow = true
ignore = all
[submodule "vim/pack/misc/start/auto-pairs"]
path = vim/pack/misc/start/auto-pairs
url = https://github.com/jiangmiao/auto-pairs.git
url = https://github.com/LunarWatcher/auto-pairs.git
shallow = true
ignore = all
[submodule "vim/pack/misc/start/coc.nvim"]
@ -84,6 +79,11 @@
url = https://github.com/nvim-treesitter/nvim-treesitter.git
shallow = true
ignore = all
[submodule "nvim/pack/misc/start/nvim-treesitter-textobjects"]
path = nvim/pack/misc/start/nvim-treesitter-textobjects
url = https://github.com/nvim-treesitter/nvim-treesitter-textobjects.git
shallow = true
ignore = all
[submodule "vim/pack/misc/start/vim-gitgutter"]
path = vim/pack/misc/start/vim-gitgutter
url = https://github.com/airblade/vim-gitgutter.git
@ -114,3 +114,13 @@
url = https://github.com/glacambre/firenvim.git
shallow = true
ignore = all
[submodule "nvim/pack/misc/start/nvim-treesitter-context"]
path = nvim/pack/misc/start/nvim-treesitter-context
url = https://github.com/nvim-treesitter/nvim-treesitter-context.git
shallow = true
ignore = all
[submodule "vim/pack/misc/start/context.vim"]
path = vim/pack/misc/start/context.vim
url = https://github.com/wellle/context.vim.git
shallow = true
ignore = all

View File

@ -1,31 +1,34 @@
{
"window.menuBarVisibility": "toggle",
"workbench.colorTheme": "One Dark Pro",
"window.titleBarStyle": "custom",
"oneDarkPro.bold": true,
"editor.fontFamily": "'Iosevka Curly Slab', 'Iosevka', 'Fira Code', 'Go Mono', 'Source Code Pro', 'Inconsolata', 'DejaVu Sans Mono', 'Droid Sans Mono', 'monospace', monospace, 'Droid Sans Fallback'",
"editor.fontSize": 11.5,
"editor.fontSize": 15,
"editor.fontLigatures": "'HSKL','ss14','cv26' 8,'cv32' 2,'VLAA' 2,'cv93' 1,'cv95' 3,'VSAC' 1,'VSAD' 1,'VSAB' 9,'cv81' 2,'VSAA' 6,'cv98' 3",
"editor.rulers": [80],
"[python]": {
"editor.rulers": [
79
]
"editor.rulers": [79]
},
"editor.renderWhitespace": "boundary",
"editor.lineNumbers": "relative",
"editor.inlayHints.enabled": "onUnlessPressed",
"files.trimTrailingWhitespace": true,
"files.trimFinalNewlines": true,
"terminal.integrated.fontFamily": "'Go Mono'",
"terminal.integrated.fontSize": 10,
"window.titleBarStyle": "custom",
"terminal.integrated.fontSize": 13,
"search.quickOpen.includeSymbols": true,
"python.workspaceSymbols.enabled": true,
"python.linting.mypyEnabled": true,
"python.linting.mypyArgs": [
"--ignore-missing-imports",
"--follow-imports=silent",
"python.analysis.inlayHints.callArgumentNames": "all",
"python.analysis.inlayHints.functionReturnTypes": true,
"python.analysis.inlayHints.variableTypes": true,
"python.analysis.inlayHints.pytestParameters": true,
"mypy-type-checker.args": [
"--show-column-numbers",
"--strict"
"--pretty",
"--ignore-missing-imports",
"--follow-imports=silent"
],
"editor.lineNumbers": "relative",
"window.commandCenter": true
"rust-analyzer.check.command": "clippy",
"haskell.manageHLS": "GHCup",
"haskell.formattingProvider": "fourmolu",
"dev.containers.dockerPath": "podman",
"dev.containers.dockerComposePath": "podman-compose"
}

3
clangd/config.yaml Normal file
View File

@ -0,0 +1,3 @@
CompileFlags:
Add: [-Wall, -Wextra, -Wpedantic, -std=c2x]
Compiler: gcc # Until clang supports the whole C23 standard

View File

@ -1,10 +1,37 @@
(custom-set-variables
'(custom-enabled-themes '(tango-dark))
'(display-line-numbers-type 'relative)
'(column-number-mode t)
'(truncate-lines t)
'(tool-bar-mode nil))
(custom-set-faces
'(default ((t (:family "Iosevka Curly Slab" :foundry "UKWN" :slant normal :weight regular :height 113 :width normal)))))
(load-theme 'tango-dark t)
(setq display-line-numbers-type 'relative)
(save-place-mode 1)
(setq column-number-mode t)
(setq-default truncate-lines t)
(tool-bar-mode -1)
(set-face-attribute 'default nil
:family "Iosevka Curly Slab"
:slant 'normal
:weight 'regular
:height 113
:width 'normal)
(add-hook 'prog-mode-hook #'display-line-numbers-mode)
(add-hook 'prog-mode-hook 'eglot-ensure) ; Requires LSP servers in PATH
(setq-default eglot-workspace-configuration
'(:pylsp (:configurationSources ["flake8"]
:plugins (:flake8 (:enabled t)
:pylint (:enabled t
:executable "pylint")
:pylsp_mypy (:overrides [t "--no-pretty"])
:pycodestyle (:enabled :json-false)
:pyflakes (:enabled :json-false)))))
(when window-system (set-frame-size (selected-frame) 85 60))
; After dealing with some nice defaults setup packages
(with-eval-after-load 'package
(add-to-list 'package-archives '("melpa" . "https://melpa.org/packages/") t))
(use-package vscode-dark-plus-theme
:ensure t
:config
(load-theme 'vscode-dark-plus t))
(use-package rust-mode :ensure t)
(use-package haskell-mode :ensure t)

View File

@ -2,3 +2,5 @@ if status is-interactive
# Commands to run in interactive sessions can go here
[ -r $HOME/.sh.d/aliases ] && . $HOME/.sh.d/aliases
end
set -gx EDITOR nvim

6
flake8 Normal file
View File

@ -0,0 +1,6 @@
# This does not work from $XDG_CONFIG_HOME, but python-lsp-server looks for it
# in that location anyways. This is explicitly achieved here:
# https://github.com/python-lsp/python-lsp-server/blob/fc2851a/pylsp/config/flake8_conf.py#L52
[flake8]
max-line-length = 79
#extend-ignore = E501, W293, W391, E402, W503 # Those are also checked by pylint

View File

@ -1,5 +1,14 @@
<fontconfig>
<!-- Override monospace detection for custom fonts -->
<!-- Override monospace detection for custom fonts -->
<!-- either raising the symbols-font immediately after default font -->
<alias>
<family>monospace</family>
<prefer>
<family>DejaVu Sans Mono</family>
<family>Symbols Nerd Font Mono</family>
</prefer>
</alias>
<!-- or using the patched version of the default font -->
<match target="pattern">
<test name="family" qual="any">
<string>monospace</string>

1
fourmolu.yaml Normal file
View File

@ -0,0 +1 @@
column-limit: 80

View File

@ -10,3 +10,5 @@
lg = less -S
[tar "tar.xz"]
command = xz -c
[blame]
date = relative

19
mypy/config Normal file
View File

@ -0,0 +1,19 @@
[mypy]
show_column_numbers = true
pretty = true
ignore_missing_imports = true
follow_imports = silent
warn_unused_configs = true
allow_any_generics = false
allow_subclassing_any = false
allow_untyped_calls = false
allow_untyped_defs = false
allow_incomplete_defs = false
check_untyped_defs = true
allow_untyped_decorators = false
no_implicit_optional = true
warn_redundant_casts = true
warn_unused_ignores = true
warn_return_any = true
implicit_reexport = false

View File

@ -1,5 +1,5 @@
current_width = 777
current_height = 1000
current_width = 782 # for Iosevka Curly Slab 11.5; 96col
current_height = 1044
is_maximized = false
show_sidebar = false
sidebar_width = 174

View File

@ -1,6 +1,18 @@
Tuning up Neovim/Vim
====================
Neovim - Vim compatibility
--------------------------
The idea is to keep both projects set up to behave, as close as possible, one
like the other. Sometimes that requires translating from Lua to Vimscript, and
viceversa, in order to use the best possible solution for each editor.
Furthermore, when possible the same plugin is used for both editors. But
sometimes it is necessary to use different solutions; that being either because
one of the editors is not capable of achieving the pretended behavior, or
because Neovim (being a more modern project) can achieve the expected behavior
in a better way.
Fonts with icon glyphs
----------------------
@ -20,6 +32,17 @@ Choose your favourite programming font (already patched) from `NerdFonts
<https://www.nerdfonts.com/font-downloads>`_, install it on your system and set
it as your terminal profile font.
Easier fix, yet (GNU/Linux only)
''''''''''''''''''''''''''''''''
Just download from NerdFonts the Symbols Only variant (NerdFontsSymbolsOnly)
and decompress it on your HOME in ``~/.local/share/fonts/``; then run
``fc-cache -frv`` to cache the new glyphs and restart your terminal (or app).
If you still have some mismatched symbols on your system, you can prioritize
the whole font *Symbols Nerd Font Mono* by symlinking
``fontconfig/fonts.conf`` into ``~/.config/fontconfig/`` provided in this repo.
(Alternatively)
~~~~~~~~~~~~~~~

View File

@ -1,3 +1,5 @@
; extends
; Correct coloring group for class keyword:
; https://github.com/nvim-treesitter/nvim-treesitter/pull/3177#issuecomment-1186027468
"class" @keyword.function

View File

@ -1,15 +1,19 @@
" Some settings Vim has on its defaults.vim that NeoVim hasn't set by default
" Some settings Vim has on “defaults.vim” that Neovim hasn't set by default
set scrolloff=5
if has('mouse')
set mouse=a
set mouse=a
endif
augroup vimStartup
au!
autocmd BufReadPost *
\ if line("'\"") >= 1 && line("'\"") <= line("$") && &ft !~# 'commit'
\ | exe "normal! g`\""
\ | endif
augroup RestoreCursor
autocmd!
" This is slightly different than Vim's defaults.vim, but taken from
" “:h restore-cursor” for Neovim
autocmd BufRead * autocmd FileType <buffer> ++once
\ let s:line = line("'\"")
\ | if s:line >= 1 && s:line <= line("$") && &filetype !~# 'commit'
\ && index(['xxd', 'gitrebase'], &filetype) == -1
\ | execute "normal! g`\""
\ | endif
augroup END

View File

@ -1,4 +1,4 @@
call rpcnotify(1, 'Gui', 'Font', 'Iosevka Curly Slab 8.4')
call rpcnotify(1, 'Gui', 'Font', 'Iosevka Curly Slab 11.5')
" Iosevka customizations: Haskell ligations; JetBrains Mono Style variant;
" cv-a-single-storey-serifed; cv-g-double-storey-open;
" cv-lig-ltgteq-slanted; cv-tilde-high; cv-underscore-low; cv-dollar-open;

View File

@ -11,10 +11,14 @@ set number
set relativenumber
set cursorline
set tabstop=4 shiftwidth=4
set softtabstop=4 " If not 0, must coincide with "tabstop" for tabs indentation
" and with "shiftwidth" for spaces indentation
set softtabstop=-1 " Negative value sets to use "shiftwidth" instead
set list listchars=tab:→ ,trail
set list listchars=tab:→ ,trail,leadmultispace:⦙···
if has('autocmd')
autocmd OptionSet shiftwidth execute
\ 'setlocal listchars=tab:→ ,trail:·,'
\ .. 'leadmultispace:⦙' .. repeat('·', &sw - 1)
endif
let &colorcolumn = join(range(80+1, 256), ',')
set clipboard+=unnamed,unnamedplus
@ -24,25 +28,20 @@ set switchbuf+=usetab,newtab
" Coding Styles
if has('autocmd')
" Restore some :filetype defaults overrided by setting ts, sw and sts
autocmd FileType c setlocal tabstop=8 shiftwidth=8 softtabstop=0
" Ensure spelling is loaded when writting text. Also start insert
augroup GitStuff
autocmd!
autocmd FileType gitcommit setlocal spell nonumber norelativenumber
autocmd FileType gitcommit startinsert
autocmd FileType gitcommit exe "normal! gg"
augroup END
endif
" Extras
let g:vimsyn_embed = 'Pl'
let g:indentLine_char = '⦙'
let g:indentLine_leadingSpaceChar = '·'
let g:indentLine_leadingSpaceEnabled = v:true
let g:AutoPairsMapBS = v:true
let g:AutoPairsMultilineBackspace = v:true
runtime! lsp_client_settings.vim
runtime! **/lsp/init.lua
if has('autocmd')
augroup TerminalStuff
@ -57,6 +56,13 @@ command -nargs=? Terminal rightbelow 16split +terminal\ <args>
nnoremap <silent> <leader>tt :rightbelow 16split +terminal<cr>
tnoremap <Esc> <C-\><C-n><C-w>p
set foldcolumn=auto:4
set foldlevelstart=99
set foldmethod=expr
set foldexpr=nvim_treesitter#foldexpr()
set foldtext=""
set nofoldenable
" Theming
let g:aldmeris_transparent = v:true
let g:aldmeris_termcolors = 'tango'
@ -88,6 +94,7 @@ if exists('g:colors_name') && (g:colors_name == 'onedark'
endif
" Misc
set laststatus=3
let g:airline#extensions#tabline#enabled = v:true
let g:airline#extensions#tabline#buffer_min_count = 2
let g:airline_mode_map = {
@ -98,12 +105,14 @@ let g:airline_mode_map = {
\ 'c': 'C',
\ 'v': 'V',
\ 'V': 'V-L',
\ '': 'V',
\ '': 'V',
\ 's': 'S',
\ }
let g:airline#extensions#tagbar#flags = 'f' " Requires majutsushi/tagbar plugin
let g:airline#extensions#nvimlsp#show_line_numbers = v:false
if exists('g:colors_name') && g:colors_name == 'vscode'
let g:airline_theme = 'codedark' " vscode.nvim doesn't provide one
endif
let g:DevIconsEnableDistro = v:false
runtime! nvim_treesitter.vim
lua require("treesitter")

View File

@ -1,23 +0,0 @@
" nvim-lspconfig
lua << EOF
-- This section must be before setting up any LSP server for the automatic
-- installation of servers to work as expected.
require("mason").setup() -- Just for updating paths to mason packages on launch
require("mason-lspconfig").setup({ automatic_installation = true })
local lspconfig = require("lspconfig")
local capabilities = vim.lsp.protocol.make_client_capabilities()
local lsp_capabilities = require("cmp_nvim_lsp").default_capabilities(capabilities)
local opts = require("lsp_server_settings")
lspconfig.pylsp.setup(
vim.tbl_deep_extend("error", { capabilities = lsp_capabilities }, opts.pylsp)
)
lspconfig.clangd.setup { capabilities = lsp_capabilities }
EOF
lua << EOF
require("lsp.keymaps")
require("lsp.completion")
require("lsp.diagnostics")
EOF

View File

@ -1,3 +1,9 @@
if vim.fn.has("nvim-0.10") == 0 then -- Remove block for v0.10+ release. Covered by vim.diagnostic.config()
vim.fn.sign_define("DiagnosticSignError", { text="", texthl="DiagnosticSignError", linehl="", numhl="" })
vim.fn.sign_define("DiagnosticSignWarn", { text="", texthl="DiagnosticSignWarn", linehl="", numhl="" })
vim.fn.sign_define("DiagnosticSignInfo", { text="", texthl="DiagnosticSignInfo", linehl="", numhl="" })
vim.fn.sign_define("DiagnosticSignHint", { text="", texthl="DiagnosticSignHint", linehl="", numhl="" })
end
vim.diagnostic.config({
signs = {
text = {
@ -5,31 +11,26 @@ vim.diagnostic.config({
[vim.diagnostic.severity.WARN] = "",
[vim.diagnostic.severity.INFO] = "",
[vim.diagnostic.severity.HINT] = "",
}
}
},
},
update_in_insert = true,
virtual_text = { source = "if_many", spacing = 24 },
float = { source = "if_many", border = "rounded" },
})
vim.api.nvim_create_autocmd("LspAttach", {
group = vim.api.nvim_create_augroup("UserLspConfig", { clear = false }),
callback = function(args)
local bufnr = args.buf
local client = vim.lsp.get_client_by_id(args.data.client_id)
vim.api.nvim_create_autocmd("CursorHoldI", {
callback = function()
vim.api.nvim_create_autocmd({ "CursorHold", "CursorHoldI" }, {
group = vim.api.nvim_create_augroup("Diagnostics", { clear = true }),
buffer = bufnr,
callback = function()
vim.diagnostic.open_float({ focusable = false, header = "" })
end
})
vim.lsp.handlers["textDocument/publishDiagnostics"] = vim.lsp.with(
vim.lsp.diagnostic.on_publish_diagnostics, {
update_in_insert = true,
virtual_text = { source = "if_many", spacing = 24 },
}
)
vim.diagnostic.config({
float = { source = "if_many", border = "rounded" }
vim.diagnostic.open_float({
focusable = false,
header = "",
scope = "cursor",
})
end,
})
end,
})

20
nvim/lua/lsp/init.lua Normal file
View File

@ -0,0 +1,20 @@
require("mason").setup() -- Just for updating paths to mason packages on launch
require("mason-lspconfig").setup({ automatic_installation = true })
local lspconfig = require("lspconfig")
local capabilities = require("cmp_nvim_lsp").default_capabilities()
local default_opts = { capabilities = capabilities }
local opts = require("lsp.server_settings")
lspconfig.pylsp.setup(vim.tbl_deep_extend("error", default_opts, opts.pylsp))
lspconfig.clangd.setup(default_opts)
lspconfig.rust_analyzer.setup(default_opts)
lspconfig.hls.setup(vim.tbl_deep_extend("error", default_opts, opts.hls))
lspconfig.fortls.setup(vim.tbl_deep_extend("error", default_opts, opts.fortls))
require("lsp.keymaps")
require("lsp.completion")
require("lsp.diagnostics")
if vim.lsp.inlay_hint then -- Remove condition for v0.10+ release
require("lsp.inlay")
end

12
nvim/lua/lsp/inlay.lua Normal file
View File

@ -0,0 +1,12 @@
vim.api.nvim_create_autocmd("LspAttach", { -- Highly experimental textDocument/inlayHint not in PyLSP
group = vim.api.nvim_create_augroup("UserLspConfig", { clear = false }),
callback = function(args)
if not (args.data and args.data.client_id) then
return
end
local bufnr = args.buf
local client = vim.lsp.get_client_by_id(args.data.client_id)
vim.lsp.inlay_hint.enable(true, { bufnr = bufnr })
end,
})

View File

@ -11,7 +11,9 @@ vim.api.nvim_create_autocmd("LspAttach", {
vim.keymap.set("n", "<space>wa", vim.lsp.buf.add_workspace_folder, opts)
vim.keymap.set("n", "<space>wr", vim.lsp.buf.remove_workspace_folder, opts)
vim.keymap.set("n", "<space>wl", function() vim.pretty_print(vim.lsp.buf.list_workspace_folders()) end, opts)
vim.keymap.set("n", "<space>wl", function()
vim.print(vim.lsp.buf.list_workspace_folders())
end, opts)
vim.keymap.set("n", "<space>D", vim.lsp.buf.type_definition, opts)
vim.keymap.set("n", "<space>rn", vim.lsp.buf.rename, opts)
@ -23,5 +25,13 @@ vim.api.nvim_create_autocmd("LspAttach", {
vim.keymap.set("n", "[d", vim.diagnostic.goto_prev, opts)
vim.keymap.set("n", "]d", vim.diagnostic.goto_next, opts)
vim.keymap.set("n", "<space>q", vim.diagnostic.setloclist, opts)
vim.keymap.set("n", "<leader>f", function()
vim.lsp.buf.format { async = true }
end, opts)
vim.keymap.set("n", "<leader>ih", function()
vim.lsp.inlay_hint.enable(not vim.lsp.inlay_hint.is_enabled())
end, opts)
end,
})

View File

@ -0,0 +1,27 @@
local lspconfig = require("lspconfig")
local default_cmd = vim.deepcopy(lspconfig.fortls.document_config.default_config.cmd)
local cmd = vim.list_slice(default_cmd, nil, 1)
local default_flags = vim.list_slice(default_cmd, 3) -- 1st flag dropped intentionally
local fortls_opts = {
flags = vim.list_extend({ "--lowercase_intrinsics" }, default_flags)
}
return { cmd = vim.list_extend(cmd, fortls_opts.flags) }
-- In order to achive:
-- ===================
--local lsp = "fortls"
--settings[lsp] = { lowercaseIntrinsics = true }
--lspconfig[lsp].setup {
-- capabilities = capabilities,
-- settings = { ["fortran-ls"] = settings[lsp] },
-- root_dir = function(fname) return vim.fn.getcwd() end,
-- cmd = (function()
-- if lsp == "fortls" then
-- return vim.list_extend(
-- vim.deepcopy(lspconfig[lsp].document_config.default_config.cmd),
-- { "--lowercase_intrinsics" }
-- )
-- end
-- end)()}

View File

@ -0,0 +1,6 @@
-- For plugins here to work properly refer to https://haskell-language-server.rtfd.io/en/latest/support/plugin-support.html#current-plugin-support-tiers
-- This documentation tells which GHC versions won't work for each plugin
local hls_settings = {
formattingProvider = "fourmolu",
}
return { settings = { haskell = hls_settings } }

View File

@ -0,0 +1,12 @@
local opts = {}
opts.pylsp = require("lsp.server_settings.pylsp")
opts.hls = require("lsp.server_settings.hls")
opts.fortls = require("lsp.server_settings.fortls")
local workspace_conf_file = vim.fn.findfile(".nvim/lsp-server-conf.lua", ".;")
if workspace_conf_file ~= "" then
local workspace_conf = dofile(workspace_conf_file)
opts = vim.tbl_deep_extend("force", opts, workspace_conf)
end
return opts

View File

@ -0,0 +1,58 @@
--if vim.fn.exists(":PylspInstall") then
-- vim.cmd("PylspInstall pylsp-mypy")
--end
-- https://github.com/williamboman/mason.nvim/discussions/908
local pylsp = require("mason-registry").get_package("python-lsp-server")
pylsp:on("install:success", function ()
local mason_package_path = function(package)
local path = vim.fn.resolve(vim.fn.stdpath("data") .. "/mason/packages/" .. package)
return path
end
local path = mason_package_path("python-lsp-server")
local command = path .. "/venv/bin/python"
local install_cmd = { command, "-m", "pip", "install" }
local pylsp_plugins = { "python-lsp-ruff", "pylsp-mypy" }
vim.schedule(function()
vim.fn.system(vim.list_extend(install_cmd, pylsp_plugins))
end)
local flake8_plugins = { "flake8-pyproject", "flake8-pylint" }
vim.schedule(function()
vim.fn.system(vim.list_extend(install_cmd, flake8_plugins))
end)
end)
local pylsp_settings = {
configurationSources = { "flake8" }, -- tool's config files to override settings from
plugins = {
flake8 = { enabled = true },
pylint = { enabled = true },
pylsp_mypy = { overrides = { true, "--no-pretty" } },
pycodestyle = { enabled = false }, -- covered in flake8
pyflakes = { enabled = false }, -- covered in flake8
},
}
local venv_dir = vim.env.VIRTUAL_ENV
if venv_dir ~= nil then
local python_exec = vim.fn.findfile("python", venv_dir .. "/bin;")
if python_exec ~= "" then
pylsp_settings.plugins.jedi = {environment = python_exec}
end
local flake8_exec = vim.fn.findfile("flake8", venv_dir .. "/bin;")
if flake8_exec ~= "" then
pylsp_settings.plugins.flake8.executable = flake8_exec
end
local pylint_exec = vim.fn.findfile("pylint", venv_dir .. "/bin;")
if pylint_exec ~= "" then
pylsp_settings.plugins.pylint.executable = pylint_exec
end
local mypy_exec = vim.fn.findfile("mypy", venv_dir .. "/bin;")
if mypy_exec ~= "" or python_exec ~= "" then
pylsp_settings.plugins.pylsp_mypy.overrides = {"--python-executable", python_exec, true}
end
end
return { settings = { pylsp = pylsp_settings } }

View File

@ -0,0 +1,16 @@
local pylsp_settings = {
plugins = {
flake8 = { maxLineLength = 120 },
pylint = {
args = {
"--max-line-length=120",
"--disable=missing-docstring,invalid-name,redefined-outer-name,logging-format-interpolation",
},
},
},
}
local opts = {}
opts.pylsp = { settings = { pylsp = pylsp_settings } }
return opts

View File

@ -1,10 +0,0 @@
local opts = {}
opts.pylsp = require("python_lsp_server_settings")
local workspace_settings_file = vim.fn.findfile(".nvim/lsp-server-settings.lua", ".;")
if workspace_settings_file ~= "" then
local workspace_settings = dofile(workspace_settings_file)
opts = vim.tbl_deep_extend("force", opts, workspace_settings)
end
return opts

View File

@ -1,42 +0,0 @@
local pylsp_settings = {
configurationSources = {"flake8", "pycodestyle"}, -- config files to read from, not plugins enabled
plugins = {
flake8 = {
enabled = true,
maxLineLength = 79,
-- ignore = {"E501", "W293", "W391"}, -- Those are also checked by pylint
},
pylint = {
enabled = true,
args = {
"--max-line-length=79",
"--disable=missing-docstring,invalid-name,redefined-outer-name,logging-format-interpolation",
"--disable=line-too-long,trailing-whitespace,trailing-newlines", -- Checked by flake8
}
},
pylsp_mypy = {enabled = true},
pycodestyle = {enabled = false}, -- covered in flake8
pyflakes = {enabled = false}, -- covered in flake8
-- mccabe = {enabled = false}, -- not covered in flake8 by default; PyLSP doesn't handle the option
}
}
local venv_dir = vim.fn.finddir(".venv/", vim.fn.expand("%:p:h") .. ";")
local python_exec = vim.fn.findfile("python3", venv_dir .. "/bin;")
if venv_dir ~= "" and python_exec ~= "" then
pylsp_settings.plugins.jedi = {environment = python_exec}
end
local flake8_exec = vim.fn.findfile("flake8", venv_dir .. "/bin;")
if flake8_exec ~= "" then
pylsp_settings.plugins.flake8.executable = flake8_exec
end
local pylint_exec = vim.fn.findfile("pylint", venv_dir .. "/bin;")
if pylint_exec ~= "" then
pylsp_settings.plugins.pylint.executable = pylint_exec
end
local mypy_exec = vim.fn.findfile("mypy", venv_dir .. "/bin;")
if mypy_exec ~= "" or python_exec ~= "" then
pylsp_settings.plugins.pylsp_mypy.overrides = {"--python-executable", python_exec, true}
end
return { settings = { pylsp = pylsp_settings } }

27
nvim/lua/treesitter.lua Normal file
View File

@ -0,0 +1,27 @@
require'nvim-treesitter.configs'.setup {
auto_install = true,
highlight = { enable = true },
incremental_selection = { enable = true },
indent = { enable = true },
-- textobjects treesitter plugin
textobjects = {
select = {
enable = true,
lookahead = true,
keymaps = {
["af"] = "@function.outer",
["if"] = "@function.inner",
["ac"] = "@class.outer",
["ic"] = { query = "@class.inner", desc = "Select inner part of a class region" },
["as"] = { query = "@scope", query_group = "locals", desc = "Select language scope" },
},
},
},
}
require'treesitter-context'.setup {
max_lines = 2,
min_window_height = 32,
trim_scope = "inner",
}

View File

@ -1,13 +0,0 @@
local settings = {}
settings.pylsp = {
plugins = {
flake8 = {maxLineLength = 120},
pylint = {
args = {
"--max-line-length=120",
"--disable=missing-docstring,invalid-name,redefined-outer-name,logging-format-interpolation"
}
},
}
}
return settings

View File

@ -1,8 +0,0 @@
lua <<EOF
require'nvim-treesitter.configs'.setup {
auto_install = true,
highlight = { enable = true },
incremental_selection = { enable = true },
indent = { enable = true },
}
EOF

@ -1 +1 @@
Subproject commit 0e6b2ed705ddcff9738ec4ea838141654f12eeef
Subproject commit 39e2eda76828d88b773cc27a3f61d2ad782c922d

@ -1 +1 @@
Subproject commit c68b3a003483cf382428a43035079f78474cd11e
Subproject commit 1735dd5a5054c1fb7feaf8e8658dbab925f4f0cf

@ -1 +1 @@
Subproject commit a5ca8b03972b347b74b2ad2f7f23f120a514593b
Subproject commit 9ae570e206360e47d30b4c35a4550c165f4ea7b7

@ -1 +1 @@
Subproject commit 84af7a1fa1dbdb0f201849be7993d999a05d973b
Subproject commit 49ff59aded1047a773670651cfa40e76e63c6377

@ -1 +1 @@
Subproject commit 777450fd0ae289463a14481673e26246b5e38bf2
Subproject commit abacd4cb7ffd640b558845b617cfca1692dcb1a6

@ -1 +1 @@
Subproject commit 1ec6f5cbf6ffc44c84783d70039df5295ca22b4e
Subproject commit a284b14b3a9c4851f900286cd7eb68e3a8f90b1c

@ -1 +1 @@
Subproject commit ee4ef314bd990b2b05b7fbd95b857159e444a2fe
Subproject commit fc72687977e1c34259c42f0e408655cf2638760d

View File

@ -1 +0,0 @@
../../../../vim/pack/misc/start/indentLine

@ -1 +1 @@
Subproject commit 584ccea56e2d37b31ba292da2b539e1a4bb411ca
Subproject commit 19ac9e8b5c1e5eedd2ae7957243e25b32e269ea7

@ -0,0 +1 @@
Subproject commit 865424e468a6926e913b523ff5fc7d34a2f8f996

@ -0,0 +1 @@
Subproject commit 84cc9ed772f1fee2f47c1e076f518829583d8347

@ -1 +1 @@
Subproject commit dd640f6cfb0e370cfd3db389f04b172508848bd3
Subproject commit 8e4b79b0e6495ddf29552178eceba1e147e6cecf

@ -1 +1 @@
Subproject commit 9cf814fbc1e7ec05fe05e5381beee2ceec5b099c
Subproject commit 1a2cb491a962acf3bbf53c6d0a61b4ec76012570

18
pylintrc.toml Normal file
View File

@ -0,0 +1,18 @@
# Linkable as $XDG_CONFIG_HOME/pylintrc (without the extension). Pylint
# ignores the category and loads the settings anyways.
[tool.pylint.format]
max-line-length = 79
[tool.pylint."messages control"]
disable = [
# Covered in flake8 according to https://pylint.rtfd.io/en/latest/faq.html#which-messages-should-i-disable-to-avoid-duplicates-if-i-use-other-popular-linters
"unnecessary-semicolon", "bad-indentation", "bare-except", # pycodestyle
"unnecessary-negation", "singleton-comparison", "line-too-long", # pycodestyle
"trailing-whitespace", "missing-final-newline", "trailing-newlines", # pycodestyle
"multiple-statements", "wrong-import-position", # pycodestyle
"undefined-variable", "unused-import", "unused-variable", # pyflakes
"too-many-branches", # mccabe
# other stuff
# Unfold "missing-docstring" (https://pylint.rtfd.io/en/latest/user_guide/messages/convention/missing-docstring.html)
"missing-module-docstring", "missing-class-docstring", "missing-function-docstring",
]

3
pytest.ini Normal file
View File

@ -0,0 +1,3 @@
[pytest]
addopts = --pdbcls=IPython.terminal.debugger:TerminalPdb --tb=short --quiet
--disable-pytest-warnings --no-cov

6
ruff/ruff.toml Normal file
View File

@ -0,0 +1,6 @@
line-length = 79
[lint]
extend-select = [
"E", "W", "F", "C90", # Pycodestyle + Pyflakes + McCabe = Flake8
"PL", # Pylint
]

View File

@ -2,5 +2,6 @@ alias ls="ls --color=auto"
alias rm="rm -i"
alias cp="cp -i"
alias mv="mv -i"
alias vi=nvim
alias grep="grep --color=auto"
alias less="less --LONG-PROMPT --LINE-NUMBERS"

4
templates/Makefile Normal file
View File

@ -0,0 +1,4 @@
-include base.mk
TARGET = appname
all: $(TARGET)

16
templates/README.rst Normal file
View File

@ -0,0 +1,16 @@
Templates
=========
This directory bundles templates of config files for different kind of
projects.
The purpose of files here, is that for these tools there is no global/user
configuration that can be used as a common base, but instead, these tools can
only be configured per-project adding config files to the base dir of the
corresponding project.
Therefore, here are a bunch of files that with minimum or non changes can be
copied into project's base directories for configuring them.
There are templates for tools for different technologies. Depending on
technologies used in each project is which files should be copied.

8
templates/_clang-format Normal file
View File

@ -0,0 +1,8 @@
BasedOnStyle: llvm
IndentWidth: 4
TabWidth: 4
UseTab: ForIndentation
BreakBeforeBinaryOperators: NonAssignment
SpaceAfterCStyleCast: true
AlignTrailingComments: false
SpacesBeforeTrailingComments: 2

View File

@ -0,0 +1,73 @@
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.5.0
hooks:
- id: trailing-whitespace
- id: end-of-file-fixer
- id: check-toml
- id: check-yaml
exclude: .chart/
- id: check-added-large-files
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.2.2
hooks:
- id: ruff
args: [--config=./backoffice/ceg/pyproject.toml]
- repo: https://github.com/PyCQA/flake8
rev: 7.0.0
hooks:
- id: flake8
args: [--toml-config=./pyproject.toml]
additional_dependencies: [Flake8-pyproject]
language: system # don't commit!!
- repo: https://github.com/PyCQA/pylint
rev: v3.0.3
hooks:
- id: pylint
args: [--rcfile=./pyproject.toml]
# disabled plugins: pylint.extensions.mccabe
exclude: tests|tests/input|tests/extensions/data|tests/regrtest_data|tests/data|doc
language: system # don't commit!!
- repo: https://github.com/pre-commit/mirrors-mypy
rev: v1.8.0
hooks:
- id: mypy
args: [--show-column-numbers, --pretty, --ignore-missing-imports, --follow-imports=silent]
additional_dependencies: [types-all]
#exclude: migrations/
language: system # don't commit!!
- repo: https://github.com/asottile/pyupgrade
rev: v3.15.0
hooks:
- id: pyupgrade
args: [--py311-plus]
args: [--py37-plus]
- repo: https://github.com/pycqa/isort
rev: 5.13.2
hooks:
- id: isort
name: isort (python)
args: [--check-only, --line-length=120, --diff]
args: [--check-only, --profile=django, --line-length=120, --diff, --py=37, --src=ceg/]
- repo: https://github.com/jazzband/pip-tools
rev: 7.3.0
hooks:
- id: pip-compile
name: pip-compile requirements.txt
files: ^requirements\.(in|txt)$
args: [requirements.txt]
- id: pip-compile
name: pip-compile requirements-dev.in
files: ^requirements-dev\.(in|txt)$
args: [requirements-dev.in]
- id: pip-compile
name: pip-compile requirements-lint.in
files: ^requirements-lint\.(in|txt)$
args: [requirements-lint.in]

6
templates/base.mk Normal file
View File

@ -0,0 +1,6 @@
BUILD ?= debug
CFLAGS ?= -Wall -Wextra -std=c23 -Wpedantic
cflags.debug = -g -DDEBUG
cflags.release = -O2 -Werror
CFLAGS += ${cflags.${BUILD}}

53
templates/pyproject.toml Normal file
View File

@ -0,0 +1,53 @@
[tool.ruff]
line-length = 120
[tool.ruff.lint]
extend-select = [
"E", "W", "F", # Pycodestyle + Pyflakes - McCabe (C90) = Flake8
"PL", # Pylint
]
extend-ignore = [
"PLW2901", "PLR2004", # From Pylint plugin, not enabled by default
"PLR0912", # Already covered: mccabe (C90)
]
[tool.ruff.lint.per-file-ignores]
"__init__.py" = ["F401"]
[tool.flake8]
# This category requires “Flake8-pyproject” plugin to take effect
max-line-length = 120
per-file-ignores = [
"__init__.py:F401",
]
[tool.pylint.format]
max-line-length = 120
[tool.pylint."messages control"]
disable = [
# Covered in flake8 according to https://pylint.rtfd.io/en/latest/faq.html#which-messages-should-i-disable-to-avoid-duplicates-if-i-use-other-popular-linters
"unnecessary-semicolon", "bad-indentation", "bare-except", # pycodestyle
"unnecessary-negation", "singleton-comparison", "line-too-long", # pycodestyle
"trailing-whitespace", "missing-final-newline", "trailing-newlines", # pycodestyle
"multiple-statements", "wrong-import-position", # pycodestyle
"undefined-variable", "unused-import", "unused-variable", # pyflakes
"too-many-branches", # mccabe
# other stuff
"missing-module-docstring", "missing-class-docstring", "missing-function-docstring",
#"logging-format-interpolation",
#"redefined-outer-name", # Pytest fixtures in tests
#"invalid-name", # Class-attributes in Django-commands (.help)
]
[tool.mypy]
show_column_numbers = true
pretty = true
ignore_missing_imports = true
follow_imports = "silent"
[tool.pytest.ini_options]
addopts = """
--pdbcls=IPython.terminal.debugger:TerminalPdb --tb=short --quiet
--disable-pytest-warnings --no-cov
"""
log_level = "INFO"
python_files = ["*_tests.py", "tests.py"]

View File

@ -6,10 +6,10 @@
// https://microsoft.github.io/vscode-codicons/dist/codicon.html
// Unicode symbols taken from VS Code source code (search symbol- entries):
// https://github.com/microsoft/vscode/blob/main/src/vs/base/common/codicons.ts#L113-L556
"diagnostic.errorSign": "",
"diagnostic.warningSign": "",
"diagnostic.infoSign": "",
"diagnostic.hintSign": "",
"diagnostic.errorSign": "",
"diagnostic.warningSign": "",
"diagnostic.infoSign": "",
"diagnostic.hintSign": "",
"suggest.completionItemKindLabels": {
"keyword": "",
@ -40,14 +40,17 @@
"default": ""
},
// coc-diagnostic
"diagnostic-languageserver.filetypes": {
"python": ["flake8", "pylint", "mypy", "pycodestyle"]
},
"diagnostic-languageserver.linters": {
"pycodestyle": {
"sourceName": "pycodestyle",
"command": "pycodestyle"
"languageserver": {
"haskell": {
"command": "haskell-language-server-wrapper",
"args": ["--lsp"],
"rootPatterns": ["*.cabal", "stack.yaml", "cabal.project", "package.yaml", "hie.yaml"],
"filetypes": ["haskell", "lhaskell"],
"settings": {
"haskell": {
"formattingProvider": "formolu"
}
}
}
}
}

View File

@ -1,3 +1,9 @@
" Default extensions
let g:coc_global_extensions = [
\ "coc-diagnostic",
\ "@yaegassy/coc-ruff", "@yaegassy/coc-pylsp", "@yaegassy/coc-mypy", "coc-clangd", "coc-rust-analyzer"
\ ]
" Remap keys for gotos
nmap <silent> gd <Plug>(coc-definition)
nmap <silent> gD <Plug>(coc-implementation)
@ -18,6 +24,3 @@ endfunction
nnoremap <silent> <space>o :<C-u>CocList outline<cr>
nnoremap <silent> <space>s :<C-u>CocList -I symbols<cr>
nnoremap <silent> <space>p :<C-u>CocListResume<CR>
" Default extensions
let g:coc_global_extensions = ["coc-diagnostic", "coc-jedi", "coc-clangd"]

15
vim/neovim.vim Normal file
View File

@ -0,0 +1,15 @@
" Some nice defaults from Neovim
set tabpagemax=50
if empty($XDG_STATE_HOME)
let $XDG_STATE_HOME = "~/.local/state"
endif
let g:stdpath_state = $XDG_STATE_HOME .. "/vim"
call mkdir(g:stdpath_state .. "/swap", "p", 0o700)
call mkdir(g:stdpath_state .. "/undo", "p", 0o700)
call mkdir(g:stdpath_state .. "/backup", "p", 0o700)
set directory^=$XDG_STATE_HOME/vim/swap//
set undodir^=$XDG_STATE_HOME/vim/undo
set backupdir^=$XDG_STATE_HOME/vim/backup

@ -1 +1 @@
Subproject commit 39f06b873a8449af8ff6a3eee716d3da14d63a76
Subproject commit cd97efbeba5fdf66cf3db0c8fad5660e571bffa3

@ -1 +1 @@
Subproject commit bbaa1d5d1ff3cbd9d26bb37cfda1a990494c4043
Subproject commit f1ffb8d9b336ec6fe2ea0bd68ffeff5b77150e43

@ -0,0 +1 @@
Subproject commit 108644e146c864995288dee7dacf219267917ac1

@ -1 +0,0 @@
Subproject commit d15d63bf9c4a74a02470d4bc8ecce53df13e3a75

@ -1 +1 @@
Subproject commit be563539754b7af22bbe842ef217d4463f73468c
Subproject commit 12edcb59449b335555652898f82dd6d5c59d519a

@ -1 +1 @@
Subproject commit a532fed72ace069e61c0132125b728316f9abd3c
Subproject commit ff0f9a45a5d81d2c8aa67601c264b18c4fe26b15

@ -1 +1 @@
Subproject commit 44dbd57dd19e8ec58b2a50c787c8ae7bb231c145
Subproject commit e801371917e52805a4ceb1e93f55ed1fba712f82

@ -1 +1 @@
Subproject commit b6b5ffe31a195a3077338d7a506b905e4a51590f
Subproject commit 57b77747694ea5676c3ca0eeaf9567dc499730c0

@ -1 +1 @@
Subproject commit 7bf26b5432ca93309d08037b27fa9459e64a460c
Subproject commit 05d7843412c4fb7d1bdafefd04462ac4db841f0f

View File

@ -12,23 +12,22 @@ set number
set relativenumber
set cursorline
set tabstop=4 shiftwidth=4
set softtabstop=4 " If not 0, must coincide with "tabstop" for tabs indentation
" and with "shiftwidth" for spaces indentation
set softtabstop=-1 " Negative value sets to use "shiftwidth" instead
set list listchars=tab:→ ,trail
set list listchars=tab:→ ,trail,leadmultispace:⦙···
if has('autocmd')
autocmd OptionSet shiftwidth execute
\ 'setlocal listchars=tab:→ ,trail:·,'
\ .. 'leadmultispace:⦙' .. repeat('·', &sw - 1)
endif
let &colorcolumn = join(range(80+1, 256), ',')
set directory^=~/.local/share/vim/swap//
set undodir^=~/.local/share/vim/undo
set backupdir^=~/.local/share/vim/backup
runtime! neovim.vim
set switchbuf+=usetab,newtab
" Coding Styles
if has('autocmd')
" Restore some :filetype defaults overrided by setting ts, sw and sts
autocmd FileType c setlocal tabstop=8 shiftwidth=8 softtabstop=0
" Ensure spelling is loaded when writting text. Also start insert
augroup GitStuff
autocmd!
@ -39,16 +38,22 @@ endif
" Extras
let g:vimsyn_embed = 'Pl'
let g:indentLine_char = '⦙'
let g:indentLine_leadingSpaceChar = '·'
let g:indentLine_leadingSpaceEnabled = v:true
let g:AutoPairsMapBS = v:true
let g:AutoPairsMultilineBackspace = v:true
runtime! lsp_client_settings.vim
runtime! lsp.vim
command -nargs=? Terminal rightbelow terminal ++rows=16 <args>
nnoremap <silent> <leader>tt :rightbelow terminal ++rows=16<CR>
tnoremap <Esc> <C-\><C-n><C-w>p
set foldcolumn=4
set foldlevelstart=99
set foldmethod=expr
set foldexpr=coc#util#refactor_foldlevel(v:lnum)
set foldtext=coc#util#refactor_fold_text(v:foldstart)
set nofoldenable
" Theming
let g:aldmeris_transparent = v:true
let g:aldmeris_termcolors = 'tango'
@ -93,7 +98,13 @@ let g:airline_mode_map = {
\ 'c': 'C',
\ 'v': 'V',
\ 'V': 'V-L',
\ '': 'V',
\ '': 'V',
\ 's': 'S',
\ }
let g:airline#extensions#tagbar#flags = 'f' " Requires majutsushi/tagbar plugin
let g:airline#extensions#coc#stl_format_err = '%C'
let g:airline#extensions#coc#stl_format_warn = '%C'
let g:DevIconsEnableDistro = v:false
let g:context_max_height = 2
let g:context_highlight_border = '<hide>'