substitute.nvim icon indicating copy to clipboard operation
substitute.nvim copied to clipboard

[Feature Request] substitute/exchange operator provides 2 motion calls.

Open fovj opened this issue 1 year ago • 1 comments

For example, if the cursor is on props and press gs<motion1><motion2>, motion1 will replace motion2.

({ props }) -- press gsiwa{ on props

becomes:

(props)

This may seem useless on its own, but when combined with plugins like flash.nvim remote mode, operation can be performed even when the cursor is not on that text.

For example, exchange import and Homepage even cursor is not on them.

https://github.com/gbprod/substitute.nvim/assets/4456413/991a1faa-439b-4695-9eac-fe6c1180c86a

substitute<motion1><motion2> and exchange<motion1><motion2> will make it faster like this.

fovj avatar Feb 02 '24 02:02 fovj

That's a great idea! I'll try to do something soon.

gbprod avatar Feb 02 '24 06:02 gbprod