Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have a file which is encoded by base64:


I want to decode it line by line:

:%!base64 -d

But I get everything in one line:


What I want is:


How can I do it?

share|improve this question
up vote 2 down vote accepted

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

%g/^/.!base64 -d
share|improve this answer
:g/./.!base64 -d – kev Dec 19 '11 at 7:07
vimgolfist? ;-) Yeah, the % is in case of :g redundant. Also the . regexp makes sense - no use to try to decode empty lines. – Martian Dec 19 '11 at 12:36
:%normal !!base64 -d^M

:{range}norm[al][!] {commands}                          *:normal-range*
                        Execute Normal mode commands {commands} for each line
                        in the {range}.  Before executing the {commands}, the
                        cursor is positioned in the first column of the range,
                        for each line.  Otherwise it's the same as the
                        ":normal" command without a range.
                        {not in Vi}
                        Not available when |+ex_extra| feature was disabled at
                        compile time.
share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.