Re:Amp: Vi-like terminal editor written in Rust
by rapind on Monday April 12, 2021 @07:10PM
(#26786303)
But itβs still just search and replace right, like renaming a variable or function, or am I missing something?
[ Parent
| on HN ]
Re:Amp: Vi-like terminal editor written in Rust
by atoav on Saturday April 17, 2021 @05:03AM
(#26842746)
What you are missing, is that you get cursors that you can manipulate. Overwriting what they selected is the obvious thing (and then it would be indeed the same as search and replace) β but there are some less obvious things that make this thing powerful in a different way E.g.:
1. select the next 3 occurances of "foo"
2. Press End on keyboard to jump to end of line (even if the part after "foo" was different each time)
3. Start typing away
You can also use the arrow keys to move the cursors, hold shift to do selections, alt + arrow to jump to the next/previous word and so on. Of course all of this can be done with regexes as well, but it takes longer usually to come up with just the right one, even if you are good with them.
Re:Amp: Vi-like terminal editor written in Rust
by sullyj3 on Tuesday April 13, 2021 @12:04AM
(#26788024)
The difference is the interactivity and instantaneous feedback. I don't want to have to blindly write a regex substitution when I could instead be seeing what is happening at each step, right in front of me.
Re:Amp: Vi-like terminal editor written in Rust
by sagarm on Tuesday April 13, 2021 @02:55AM
(#26788925)
Neovim gives you a preview of the result of your regex replacement, and with the ability to reference capture groups it's a pretty powerful.
Re:Amp: Vi-like terminal editor written in Rust
by sullyj3 on Tuesday April 13, 2021 @04:31AM
(#26789606)
Yeah, I'm a neovim user, and I enjoy that feature. There are just times when multiple cursors would be ever so slightly more ergonomic.