Using :norm, this transformation can be achieved in the following way:
:'<,'>norm I{^[eldedecw, "^[A"},
(where ^[ is a literal escape, typed CTRL-V ESC.)
Anecdotally, it is faster for me to type up such a line than an equivalent regular expression, since I use vi normal mode commands much more than regular expressions.
I would have piped this through awk, but this is probably better done with macros. Thanks for taking the time to elaborate. I will definitely give macros a try.
You need to know how dw, de, cw, ce relate to each other, when the cursor is on a token character vs. a whitespace character, and so on, in order for this to be truly useful -- but luckily, ordinary practice with those commands in Vim can lead to an efficient internal idea of how it works. "You get used to it, though. Your brain does the translating. I don't even see the code. All I see is blonde, brunette, redhead."
this is awesome, can you please suggest some resources for me, a long-time basic user of vim, ( know a lot of commands for actions, but not the underlying relationships?
Something i've been using more lately is Ctrl-R + Register. Great for inserting text in command mode. For instance, you can do this to insert your recorded macro (if it's in register q) as a norm command:
:norm Ctrl-R q
I would have almost simply started recording a macro, convert the first one using as many idempotent normal mode commands in place of insert mode commands as possible, and simply replayed it. Thanks for the idea.
As a side note, I love how Vim is basically a functional programming language for text editing.
Well you're leaving the middle columns there, then on your first keystrokes it would be acutally {+down+left as Sublime does not put cursor back at beginning of line when going down. In all I used 26 keystrokes in Sublime, and 27 in Vim. Also, if you understand Vim's vocabulary, the "cognitive overhead" is, as you put it "far less" in Vim's favor. IMO.
:%s/.)/hello)/
simpler? Maybe that's because I know nothing about macros. Thanks for the explanation.