feat: error log snippet for go; changed events for the relative-toggle plugin

This commit is contained in:
2025-07-28 11:52:29 +03:00
parent 7a09de8673
commit df4c9e0d88
2 changed files with 16 additions and 2 deletions

View File

@@ -5,8 +5,8 @@ return {
require("relative-toggle").setup({
pattern = "*",
events = {
on = { "BufEnter", "FocusGained", "InsertLeave", "WinEnter", "CmdlineLeave" },
off = { "BufLeave", "FocusLost", "InsertEnter", "WinLeave", "CmdlineEnter" },
on = { "InsertLeave" },
off = { "InsertEnter" },
},
})
end

14
nvim/lua/snippets/go.lua Normal file
View File

@@ -0,0 +1,14 @@
local ls = require("luasnip")
local s = ls.snippet
local t = ls.text_node
local i = ls.insert_node
return {
-- zap log contents the way i like it
s("zaplog", {
t({ "", "" }),
t({ "\t\"" }), i(1), t({ "\"," }), i(3),
t({ "\t", "\tzap.Error(" }), i(2), t({ ")" })
}),
}