Vsvim: Feature request: gn/gN motions

Created on 20 Sep 2014  ·  3Comments  ·  Source: VsVim/VsVim

I recently learned about a pair of motions that Vim added in patch 7.3.610 (gn and gN) which reference the last used search pattern. This allows you do do things like "dgn" to delete the next match, or cgn to change the next match. If used on their own, they visually select the next match.

Since many of these types of things can technically be done with ":s", they may not be strictly necessary, but it does seem like it could make some of my editing patterns more efficient.

feature request motion

All 3 comments

I will try and get that added to a future version. Looks pretty straight forward, mostly just need to get a newer build of gVim so i can play around with the feature

I have a working version of this. I'll submit a PR when I am finished.

This was harder than I thought it would be, mainly because gn has different semantics in each of its three different flavors: as a motion, as a normal command, and as a visual command. Nevertheless, the infrastructure of VsVim does all the heavy lifting and we just have to coordinate the various actors.

One of the things I like about working on VsVim is getting exposed to these kind of features in vivid detail, like, reference manual level detail. I'm pretty sure gn is going to "get into my fingers" because it really hits the spot for repeating those two part edit actions that look end with n.n.n.n. but can now all be .....

Was this page helpful?
0 / 5 - 0 ratings

Related issues

jaredpar picture jaredpar  ·  5Comments

kalebpederson picture kalebpederson  ·  6Comments

elrob picture elrob  ·  6Comments

ogirginc picture ogirginc  ·  6Comments

keithn picture keithn  ·  4Comments