Open aktau opened 5 days ago
mini.align
There's already some pre-existing modifiers for common splits, like =. For example:
=
https://github.com/echasnovski/mini.nvim/blob/c8922aef8207137e66c80acdb9523668599ba62a/lua/mini/align.lua#L595-L601
I think the pipe is another common one. I use it a lot for markdown-like tables (also in plain text). I've got the following:
-- Add special modifier for pipes, often used for (markdown) tables. -- mini.align already has builtins for ["="], [","] and [" "]. modifiers = { ["|"] = function(steps, opts) opts.split_pattern = "|" table.insert(steps.pre_justify, mini.align.gen_step.trim("both", "keep")) opts.merge_delimiter = ' ' end, },
One could consider adding it to the default set.
Thanks for the suggestion!
It does make sense to have this built-in. However, I vaguely remember considering it and opted out for some reason. I'll revisit later.
Contributing guidelines
Module(s)
mini.align
Description
There's already some pre-existing modifiers for common splits, like
=
. For example:https://github.com/echasnovski/mini.nvim/blob/c8922aef8207137e66c80acdb9523668599ba62a/lua/mini/align.lua#L595-L601
I think the pipe is another common one. I use it a lot for markdown-like tables (also in plain text). I've got the following:
One could consider adding it to the default set.