Re:Vim After 15 Years
by kioleanu on Wednesday October 26, 2022 @07:29PM
(#33351029)
Can vim and/or emacs do refactoring? That is a feature that I use daily and couldn’t live without
[ Parent
| on HN ]
Yes. Well, Emacs definitely can, and I have no doubt Vim can with the same tooling. For example, Emacs has excellent support for LSP. If a language server exists for your favorite language, and it supports refactoring, then so does Emacs.
You’ll find that most of what happens behind the scenes in vscode is available in neovim (and probably vim and emacs). The heavy lifting is done by lsps these days.
One notable exception is that neovim has treesitter, so you get immediate semantic analysis on your code which allows for much more flexible refactoring. Like everything in vim, you need to spend time setting these things up to streamline your common workflows.
Of course, both coc and lsp are your friends there. Want to change variable or function of class name or whatever? No problem. Take this piece of code and wrap it into a function, and where it once stood just place the function call? No problem. Etc.
Note that refactoring only exist for some language: for Java it exists in some IDE, for C++ no.
Re:Vim After 15 Years
by Liquid_Fire on Thursday October 27, 2022 @05:26AM
(#33355207)
CLion absolutely has refactoring for C++ (perhaps not as powerful as for Java, but there is plenty).