8000 mini.nvim/doc/mini-splitjoin.txt at main · max-farver/mini.nvim · GitHub
[go: up one dir, main page]

Skip to content

Latest commit

 

History

History
536 lines (413 loc) · 20.9 KB

mini-splitjoin.txt

File metadata and controls

536 lines (413 loc) · 20.9 KB
Return ~
`(table)` Array of new positions to where input `positions` were moved.
------------------------------------------------------------------------------
*MiniSplitjoin.join_at()*
`MiniSplitjoin.join_at`({positions})
Join at positions
Overview:
- For each position join its line with the next line. Joining is done by
replacing trailing whitespace of the line and indent of its next line
(see |MiniSplitjoin.get_indent_part()|) with a pad string (single space except
empty string for first and last positions). To adjust this, use hooks
(for example, see |MiniSplitjoin.gen_hook.pad_brackets()|).
Notes:
- Cursor is adjusted to follow text updates.
- Use output of this function to keep track of input positions.
Parameters ~
{positions} `(table)` Array of positions at which to perform join.
See |MiniSplitjoin-glossary| for their structure. Note: they don't have
to be ordered, but first and last ones will have different pad string.
Return ~
`(table)` Array of new positions to where input `positions` were moved.
------------------------------------------------------------------------------
*MiniSplitjoin.get_visual_region()*
`MiniSplitjoin.get_visual_region`()
Get previous visual region
Get previous visual selection using |'<| and |'>| marks in the format of
region (see |MiniSplitjoin-glossary|). Used in Visual mode mappings.
Note:
- Both marks are included in region.
- In linewise mode start is at column 1 and end is at line's last character.
Return ~
`(table)` A region. See |MiniSplitjoin-glossary| for exact structure.
------------------------------------------------------------------------------
*MiniSplitjoin.get_indent_part()*
`MiniSplitjoin.get_indent_part`({line}, {respect_comments})
Get string's indent part
Parameters ~
{line} `(string)` String for which to compute indent.
{respect_comments} `(boolean|nil)` Whether to respect comments as indent part.
Default: `true`.
Return ~
`(string)` Part of input representing line's indent. Can be empty string.
Use `string.len()` to compute indent in bytes.
------------------------------------------------------------------------------
*MiniSplitjoin.operator()*
`MiniSplitjoin.operator`({task})
Operator for Normal mode mappings
Main function to be used in expression mappings. No need to use it
directly, everything is setup in |MiniSplitjoin.setup()|.
Parameters ~
{task} `(string)` Name of task.
vim:tw=78:ts=8:noet:ft=help:norl:
0