DEV Community

Discussion on: Yank hard wrapped text, or how to paste your vim markdown into dev.to

Collapse
 
jesusgollonet profile image
jesús gollonet

Hah nice! And shorter! and with regex! This is super elegant.

Not sure about edge cases but I'll give it a go and let you know. On a first look, your undo gets rid of one of my annoyances, which is that my solution was reformatting code blocks too, which you might want to leave untouched.

It also doesn't rely on where you are on the file. Mine was breaking if I was on the bottom line.

So far yours def wins in my book. Making it more worth having shared my solution. Thanks!

Collapse
 
coreyja profile image
Corey Alexander

Ahh I didn't think about code blocks really. Mine is gonna single line all codeblocks I think lol Which probably isn't the best!

So that's at least one edge case to think about!

Thanks again for the fun post, I enjoyed it haha