Native Notifications
Use coc.nvim built-in message and progress notifications without replacing Vim notification functions.
Native Notifications
coc.nvim has a native notification UI for extension messages and progress. Notification windows appear at the bottom-right when the relevant message or progress configuration selects the floating UI.
This is different from the retired nvim-notify monkey-patch recipe: native notifications work on supported Vim popup windows and Neovim floating windows without overriding vim.notify or coc#ui#echo_messages.
Message behavior
Extensions use window.showInformationMessage(), window.showWarningMessage(), and window.showErrorMessage(). Plain reports default to Vim echo because coc.preferences.messageReportKind defaults to "echo". Interactive messages default to Vim confirm behavior.
Set coc.preferences.enableMessageDialog when you want interactive messages to use the notification interface:
| 1 | { |
| 2 | "coc.preferences.enableMessageDialog": true, |
| 3 | "coc.preferences.messageReportKind": "notification" |
| 4 | } |
Fallback and progress filtering
A notification window is not the default for every message. Plain reports fall back to Vim echo, and interactive messages use the configured dialog method (confirm by default). Progress also falls back to the status line because notification.statusLineProgress defaults to true; set it to false when progress should use a notification window instead.
Use notification.disabledProgressSources to suppress progress from selected sources. Set it to * in the notification settings to disable all message-only progress, or list the source names that should be filtered.
Extension API
Use window.showNotification() for a custom notification with a title, kind, content, and optional buttons. The callback receives the selected button index, or -1 when the window closes without a button.
| 1 | import { window } from 'coc.nvim' |
| 2 | |
| 3 | await window.showNotification({ |
| 4 | kind: 'info', |
| 5 | title: 'Indexer', |
| 6 | content: 'Workspace index is ready', |
| 7 | buttons: [{ index: 0, text: 'Open log' }], |
| 8 | callback: index => { |
| 9 | if (index === 0) window.showInformationMessage('Opening log') |
| 10 | } |
| 11 | }) |
Use window.withProgress() for cancellable work. By default notification.statusLineProgress is true, so progress is shown in the status line; set it to false to use notification windows.
User controls
coc#notify#close_all()closes all notification windows.coc#notify#do_action()invokes the current notification action.coc#notify#copy()copies notification content.coc#notify#show_sources()reveals extension/source names.coc#notify#keep()stops auto-hide timers.:CocList notificationsopens notification history.
Settings and highlights
Search notification settings to configure border, focusability, timeout, dimensions, right margin, progress width, winblend, status-line progress, and disabled progress sources.
Use g:coc_notify for icons and the CocNotification* highlight groups for content, borders, buttons, and shortcuts.
Source of truth: :h coc-notification.