How to base64-decode a file line by line

vim

I have a file which is encoded by base64:

5byg5bCP5piO
c2FyYWg=
5p2O56OK

I want to decode it line by line:

:%!base64 -d

But I get everything in one line:

张小明sarah李磊

What I want is:

张小明
sarah
李磊

How can I do it?

Best Answer

Another solution is the following, which works nicely for me.

%g/^/.!base64 -d