We are switching from array() to [] in our php code. And when I start to do code refactoring I found that almost all arrays are specified with array() and not with []. How can I substitute it by vim?Example:// $this->set('log_access', array(    'target' => 'topic',    'id'     => $id));I want to change to:// $this->set('log_access', [    'target' => 'topic',    'id'     => $id]);And$opts    = array('http' => array('header' => 'User-Agent: iPhone-preview'));I want to change to:$opts    = ['http' => ['header' => 'User-Agent: iPhone-preview']];
How can I replace array(some_data) to [some_data]?
substitute
Certainly looks like a case for a macro/array<CR> to jump to the first arrayqq to record the macro into register qde to delete the word arrayma to save the cursor position on the first bracket at mark a%r] to jump to the matching bracket, replace it by another bracket`ar[ to jump back to position a and replace that bracketq to end recording of the macroAfter that, it's just repeatedly pressing n to jump to the next match and @q to play the macro. You could make the search part of the macro and just execute until it stops, but I thought you might prefer to visually check each substition... you choose :)