Mayor of the Plattenbaus
Mayor of the Plattenbaus

Reputation: 1266

Describe vim replacements

In almost every copy of vim that I have used, the program will give a description of changes after replacing text. (For example, something like "92 substitutions on 20 lines" would be displayed.)

I'm now working with a copy of vim that does not do that by default.

Is there a simple command (or addition I can make to my vimrc file) that will enable this behavior?

Upvotes: 3

Views: 119

Answers (3)

Ingo Karkat
Ingo Karkat

Reputation: 172590

I think you experience the effects of the 'report' option. If the (substitution, or any other command's) changes cover more than those (default 2), you'll see the message, else nothing.

So, you can put the following into your ~/.vimrc to always see those messages:

set report=0

Upvotes: 5

phd
phd

Reputation: 94483

It's governed by option report.

You can see you current setting with

set report?

To report even the minimal change

set report=0

Upvotes: 5

JJoao
JJoao

Reputation: 5347

Although not exactly your question, in vim's substitutions, you can use the "n" flag to count the number of matches and lines (without real substitutions).

Example

:%s/a//gn
55311 matches on 17459 lines 

Upvotes: 1

Related Questions