From 4a39624193a0e35ccf41dde9bc4fc69ee86d63a0 Mon Sep 17 00:00:00 2001 From: Toby Vincent Date: Sun, 1 Jan 2023 17:03:33 -0600 Subject: fix(nvim,noice): route Neogit notifs to mini view --- nvim/.config/nvim/lua/tobyvin/plugins/noice.lua | 28 +++++++++++++++++++------ 1 file changed, 22 insertions(+), 6 deletions(-) (limited to 'nvim/.config') diff --git a/nvim/.config/nvim/lua/tobyvin/plugins/noice.lua b/nvim/.config/nvim/lua/tobyvin/plugins/noice.lua index 500de0f..5dee123 100644 --- a/nvim/.config/nvim/lua/tobyvin/plugins/noice.lua +++ b/nvim/.config/nvim/lua/tobyvin/plugins/noice.lua @@ -57,6 +57,21 @@ local M = { }, opts = { stop = false }, }, + { + view = "mini", + filter = { + event = "notify", + any = { + { + error = false, + warning = false, + cond = function(message) + return vim.tbl_get(message, "opts", "title") == "Neogit" + end, + }, + }, + }, + }, }, views = { hover = { @@ -98,16 +113,16 @@ function M.init() end, }) - vim.keymap.set("n", "nl", function() - require("noice").cmd("last") - end) - vim.keymap.set("n", "nn", function() require("noice").cmd("history") end) - vim.keymap.set("n", "nh", function() - require("noice").cmd("all") + vim.keymap.set("n", "nl", function() + require("noice").cmd("last") + end) + + vim.keymap.set("n", "ne", function() + require("noice").cmd("errors") end) -- TODO: figure out why setting `remap = true` failes to call the `zz` mapping @@ -123,6 +138,7 @@ function M.init() end end, { desc = "down half page and center", expr = true }) + -- NOTE: copied from folke's config, not confident it's necessary vim.api.nvim_create_autocmd("FileType", { pattern = "markdown", callback = function(event) -- cgit v1.2.3-70-g09d2