aboutsummaryrefslogtreecommitdiff
path: root/common/nvim/lua/plugins/notify.lua
blob: 62a8f4735b1b87e345566a9377273b34cd839b6f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
local M = {}

function M.setup()
  local ok, notify = pcall(require, 'notify')
  if not ok or not notify then
    return false
  end

  notify.setup({
    background_colour = '#000000',
    icons = {
      ERROR = '',
      WARN = '',
      INFO = '',
      DEBUG = '',
      TRACE = '✎',
    }
  })

  -- Set highlight groups safely
  local function set_hl(group, link)
    vim.cmd(('hi default link %s %s'):format(group, link))
  end

  set_hl('NotifyERRORBody', 'Normal')
  set_hl('NotifyWARNBody', 'Normal')
  set_hl('NotifyINFOBody', 'Normal')
  set_hl('NotifyDEBUGBody', 'Normal')
  set_hl('NotifyTRACEBody', 'Normal')
  set_hl('NotifyLogTime', 'Comment')
  set_hl('NotifyLogTitle', 'Special')

  return true
end

return M