Describe the replacement for vim

In almost every copy of vim I have used, the program will provide a description of the changes after the text is replaced. (For example, something like "92 replacements by 20 lines" will be displayed.)

I am now working with a copy of vim which does not do this by default.

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

+3


source to share


3 answers


It is controlled by the report option .

You can see the current setting with

set report?

      



To communicate even the smallest change

set report=0

      

+4


source


I think you are experiencing the effects of the option 'report'

. If the changes (replacement or some other command) change more than those (default 2), you will see a message, otherwise nothing.

So, you can put the following in yours ~/.vimrc

to always see these messages:



set report=0

      

+4


source


Although not really your question, in vim substitutions you can use the "n" flag to count the number of matches and lines (no actual substitutions).

Example

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

      

+1


source







All Articles