nvim: Replace vim-easy-align with mini module

Mini.nvim now also comes with an align module which perfectly mimics
the behavior of my beloved junegunn vim-easy-align plugin. It is almost
sad to see such an old friend go, but ultimately it removes a redundant
plugin and switches the setup ever so slightly more towards being lua
based.
The mini module also allows more advanced lua-based modifier pattern
shenanigans but so far I don't need any of the advanced stuff: I just
need a quick way to align markdown tables and similar, and this one does
exactly the same as before, only with a couple nice additional options
and previews. It still uses the same key chord `ga<where>` but also
offers `gA<where>` which apparently comes with a nicer preview. My
fingers will probably stick to the former for the time being.

One thing that changes is that, by default, it will align *all*
separators not just the first instance on each line. To mimic the old
behavior you can, in alignment mode, hit `f` to enter a filter and enter
`n==2` to get the same result as default vim-easy-align (the first pair
of delimiters are aligned).
Also it comes with some nice extra functionality like trimming
whitespace by just hitting `t` when in alignment mode
This commit is contained in:
Marty Oehme 2024-06-07 09:50:26 +02:00
parent 5c4afcb0b3
commit 57f2fbd5fe
Signed by: Marty
GPG key ID: EDBF2ED917B2EF6A
2 changed files with 2 additions and 9 deletions

View file

@ -107,6 +107,8 @@ return {
})
require("mini.ai").setup()
-- Align tables and other alignable things
require("mini.align").setup({})
require("mini.comment").setup({
hooks = {
pre = function()

View file

@ -1,13 +1,4 @@
return {
-- Align tables and other alignable things
{
"junegunn/vim-easy-align",
event = "InsertEnter",
keys = {
{ "ga", "<Plug>(EasyAlign)", mode = "n" },
{ "ga", "<Plug>(EasyAlign)", mode = "x" },
},
},
-- surround things with other things using ys/cs/ds
{ "kylechui/nvim-surround", config = true, event = "VeryLazy" },