vi - swap various size words in multiple lines with vim -
vi - swap various size words in multiple lines with vim -
i've got code manual encoding/decoding, need extend. encoding looks like:
class="lang-cpp prettyprint-override">map["some_key"] = some_struct.member; map["some_other_key"] = some_other_struct.member;
to decode need swap parts of text around '=' (ex. have some_struct.member = map["some_key"]). needless it's lot of lines have edit, wanted automate somehow. i'm using vim, best come pad "] part "_____] have '=' align , ctrl+v, d, ... know. there improve way of doing this?
use macro:
" start macro, saving in q register qq " (edit 1 line want) " end recording q " visually select other lines, nail :, vim starts command line '<,'> :'<,'>norm @q
my q register edit lines:
^"xd/ = xxx$i = jk"xp
i have jk mapped esc, you'll need else there.
vim vi
Comments
Post a Comment