Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature request: gn/gN motions #1449

Closed
academician opened this issue Sep 19, 2014 · 3 comments
Closed

Feature request: gn/gN motions #1449

academician opened this issue Sep 19, 2014 · 3 comments

Comments

@academician
Copy link

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.

@academician academician changed the title Feature request: gn/GN motions Feature request: gn/gN motions Sep 19, 2014
@jaredpar
Copy link
Collaborator

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

@ricksladkey
Copy link
Collaborator

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

@ricksladkey
Copy link
Collaborator

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 .....

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants