Skip to content

ObserverOfTime/notifications.nvim

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

28 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

notifications.nvim

Show notifications on the desktop.

Platforms

  • Linux/BSD (glib2)
  • Windows (PowerShell)
  • macOS (AppleScript)

The plugin also supports OSC 777, OSC 99, and OSC 9.

Installation

lazy.nvim

{
  'ObserverOfTime/notifications.nvim',
  opts = {
    override_notify = true,
    hist_command = 'Notifications',
    -- or set `icons = false` to disable all icons
    icons = {
      TRACE = '', -- '🔍',
      DEBUG = '󰠭', -- '🐞',
      INFO  = '', -- '📣',
      WARN  = '', -- '⚠️ ',
      ERROR = '', -- '🚨',
      OFF   = '', -- '⛔',
    },
    hl_groups = {
      TRACE = 'DiagnosticFloatingHint',
      DEBUG = 'DiagnosticFloatingHint',
      INFO = 'DiagnosticFloatingInfo',
      WARN = 'DiagnosticFloatingWarn',
      ERROR = 'DiagnosticFloatingError',
      OFF = 'DiagnosticFloatingOk',
    }
  },
  -- to use OSC 777/99/9:
  --[[
  config = function(_, opts)
    vim.g.notifications_use_osc = '777'
    require('notifications').setup(opts)
  end
  --]]
}

pckr.nvim

{
  'ObserverOfTime/notifications.nvim',
  config = function()
    -- to use OSC 777/99/9:
    -- vim.g.notifications_use_osc = '777'
    require('notifications').setup {
      ...
    }
  end
}

Usage

Send a notification

vim.notify('Hello world', vim.log.levels.INFO, {
  icon = '󱇎',
  title = 'Test',
  critical = true
})

View the history

:Notifications