1

Re: Search and replace options

I don't fully understand how the search and replace options work...

This is how (I think) it works in Vim (7.1.2):
:s/search/replace/      " Case sensitive search that replaces the first match
:s/search/replace/i     " Case insensitive search that replaces the first match
:s/search/replace/Ig   " Case sensitive search that replaces all matches
:s/search/replace/gc   " Case sensitive search that replaces all matches but asks for confirmation before each replacement.

How does it work in ViEmu?

//Tobbe

Last edited by Tobbe (2007-12-17 17:26:15)

2

Re: Search and replace options

Hi Tobbe,

The current version of ViEmu only supports the 'g' flag, which toggles the 'global' flag (same as in vim, :set gdefault makes :s substitute all matches in a line by default).

Apologies for the limitation, I plan to incorporate extra flags support in future versions. The 'c' flag is the most requested so far.

Best regards,

  Jon

3

Re: Search and replace options

Thanks for the fast reply.

So there is currently no way to control case sensitivity?

4

Re: Search and replace options

Hi Tobbe,

Indeed, there is, albeit possibly not so convenient. :set [no]ignorecase and and :set [no]smartcase are honored. Regardless of these settings' current values, you can use \c or \C anywhere in the search regex pattern to force case insensitivity (\c) or case sensitivity (\C).

Regards,

  Jon

5

Re: Search and replace options

Thanks for clearing that up smile

6

Re: Search and replace options

No problem, you're welcome!

7

Re: Search and replace options

What context do you mean when we say global?

Entire Solution
Entire Project
Current File

Thanks,

Shane

8

Re: Search and replace options

Hi Shane,

As in vim, the 'g'lobal flag to :s means applying the change to all instances of the pattern in the line, unlike the non-'g'lobal behavior which means applying it to just the first instance.

ViEmu doesn't provide multi-file search & replace options, for that you need to use Visual Studio's built-in features.

Regards,

  Jon

9

Re: Search and replace options

This is somewhat unrelated, but I've noticed that while :s/Something/Another thing/g works as expected, going to a different line and typing :sg does not. Are there any plans to include this functionality in a future release?

Thanks,
Nick

10

Re: Search and replace options

Pieps,

I didn't even know that ":sg" was acceptable syntax! I haven't taken note of this to implement it in a future version. Meanwhile, you can use :&g as a synonym that ViEmu does recognize.

Regards,

  Jon