Skip to content

Commit 7a03455

Browse files
committed
feat(noice): add macro recording notifications
1 parent 993b1fc commit 7a03455

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed

lua/plugins/noice.lua

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,30 @@ return {
44
lazy = false,
55
opts = {},
66
config = function()
7+
vim.api.nvim_create_autocmd("RecordingEnter", {
8+
callback = function()
9+
local msg = string.format("Recording Mode for: %s", vim.fn.reg_recording())
10+
_MACRO_RECORDING_STATUS = true
11+
vim.notify(msg, vim.log.levels.INFO, {
12+
title = "Macro Recording",
13+
keep = function()
14+
return _MACRO_RECORDING_STATUS
15+
end,
16+
})
17+
end,
18+
group = vim.api.nvim_create_augroup("NoiceMacroNotfication", { clear = true }),
19+
})
20+
21+
vim.api.nvim_create_autocmd("RecordingLeave", {
22+
callback = function()
23+
_MACRO_RECORDING_STATUS = false
24+
vim.notify("Record Finished!", vim.log.levels.INFO, {
25+
title = "Macro Recording End",
26+
timeout = 2000,
27+
})
28+
end,
29+
group = vim.api.nvim_create_augroup("NoiceMacroNotficationDismiss", { clear = true }),
30+
})
731
require("noice").setup {
832
presets = {
933
bottom_search = false, -- use a classic bottom cmdline for search

0 commit comments

Comments
 (0)