It's hard not to love Vim when substitutions and movement is as beatiful as it is. The commands of the day are:
Let's go through them a bit more in detail:
:g/exp1/d - cut (delete) the text that matches the expression1 inside the "//".
ggVG - go to the top (gg), go into 'mark mode' (V) and then go to the EOF (G). This is performed in ordinary command mode.
:retab! - Let's replace whitespaces with real tabs instead.
:%s/exp1/exp2/g - Replace expression1 with expression2, and do it for all occurences on every line (g).
:g!/IMPORT.*\n/dThese few commands actually lets us completely reformat a block of text, remove comments, add variable names and then turn it into a list of functions again. Sweeet.
ggVG
:retab!
:g/\t.*\s.*\s/d
:%s/(\(.*\),/(KCommand\1,"\1"/g
:%s/_LIT(K\(.*\),.*);/TBool CAudioMgmtServerWrapper::\1()/g
Let's go through them a bit more in detail:
:g/exp1/d - cut (delete) the text that matches the expression1 inside the "//".
ggVG - go to the top (gg), go into 'mark mode' (V) and then go to the EOF (G). This is performed in ordinary command mode.
:retab! - Let's replace whitespaces with real tabs instead.
:%s/exp1/exp2/g - Replace expression1 with expression2, and do it for all occurences on every line (g).
1 comment:
Post a Comment