Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Suppose i'm in vim editing the file ~/hello.txt

I would like to send this files as an attachment with mutt from vim using some terminal command.

What does such a command look like?

share|improve this question

2 Answers 2

up vote 1 down vote accepted

The command looks like this:

:!mutt -s "your subject" -a ~/hello.txt --  addressee@some.org < /dev/null

Since you're executing it within Vim and editing the attachment, you could also use this:

:!mutt -s "your subject" -a % -- addressee@some.org < /dev/null

You didn't say anything about a message body, so I just used an empty message body by redirecting stdin from /dev/null.

share|improve this answer

How would you do it from your shell?

You can execute shell commands from Vim with:

:!command %

where command is the external command and % is the current file.

share|improve this answer

Your Answer

 
discard

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.