diff --git a/config/nvim/lazy-lock.json b/config/nvim/lazy-lock.json index f4a5a94..0e98aa6 100644 --- a/config/nvim/lazy-lock.json +++ b/config/nvim/lazy-lock.json @@ -24,6 +24,7 @@ "nvim-colorizer.lua": { "branch": "master", "commit": "36c610a9717cc9ec426a07c8e6bf3b3abcb139d6" }, "nvim-lspconfig": { "branch": "master", "commit": "1bc83418927003552505ec66fa5d6cffae953f6a" }, "nvim-luaref": { "branch": "main", "commit": "9cd3ed50d5752ffd56d88dd9e395ddd3dc2c7127" }, + "nvim-notify": { "branch": "master", "commit": "5371f4bfc1f6d3adf4fe9d62cd3a9d44356bfd15" }, "nvim-tree.lua": { "branch": "master", "commit": "8cbb1db8e90b62fc56f379992e622e9f919792ce" }, "nvim-treesitter": { "branch": "master", "commit": "b444afa1dacd3d031c0ffe4763671d89afda5ddb" }, "nvim-treesitter-refactor": { "branch": "master", "commit": "65ad2eca822dfaec2a3603119ec3cc8826a7859e" }, diff --git a/config/nvim/lua/fschauen/plugins/nvim-notify.lua b/config/nvim/lua/fschauen/plugins/nvim-notify.lua new file mode 100644 index 0000000..22c78ac --- /dev/null +++ b/config/nvim/lua/fschauen/plugins/nvim-notify.lua @@ -0,0 +1,48 @@ +local M = { 'rcarriga/nvim-notify' } + +local telescope_notify = function() + local ts = vim.F.npcall(require, 'telescope') + if not ts then return end + + local theme = require('telescope.themes').get_dropdown { + results_title = ' Results ', + prompt_title = '  Notifications ', + } + + local notify = ts.extensions.notify or ts.load_extension('notify') + notify.notify(theme) +end + +M.keys = { + { 'n', 'Notifications', desc = 'Display notification history' }, + { 'fn', telescope_notify, desc = ' [N]otifications' }, +} + +M.lazy = false + +M.config = function() + local icons = require('fschauen.icons') + local notify = require('notify') + + notify.setup { + icons = { + ERROR = icons.diagnostics_bold.Error, + WARN = icons.diagnostics_bold.Warn, + INFO = icons.diagnostics.Info, + DEBUG = icons.diagnostics.Debug, + TRACE = icons.diagnostics.Trace, + }, + fps = 24, + max_width = 50, + minimum_width = 50, + render = 'wrapped-compact', + stages = 'fade', + time_formats = { notification_history = '%F %T' }, + top_down = true, + } + + vim.notify = notify +end + +return M +