- Attach files to your emails in NeoMutt using Ranger or Vifm as your file manager.
- Choose a directory to store attachments with Ranger or Vifm
The main script is based on the this topic and improved to allow attaching mulptiple files with spaces in the name and path.
- Copy the
filepicker
file to your.config/mutt
or wherever is your config directory. - Add the following line to your
.muttrc
so that you can attach files withA
macro compose A "<shell-escape>bash $HOME/.config/mutt/filepicker<enter><enter-command>source $HOME/.config/mutt/tmpfile<enter><shell-escape>bash $HOME/.config/mutt/filepicker clean<enter>" "Attach with your file manager"
- Now, on the email sending screen (when you already wrote the text and saved it) type
A
instead of standarda
to call the script. The file manager should appear. Choose files that you want to attach (tag them if multiple files) and hit Enter. Hit Enter twice more when asked.
- Copy the
dirpicker
file to your.config/mutt
or wherever is your config directory. - Add the following line to your
.muttrc
so that you can choose the folder where to store files withS
macro attach S "<shell-escape>bash $HOME/.config/mutt/dirpicker<enter><enter-command>source $HOME/.config/mutt/tmpfile<enter>o" "Choose folder with ranger"
- Now, on the attachment screen (by default, reached with
v
), typeS
instead of standards
to call the script. The file manager should appear. Choose the folder with ranger, quit withq
. Mutt may then ask for the filename in the folder.
In the filepicker
and dirpicker
files you can choose which file manager to use. Ranger by default, but you can uncomment Vifm and comment Ranger if you like.
- You might need to make the script executable if you have error about permissions. For example:
chmod =rwx filepicker
- The dirpicker should be adapted to handle several attachments at once (perhaps with ripmime or munpack?)