Replies: 2 comments 7 replies
-
The way to do this would be to check if a whitespace character exists (or newline character specifically, if that's what you want) in the require("nvim-surround").setup({
surrounds = {
["{"] = {
delete = "^(.%s*)().-(%s*.)()$",
},
}
} This can be repeated for the closing curly brace as well. |
Beta Was this translation helpful? Give feedback.
0 replies
-
Thanks for the suggestion, but it isn't working in the above example: when I press {
if (x)
{
y = z; *cursor on this line*
}
} Press if (x)
y = z;
}
} Anyway what's the string being matched by this lua pattern? Does it include newlines, so that they can be deleted? |
Beta Was this translation helpful? Give feedback.
7 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I've previously used vim-sandwich, that can be configured to delete empty lines after deleting brackets. Take the following example:
After pressing
ds}
with cursor on line 3:But I'd like lines 2 and 4 to be deleted:
Is there a way to delete empty lines after deleting brackets?
Beta Was this translation helpful? Give feedback.
All reactions