Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

I don't think you understand what I mean with the language aware rename. It's not even close to %s. Let's say I've got a c# app and I rename a class in VS. This will rename the class in the file, all class usages (but not as text - if I rename A.B, then it will not touch X.B due to different namespaces), including other projects in the solution, optionally will rename the file it lives in and optionally will/won't replace the text in comments. All listed for review and approval and I don't have to have any of those files open ahead of time.


This is something that the LSP provides (even in VScode), and is available in nvim yes. The command is vim.lsp.buf.rename(), and it is bound to "grn" by default.

https://neovim.io/doc/user/lsp.html#vim.lsp.buf.rename() (HN seems to not link the () part, you have to add it yourself)

All the other similar fanciness like renaming a file and automatically updating module references is also provided by the LSP, and is also available in nvim.


That's cool. This was not easily accessible last time I used plain nvim. I'm glad the functionality has made its way there.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: