I use them all the time for:
- Commenting on blocks of code
- copying and moving blocks of code,
- yanking and removing blocks of code in named buffers and
- Edit: replacing the testing unit.
A comment:
- go to the first line of code you want to comment,
- mark it, for example. enter
ma - go to end of block
- enter
:'a,.s/^/#(or any other comment character you need)
Copy and move:
- , ,
- , /.
- , .
mb - , ,
:'a,'bco . :'a,'bmo . .
:
- , ,
- , .
- enter
:'a,.ya a a :'a,.ya a a
: :
- , ,
- ,
:'a,.s/search_string/replace_string/[gc], . "g" "c" .
: , , 'a ( a) , , `a ( a) , .
So `ad`b (bactic-ad-backtic-b) - char, 'a', char char, b.
, Vim :reg , . .