From 5c9394f5e5b58ed92673ea0a44e3bf0c934b65ed Mon Sep 17 00:00:00 2001 From: Bruno BELANYI Date: Fri, 11 Mar 2022 10:38:42 +0100 Subject: [PATCH] WIP: home: vim: notify --- home/vim/after/plugin/mappings/telescope.lua | 2 ++ home/vim/default.nix | 1 + home/vim/plugin/settings/notify.lua | 14 ++++++++++++++ home/vim/plugin/settings/telescope.lua | 1 + 4 files changed, 18 insertions(+) create mode 100644 home/vim/plugin/settings/notify.lua diff --git a/home/vim/after/plugin/mappings/telescope.lua b/home/vim/after/plugin/mappings/telescope.lua index 0867b36..e0d38a7 100644 --- a/home/vim/after/plugin/mappings/telescope.lua +++ b/home/vim/after/plugin/mappings/telescope.lua @@ -1,4 +1,5 @@ local wk = require("which-key") +local telescope = require("telescope") local telescope_builtin = require("telescope.builtin") local keys = { @@ -9,6 +10,7 @@ local keys = { F = { telescope_builtin.find_files, "Files" }, g = { telescope_builtin.live_grep, "Grep string" }, G = { telescope_builtin.grep_string, "Grep string under cursor" }, + n = { telescope.extensions.notify.notify, "Notification history" }, }, } diff --git a/home/vim/default.nix b/home/vim/default.nix index a9c2bda..9b8ba86 100644 --- a/home/vim/default.nix +++ b/home/vim/default.nix @@ -88,6 +88,7 @@ in # UX improvements dressing-nvim # Integrate native UI hooks with Telescope etc... gitsigns-nvim # Fast git UI integration + nvim-notify # Better notification API nvim-surround # Deal with pairs, now in Lua telescope-fzf-native-nvim # Use 'fzf' fuzzy matching algorithm telescope-lsp-handlers-nvim # Use 'telescope' for various LSP actions diff --git a/home/vim/plugin/settings/notify.lua b/home/vim/plugin/settings/notify.lua new file mode 100644 index 0000000..b68c90f --- /dev/null +++ b/home/vim/plugin/settings/notify.lua @@ -0,0 +1,14 @@ +local notify = require("notify") + +notify.setup({ + icons = { + DEBUG = "D", + ERROR = "E", + INFO = "I", + TRACE = "T", + WARN = "W", + }, + stages = "slide", +}) + +vim.notify = notify diff --git a/home/vim/plugin/settings/telescope.lua b/home/vim/plugin/settings/telescope.lua index 4548ec5..ed8ebc7 100644 --- a/home/vim/plugin/settings/telescope.lua +++ b/home/vim/plugin/settings/telescope.lua @@ -22,3 +22,4 @@ telescope.setup({ telescope.load_extension("fzf") telescope.load_extension("lsp_handlers") +telescope.load_extension("notify")