Vim: FEATURE: `gn` text object support for matching the last search term

Created on 7 Aug 2017  路  6Comments  路  Source: VSCodeVim/Vim

  • Click thumbs-up 馃憤 on this issue if you want it!
  • Click confused 馃槙 on this issue if not having it makes VSCodeVim unusable.

The VSCodeVim team prioritizes issues based on reaction count.


FEATURE REQUEST

In Vim I loved the gn text object (not sure if it was exactly a text object. It would be matching always the last used search term. So for example you could search for foo with /foo and then change then next match of this search term with cgn or delete with dgn.

Now this gives you the possibility to jump and modify the next search match in one go. That comes especially handy when combined with . So for renaming foo to bar in a file you search for it with /foo, press cgn type the new name bar and repeat with .

So I request to include the gn text matching into the VSCodeVim as it is a very useful feature.

RESOURCES

Here is a blog post and a vimcast about the topic:
http://alexkuang.com/blog/2015/01/24/gn-in-vim/
http://vimcasts.org/episodes/operating-on-search-matches-using-gn/

help wanted kinfeature sizL

Most helpful comment

Thanks @tyru! 馃帀

Super excited about this!

All 6 comments

This is one of my most used vanilla vim features. I just downloaded vs-code today and this was the first things I checked to see if it works.

Same here. Please bring back cgn.

Same for me. Need this all the time.

The question is, why do these core functions need to be ported anyway into vscode-vim. Isn't there any way to implement this using neovim in the background? Could solve all problems of this kind in the future, plus we could add plugins and use vscode just as a gui for neovim... Like oni does for example. I did not look into the code of either ones, but isn't this possible somehow?

Thanks @tyru! 馃帀

Super excited about this!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

gerardmrk picture gerardmrk  路  3Comments

Jimmy-Z picture Jimmy-Z  路  3Comments

typeoneerror picture typeoneerror  路  3Comments

WangRongda picture WangRongda  路  3Comments

edwintorok picture edwintorok  路  3Comments