A minimalist Neovim plugin that captures all notifications from vim.notify into a dedicated register.
Have you ever seen an important error message from your LSP or linter flash by as a notification, only for it to disappear before you could fully read or copy it?
notify-log.nvim solves this simple problem by acting as a silent logger. It intercepts every message sent to vim.notify, and in addition to letting it display normally, it appends the message to a specific register, creating a persistent log of all notifications for your current session.
- Silent Interception: Automatically captures all
vim.notifymessages without altering their appearance. - Persistent Log: Appends all notifications to a configurable named register.
- Log Management: Provides simple commands to clear the log or copy its entire contents to the system clipboard.
- Lightweight & Simple: Does one job and does it well, with no dependencies.
Install the plugin with your favorite package manager.
-- Add this to your plugins list
return {
"BSeblu/notify-log.nvim",
event = "VeryLazy",
opts = {
-- configuration options here (see below)
},
}use {
"BSeblu/notify-log.nvim",
config = function()
require("notify-log").setup({
-- configuration options here (see below)
})
end,
}The plugin works automatically once installed. All notifications will be logged to the configured register (default is "n").
You can then use standard Vim commands to paste the log, for example: "np in normal mode will paste the contents of the notification log.
The plugin provides two commands for managing the log:
-
:ClearNotifyLog- Clears all captured content from the notification register.
-
:CopyNotifyLog- Copies the entire content of the notification register to your system clipboard (
+register).
- Copies the entire content of the notification register to your system clipboard (
The plugin is plug-and-play with sensible defaults, but you can override them by passing an opts table in Lazy.nvim or calling the setup function.
Here are the default settings:
-- For Lazy.nvim, you pass these in the `opts` table.
-- For other managers, you pass them to the `setup()` function.
{
-- The named register to store notifications in.
register = "n",
-- The message to display when the log is cleared.
clear_message = "Notification log cleared.",
-- The message to display when the log is copied.
copy_message = "Notification log copied to clipboard.",
-- The message to display when trying to copy an empty log.
empty_message = "Notification log is empty.",
-- The title used for this plugin's own notifications.
plugin_name = "Notify Log",
}return {
"your-username/notify-log.nvim",
event = "VeryLazy",
opts = {
register = "l", -- Log to the 'l' register instead of 'n'
plugin_name = "Logger",
},
}