Hacker News new | ask | show | jobs
by Repulsion9513 775 days ago
You can of course get plenty of "refactor" plugins for vim out there but I've never found a need for one. Even in more complex codebases with multiple instances of a local variable like you mention, I tend to do more "find-and-replace in selection": V to Visually select a block, then just :s/foo/bar/g
1 comments

Generally with you

That said, many of these refactor systems are multi-file capable. Or even more fancy, they understand for example that an export is being renamed & update all consumers, leaving all other uses of that variable name as-is.

I'm a pretty mediocre but long time vim user. I don't intend to leave. But I remain interested in codemod tools that can help me reshape code at scale.

You do use LSP don't you? There's refactoring tools there, I really fail to see how Neo/Vim is lacking in this regard. Sure, it requires some deeper understanding and setup, but that is the Vim way. For people that do not want to deal with this there's IntelliJ or VSCode.