https://github.com/anufrievroman/neomutt-file-picker
Attach and save files in NeoMutt using Ranger or Vifm as your file picker
https://github.com/anufrievroman/neomutt-file-picker
mutt neomutt ranger vifm
Last synced: 10 months ago
JSON representation
Attach and save files in NeoMutt using Ranger or Vifm as your file picker
- Host: GitHub
- URL: https://github.com/anufrievroman/neomutt-file-picker
- Owner: anufrievroman
- Created: 2020-05-28T03:37:14.000Z (about 6 years ago)
- Default Branch: master
- Last Pushed: 2022-10-06T08:39:08.000Z (over 3 years ago)
- Last Synced: 2025-05-13T03:47:38.279Z (about 1 year ago)
- Topics: mutt, neomutt, ranger, vifm
- Language: Shell
- Homepage:
- Size: 7.81 KB
- Stars: 15
- Watchers: 2
- Forks: 5
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# NeomuttFilePicker
- Attach files to your emails in [NeoMutt](https://github.com/neomutt/) using [Ranger](https://github.com/ranger/ranger) or [Vifm](https://github.com/vifm) as your file manager.
- Choose a directory to store attachments with Ranger or Vifm
The main script is based on the [this topic](https://www.reddit.com/r/commandline/comments/cbxvdf/combine_neomutt_with_ranger/) and improved to allow attaching mulptiple files with spaces in the name and path.
## Attaching files
1. Copy the `filepicker` file to your `.config/mutt` or wherever is your config directory.
2. Add the following line to your `.muttrc` so that you can attach files with `A`
```
macro compose A "bash $HOME/.config/mutt/filepickersource $HOME/.config/mutt/tmpfilebash $HOME/.config/mutt/filepicker clean" "Attach with your file manager"
```
3. Now, on the email sending screen (when you already wrote the text and saved it) type `A` instead of standard `a` 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.
## Saving attachments
1. Copy the `dirpicker` file to your `.config/mutt` or wherever is your config directory.
2. Add the following line to your `.muttrc` so that you can choose the folder where to store files with `S`
```
macro attach S "bash $HOME/.config/mutt/dirpickersource $HOME/.config/mutt/tmpfileo" "Choose folder with ranger"
```
3. Now, on the attachment screen (by default, reached with `v`), type `S` instead of standard `s` to call the script. The file manager should appear. Choose the folder with ranger, quit with `q`. Mutt may then ask for the filename in the folder.
## Settings
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.
## Issues
- You might need to make the script executable if you have error about permissions. For example: `chmod =rwx filepicker`
## TODO
- The dirpicker should be adapted to handle several attachments at once (perhaps with ripmime or munpack?)