You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I tried sa_<enter>, but then it just surrounds that line with enter's code ^M, which i hardly think will be useful to anyone. Could we maybe intercept that ^M and actually surround the line with new lines? Or maybe there's already a way to achieve that that i'm missing?
Thanks a lot for your great work
The text was updated successfully, but these errors were encountered:
I don't think it is possible under current design. The closest you can get is via setting respect_selection_type = true and then using interactive surrounding ? like sa_?<CR><CR>. But this will indent current selection.
I've made several attempts to make it possible to write custom surrounding that would support this fully, but I don't think it is possible without changing 'mini.surround' code. The main problem is that for linewise selection left surrounding is applied to the first non-blank character. If it wasn't the case, then the following would work:
require('mini.surround').setup({
custom_surroundings= {
-- Use `<CR>` as surrounding identifier
['\r'] = { output= { left='\n', right='\n' } },
},
})
Currently, it will affect the indentation of first selected line.
As present behavior of special handling of indent in linewise selection seems to be more universally applicable, I don't think this will be possible in 'mini.surround'. I'd suggest using my previous advice on custom mapping or combination of go/gO from 'mini.basics'.
Contributing guidelines
Module(s)
Surround
Description
Basically what i wanted is:
With the cursor anywhere on line two:
get the following result:
I tried
sa_<enter>
, but then it just surrounds that line with enter's code^M
, which i hardly think will be useful to anyone. Could we maybe intercept that^M
and actually surround the line with new lines? Or maybe there's already a way to achieve that that i'm missing?Thanks a lot for your great work
The text was updated successfully, but these errors were encountered: