Announcing ‘mini.align’
announce
reddit
Align text interactively (like ‘vim-easy-align’, but in Lua and slightly different mechanics)
Originally posted on Reddit
Hello, Neovim users!
I am happy to announce the release of mini.align - module of mini.nvim for aligning text interactively (with or without live preview). This is mostly designed after junegunn/vim-easy-align, but is implemented in Lua and has slightly different alignment specification and user interaction lifecycle.
Features:
- Alignment is done in three main steps:
- Split lines into parts based on Lua pattern(s) or user-supplied rule.
- Justify parts for certain side(s) to be same width inside columns.
- Merge parts to be lines, with customizable delimiter(s).
- User can control alignment interactively by pressing customizable modifiers (single keys representing how alignment steps and/or options should change). Some of default modifiers:
- Press
s
to enter split Lua pattern. - Press
j
to choose justification side from available ones (“left”, “center”, “right”, “none”). - Press
m
to enter merge delimiter. - Press
f
to enter filter Lua expression to configure which parts will be affected (like “align only first column”). - Press
i
to ignore some commonly unwanted split matches. - Press
p
to pair neighboring parts so they be aligned together. - Press
t
to trim whitespace from parts. - Press
<BS>
(backspace) to delete some last pre-step.
- Press
- Alignment can be done with instant preview (result is updated after each modifier) or without it (result is shown and accepted after non-default split pattern is set).
- Every user interaction is accompanied with helper status message showing relevant information about current alignment process.
Please, check it out and tell me what you think! Either here in comments or in dedicated beta-testing issue. Thanks!