[mini.surround] Call "Output surrounding" with arguments like text
, range
#2037
Replies: 1 comment 2 replies
-
Arguably this is not a surrounding, because "add surrounding" is to add text to the left and to the right of the selected region. This looks like a good candidate for a separate operator. I'd not try to fit any use case that operates on a selected text range into "add surrounding".
Both - not really, because redundant. Supplying range (left + right + selection type) is enough to get the text, although it would need to account for the selection type (charwise/linewise/blockwise). Should be doable, but I'd rather wait for a reasonable use case where computation of output surrounding might depend on the surrounded text range.
It does work with any single character supported by |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I’m trying to implement
sal
wherel
stands forlog
, similar to what’s shown in YouTube: Neovim: Save HOURS by building a Macro collection in your Config.For example,
After running
saiwl
, it becomes:The idea is to use
mini.surround
for this purpose:Would it be a good idea to pass
text
andrange
into theoutput
function for better scriptability?Also,
mini.surround
only supports single-letter mappings, so something like["<C-l>"]
doesn’t work. It could be useful in the same fashion as function keys. For example:sal
→ surround withl
sa<C-l>
→ surround with a log statementThank you for the response :0
Beta Was this translation helpful? Give feedback.
All reactions