summaryrefslogtreecommitdiff
path: root/ar/.config/TheSiahxyz/lua/thesiahxyz/snippets/whichkey.lua
blob: fab585364c514144261388dfeda5e9b87d85695f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
local ls = require("luasnip")

-- Using parse_snippet instead of fmt to avoid curly brace issues
local whichkey_snippet = ls.parser.parse_snippet(
	"whichkey",
	[[
init = function()
    local wk = require("which-key")
    wk.add({
        mode = { "n" },
        { "${1:Key}", group = "${2:Name}" },
    })
end,
]]
)

-- Add the snippets for the Lua filetype
ls.add_snippets("lua", { whichkey_snippet })