A powerful and flexible mail reader interface for NeoVim. This plugin bridges your email and text editing experiences directly within NeoVim by interfacing with the Notmuch mail indexer.
Notmuch.nvim is a NeoVim plugin that serves as a front-end for the Notmuch mail indexer, enabling users to read, compose, and manage their emails from within NeoVim. It facilitates a streamlined workflow for handling emails using the familiar Vim interface and motions.
- 📧 Email Browsing: Navigate emails with Vim-like movements.
- 🔍 Search Your Email: Leverage
notmuch
to search your email interactively. - 🔗 Thread Viewing: Messages are loaded with folding and threading intact.
- 📎 Attachment Management: View and save attachments easily.
- ⬇️ Offline Mail Sync: Supports
mbsync
for efficient sync processes. - 🔓 Async Search: Large mailboxes with thousands of email? No problem.
- 🏷️ Tag Management: Conveniently add, remove, or toggle email tags.
- 🔭 (WIP)
Telescope.nvim Integration: Search interactively, extract URL's, jump efficiently, with the powerful file picker of choice.
- NeoVim: Version 0.5 or later is required due to LuaJIT support.
- Notmuch: Ensure Notmuch and libnotmuch library are installed
- (WIP)
Telescope.nvim: File picker of choice for many use cases.
You can install Notmuch.nvim using your favorite NeoVim plugin manager.
{
'yousefakbar/notmuch.nvim',
config = function()
-- Configuration goes here
local opts = {}
require('notmuch').setup(opts)
end,
}
Clone the repository and add the directory to your runtimepath
:
git clone https://github.com/yousefakbar/notmuch.nvim.git
Here are the core commands within Notmuch.nvim:
-
:Notmuch
: Lists available tags in your Notmuch database in a buffer. Setup key bindings for easy access. Example:-- Define a keymap to run `:Notmuch` and launch the plugin landing page vim.keymap.set("n", "<leader>n", "<CMD>Notmuch<CR>")
-
:NmSearch <query>
: Executes an asynchronous search based on provided Notmuch query terms." Loads the threads in your inbox received today :NmSearch tag:inbox and date:today
You can configure several global options to tailor the plugin's behavior:
Option | Description | Default value |
---|---|---|
notmuch_db_path |
Directory containing the .notmuch/ dir |
$HOME/Mail |
maildir_sync_cmd |
Bash command to run for syncing maildir | mbsync -a |
open_cmd |
Bash command for opening attachments | xdg-open |
keymaps |
Configure any (WIP) command's keymap | See config.lua 1 |
Example in plugin manager (lazy.nvim):
{
"yousefakbar/notmuch.nvim",
opts = {
notmuch_db_path = "/home/xxx/Documents/Mail"
maildir_sync_cmd = "mbsync personal"
keymaps = {
sendmail = "<C-g><C-g>",
},
},
},
This project is licensed under the MIT License, granting you the freedom to use,
copy, modify, merge, publish, distribute, sublicense, and/or sell copies. The
MIT License's full text can be found in the LICENSE
section of the project's
documentation.
For more details on usage and advanced configuration options, please refer to
the in-depth plugin help within NeoVim: :help notmuch
.