AndrewRadev/sideways.vim

Move things in curly braces

moll opened this issue · 5 comments

moll commented

Hey,

Given that Sideways.vim already supports moving elements of arrays ([1, 2, 3]), how about supporting the same in curly braces ({a: 1, b: 2}) ? Plenty of languages use those for object/hashmap literals and it'd be convenient to move keys around. ;-)

This might, though, make moving those whole objects themselves left and right a little more difficult, but that's a different problem to solve as it also affects how to move a whole array around when the cursor is in that array.

I've pushed a commit to master that should implement this. Could you play around with it, see if it works right?

moll commented

Thank you!

I'm confident it works because you write tests. Don't you find it funny that sometimes we don't even need to look at things manually to get that confidence. :)

moll commented

Mind rewording a little pet-peeve of mine — the "JSON-like dictonaries" phrase? :)
The "N" in JSON stands for notation, like XML, so it's not a dictionary itself, merely a form of serializing data (incl. primitives). You probably meant "JavaScript-like objects". :)

Done.

moll commented

Thanks. You're awesome!