The article mentions ”gn” in passing, but it doesn’t give it enough credit: this is an enormously useful motion, almost more useful on its own than the rest of the article. The thing that makes it golden is that it is a motion, and thus combined with a command, it is repeatable! So, like: 1. Search for something (either using / or *). 2. Type ”cgn” in Normal mode (i.e. change next search match) and replace what you s…
A Vim Guide for Advanced Users
21–30 of 179 posts
Re: A Vim Guide for Advanced Users
#22Re: A Vim Guide for Advanced Users
#23Earlier quoted context omitted.
As someone who uses this regularly, it's still not as convenient as multi cursors that most modern ides give you. There's a vim extension for multiple cursors but it's a little buggy.
I dunno, I’ve also used both, and I keep coming back to the Vim/gn way of doing it, I just like it more. I see how people can feel otherwise, though.
⁰https://sr.ht/~martanne/vis/ ¹http://doc.cat-v.org/bell_labs/structural_regexps/ ²http://doc.cat-v.org/bell_labs/sam_lang_tutorial/ ³http://kakoune.org/
Re: A Vim Guide for Advanced Users
#24The article mentions ”gn” in passing, but it doesn’t give it enough credit: this is an enormously useful motion, almost more useful on its own than the rest of the article. The thing that makes it golden is that it is a motion, and thus combined with a command, it is repeatable! So, like: 1. Search for something (either using / or *). 2. Type ”cgn” in Normal mode (i.e. change next search match) and replace what you s…
Thank you for the tip.
Re: A Vim Guide for Advanced Users
#25The article mentions ”gn” in passing, but it doesn’t give it enough credit: this is an enormously useful motion, almost more useful on its own than the rest of the article. The thing that makes it golden is that it is a motion, and thus combined with a command, it is repeatable! So, like: 1. Search for something (either using / or *). 2. Type ”cgn” in Normal mode (i.e. change next search match) and replace what you s…
Most of the time it's more keystrokes than using :s though, so I'm not a big fan of it. But I see the appeal :)
Re: A Vim Guide for Advanced Users
#26Nice, but still wondering if I should know vim since nano is enough for me :)
Re: A Vim Guide for Advanced Users
#27Thank you! Two things I really got from this: Capital marks. I use ma or ms and `a `s a lot, but did not know you could do global marks with mA and `A. Very useful! I've been using `` for a long time to mean "go back to the last place I was editing" but sometimes it gets overridden when navigating (I'm not super familiar with the jumplist, so maybe I need to get a better understanding) but `[ and `] are exactly what…
You'll go through the change list. I think it's what you want.
I explain it in the article vim-intermediate on the same blog :)
Re: A Vim Guide for Advanced Users
#28The article mentions ”gn” in passing, but it doesn’t give it enough credit: this is an enormously useful motion, almost more useful on its own than the rest of the article. The thing that makes it golden is that it is a motion, and thus combined with a command, it is repeatable! So, like: 1. Search for something (either using / or *). 2. Type ”cgn” in Normal mode (i.e. change next search match) and replace what you s…
Yeah I know the trick and I explain it a bit more in another article on my blog. Most of the time it's more keystrokes than using :s though, so I'm not a big fan of it. But I see the appeal :)
Re: A Vim Guide for Advanced Users
#29Practical vim by Drew Neil is hands down the best vim learning resource out there. Nothing even comes close.
Re: A Vim Guide for Advanced Users
#30The article mentions ”gn” in passing, but it doesn’t give it enough credit: this is an enormously useful motion, almost more useful on its own than the rest of the article. The thing that makes it golden is that it is a motion, and thus combined with a command, it is repeatable! So, like: 1. Search for something (either using / or *). 2. Type ”cgn” in Normal mode (i.e. change next search match) and replace what you s…