alextsui05 / VimAddin

Fork of the vi modes core addin in MonoDevelop.
28 stars 14 forks source link

Support vim-like substitution #2

Open japboy opened 10 years ago

japboy commented 10 years ago

Please support vim-like search and replace:

Like this:

:%s/Foo/Bar/cg
alextsui05 commented 10 years ago

I'm looking into it now. The command format should look like

:[range]s/{pattern}/{string}/[flags]

but currently, a range is not expected and needs to be parsed.

alextsui05 commented 10 years ago

This feature is still not done yet, but please make use of this workaround for now, using features available in the addin as of version 1.1:

  1. Place the cursor over the token you would like to replace.
  2. Press [#] or *[]** to search for it. This will highlight all instances of the token.
  3. Use [cw] to replace the token with the new string that you want.
  4. Use [n] to go to the next instance of the token.
  5. Use [.] to replace the token with the string that you typed previously.
  6. Repeat steps 4-5 until all instances are replaced.
japboy commented 10 years ago

:+1: