Releases: yousefakbar/notmuch.nvim
Releases · yousefakbar/notmuch.nvim
v0.3.0
v0.3.0 - 2026-02-11
Added
- HTML body rendering via
w3mformultipart/alternativeemails- New
render_html_bodyconfig option (default:false) - Graceful fallback when
w3mis not installed
- New
- New
thread.luamodule for JSON-based thread display parsing - Per-message tag display in thread view header
- Attachment count indicator (📎) in message headers
- MIME part markers in message body for attachments and HTML content
- Buffer-local variables for thread metadata (enables statusline integration and user extensibility)
vim.b.notmuch_thread- Thread-level metadata (ID, subject, tags, authors, message count)vim.b.notmuch_messages- Array of all messages in thread with metadatavim.b.notmuch_current- Cursor-tracked current message data with position infovim.b.notmuch_status- Formatted statusline string showing message position and sender
- FFI bindings for
notmuch_database_open_with_config(notmuch 5.4+/API 0.32+) - Automatic notmuch version detection at module load with result caching
- Warning notification when using deprecated API (notmuch < 0.32)
- Configuration option
suppress_deprecation_warningto suppress API deprecation warnings - Optional email address argument for
:Inboxcommand to filter by recipient (to:field)- Includes autocomplete for email addresses from notmuch database
- New
"terminal"sync mode forsync.sync_mode— real PTY terminal with stdin support for GPG passphrase prompts and OAuth flows
Changed
- Thread display now uses
notmuch show --format=jsoninstead of raw text parsing- More robust parsing immune to text format changes
- Proper handling of complex MIME structures (multipart/mixed, multipart/alternative)
- Concatenates multiple inline text parts (body, signatures, mailing list footers)
- Now fetches HTML content (
--include-html) for optional rendering
- Message ID lookup now uses buffer-local variables instead of regex parsing
- Replaces
util.find_cursor_msg_id()withthread.get_current_message_id() - Cursor position automatically tracked via
CursorMovedautocmd - Eliminates redundant buffer scans for message operations
- Replaces
- Database opening now uses
notmuch_database_open_with_configwhen available, with fallback to deprecatednotmuch_database_open - Version detection runs once at module load for improved performance
- Major refactoring: Completed migration from Vimscript to pure Lua implementation
- Deleted
plugin/notmuch.vimandautoload/notmuch.vim(Vimscript plugin files) - Ported all command definitions to Lua using
vim.api.nvim_create_user_command - Ported command-line completion functions from Vimscript to Lua module (
completion.lua) - Completion functions now filter results based on user input for better UX
- Removed dependency on Vimscript autoload functions and global Vim command registration
- Deleted
- Attachment view handler now uses
vim.system()for table-format commands (more secure and modern) - MIME type pattern matching in attachment handlers now uses anchored patterns for more precise matching and better performance
Deprecated
util.process_msgs_in_thread()- replaced bythread.show_thread()with JSON parsing
Fixed
- Correct notmuch version number detection (checks API version 0.32 instead of library version 5.4)
- Attachment view handler now correctly detects command success using exit codes instead of relying solely on
vim.v.shell_error - Buffer validity checks before write operations to prevent errors when buffer is deleted during async operations
- Exact buffer name matching using escaped regex patterns to prevent partial matches when switching to existing search buffers
- Corrected thread count upon search completion
- Terminal window positioning for sync (bottom-right)
Performance
- Kill notmuch search process when the buffer is deleted (avoids orphaned processes)
- Anchored patterns in attachment handlers for more precise MIME type matching
Documentation
- Installation instructions for Neovim v0.12+ builtin package manager (
vim.pack.add) - Buffer-local variables reference in README and help docs (
:help notmuch-buffer-variables) render_html_bodyconfiguration option with w3m dependency notew3mlisted as optional dependency for HTML rendering
v0.2.0
[0.2.0] - 2026-01-09
Added
- Sort toggle (
okeymap) in thread results buffer to reverse search order (newest-first ↔ oldest-first) - Exit code detection and auto-close terminal on successful email send
- In-buffer attachment viewer for text-based files (text, markdown, PDFs)
- Dedicated
handlers.luamodule with comprehensive file type support for attachments- OS-aware external opening (macOS, Linux, Windows)
- Graceful fallbacks for HTML, PDF, images, Office documents, markdown, and archives
- Interactive save prompt for attachments with validation
- Directory validation and writability checks
- Overwrite confirmation
- Path expansion support (~, environment variables)
- Hints line in
notmuch-attachbuffers with syntax highlighting - Attachment support for composing mail via
<C-g><C-a>keymap - Attachment support for replies using command-based interface
:Attach,:AttachList,:AttachRemovecommands with tab completion
- MIME message builder for multipart emails with attachments
- Improved msmtp logging and multi-account support
logfileconfig option for msmtp--read-envelope-fromflag for multiple sending accounts
- Delete functionality for threads
:DelThreadcommand (bound toddin normal mode,din visual mode)Dkey to preview deletion,DDto confirm purge
- Enhanced search term autocompletion
- Added
is:,to:,from:,body:, and logical expressions (and,or,not) - Autocomplete for
mimetype:,to:,from:,path:, andfolder:search
- Added
:ComposeMailnow accepts optional recipient with autocomplete- Visual mode support for tag operations (
+,-,=,a,A,x) in threads view fkey binding to toggleflaggedtag in threads view (normal and visual mode)- Fail-fast validation for notmuch configuration on plugin load
- Hint in compose message body showing attachment window keymap
Changed
- BREAKING: Renamed
open_cmdconfig option toopen_handler(now a callback function) - Send email now uses terminal buffer instead of background process
- Path expansion for user-override
notmuch_db_pathconfig (handles~and relative paths) - Attachment listing now uses JSON parsing instead of grep for reliability
- Recursive MIME tree parsing
- Accurate part IDs, filenames, sizes, and disposition indicators
- Sync operation improvements
- Now runs asynchronously
- Displays sync command and user-friendly status text
- Statusline notifications on success/failure
<C-c>cancellation only works when sync is running
- Tag command mappings now include trailing space for better UX
- Single-part MIME for plaintext emails without attachments
- Optimized bulk thread tagging by reusing database connection (reduces N connections to 1)
- Sync mode configuration now uses
sync.sync_modestructure
Fixed
- Buffer write notifications silenced during email composition
- Removed duplicate
skeymap for saving attachment parts - Visual mode mappings reverted to
:prefix instead of<Cmd> - Keymap definitions now use
<Cmd>for better reliability - Cross-platform tempfile creation using
vim.fn.tempname()instead ofmktemp - Message ID sanitization for reply filenames (prevents invalid file paths)
- View attachment floating buffer now properly unlisted
- Last-ditch fallback added when filetype not supported in view handler
- Attachment handling now uses
vim.splitinstead of custom string splitting - Shell-escaped naming for attachment paths
- Sync cancellation keymap race condition
- UI sync export issue
- Tag operations now use
nnoremapinstead ofnmapto prevent conflicts - Compose buffer content retained if attachment validation fails
- Attachment validation now checks for existence and accessibility
- Body content no longer parsed as email headers (RFC 5322 compliance)
- Added support for header continuation (folded headers)
- Empty lines in attachment buffer no longer cause errors
- MIME module function naming issues
- Cross-platform folder/path autocomplete with special character support
- Removed BSD-incompatible
sed -z - Added shell injection protection
- Auto-quotes paths with spaces or brackets
- Removed BSD-incompatible
Security
- Fixed command injection vulnerability in
sendmail()function- Replaced string concatenation with proper argument escaping
- Now uses
vim.fn.system()with array arguments
v0.1.0
Initial (informal) baseline release shared in early 2025.