What I don’t understand is the development workflow that includes so much text manipulation. If you’re writing new code, there’s nothing to manipulate. If you’re refactoring existing code, wouldn’t you want the support typical AST-based refactoring tools provide? Where’s the sweet spot where shuffling strings around makes sense?
That’s not sarcasm. I’m genuinely asking.
1. LSPs differ per-language, and so I'm never sure whether I'll get lucky today or not. It's more reliable for small changes to talk about them in terms of the text.
2. LSPs are also quite slow. For example in Zed I can do a quick local rename with `ga` to multi-cursor onto matching words and then `s new_name` to change it. (For larger or cross-file renames I still use the LSP).
3. I err as a human continually, for example in Rust a string is `"a"` and a char is `'a'`. It's easy for my javascript addled brain to use the wrong quotes. I don't know of any LSP operation that does "convert string literal into char literal" (or vice versa), but in vim, it's easy.
We are slowly pulling in support for various vim plugins; but the tail is long and I am not likely to build a vim-compatible Lua (or VimScript :D) API any time soon.
For example, most of vim-surround already works so you could get the most used parts of mini.surround to work with just a few keybindings `"s a":["vim::PushOperator", { "AddSurrounds": {} }]`, but rebuilding every plugin is a labor of love :D.
At mega-scale, even IDE based tools are skipped in favor of automated tools such as Refaster/OpenRewrite that can refactor 10s of millions of lines of code at once.
I do find myself occasionally using, say, a regex find/replace to change something project wide. But most of the time (95% to put some arbitrary number on it), once I’m beyond the scope of single function, I use AST-based tools to ensure changes are correctly reflected in other files or parts of the project.
So, I’m trying understand to who lives in my 5% long enough that they the need what is essentially a highly specialized regex. Are they doing cross-project changes based on text? Do they have giant functions where that’s not a concern? Are their projects just smaller and they have many of them?
I definitely see the allure of having a smaller, faster editor. How far are people actually able to push that paradigm?
Switching is not feasible for me until they get mini.surround[0] and Flash.nvim[1], particularly Flash's treesitter mode (see screenshot of [1] to get an idea).
They work particularly well together to select semantically meaningful chunks of code and add/remove/change surrounding parens/braces/curlies/etc.
0: https://github.com/echasnovski/mini.surround
1: https://github.com/folke/flash.nvim