Using plugins to do the job
“Wait,” you exclaim. “There were plugins to do this all along?” Indeed, there are plugins that support refactoring operations—be it modifying parameters, renaming, or method extraction.
However, when working with existing refactoring solutions, I always find they do almost, but not quite, what I need. That’s why I continue to write fancy substitute commands for refactoring. I find the cost of incorporating a refactoring plugin into my workflow, only to switch to :substitute
commands for some of my refactoring needs, to be too high.
At the time of writing this book, there’s no go-to refactoring plugin. Some are language-specific, and some focus on only certain aspects of refactoring. For instance, plugins like YouCompleteMe provide semantically aware renaming commands (such as :
YcmComplete RefactorRename
).
Your best bet is to figure out for yourself which operations you want to perform and try out...