Vocola macro for multiple file search and replace in VIM editor using Dragon NaturallySpeaking

Returned to vim as primary IDE recently because for various reasons visual studio code wasn’t playing nicely in cross-platform environments.
Currently working in Golang & C (including developing bindings with CGO).
Good results with nerdtree, ctrlp, ctags, cscope, omnicomplete plugins for code navigation (with the relevant vocola macros for key-binding incantations).

But by far the most surprising experience was search and replace in multiple files without a plug-in:


# utility macros
EscWait() := {esc} Wait(200); # IDEs sometimes need delay between keypress
CmdWait() := EscWait() ":" Wait(200); # IDEs sometimes need delay between keypress
<...Snip...>
## search and replace in multiple files without plug-in
search with = CmdWait() "let @z=''" {left_1};
LoadReg() := Wait(200) {ctrl+r} Wait(200) "z" Wait(200);
replace in files = CmdWait() "args `grep -r -l '' .`" {left_4} LoadReg() {enter} CmdWait() "argdo %s///gc | update" {left_13} LoadReg() {right_1};
<...Snip>

reference: this post

I’m finding this extremely useful and wanted to share.

Thanks again Mark and others for Natlink / Vocola.

Leave a Reply

Your email address will not be published. Required fields are marked *