nvim: add Twig snippets for Storybook
This commit is contained in:
parent
8d07d76e2b
commit
5b1f41a2e1
31
config/neovim/lua/opdavies/snippets/ft/twig.lua
Normal file
31
config/neovim/lua/opdavies/snippets/ft/twig.lua
Normal file
|
@ -0,0 +1,31 @@
|
|||
local fmta = require("luasnip.extras.fmt").fmta
|
||||
local ls = require "luasnip"
|
||||
|
||||
local i = ls.insert_node
|
||||
|
||||
local M = {
|
||||
stories = fmta(
|
||||
[[
|
||||
{% stories <name> with { title: '<title>' } %}
|
||||
|
||||
<finish>
|
||||
|
||||
{% endstories %}
|
||||
]],
|
||||
{ name = i(1), title = i(2), finish = i(0) }
|
||||
),
|
||||
|
||||
story = fmta(
|
||||
[[
|
||||
{% story <name> with {
|
||||
name: '<label>',
|
||||
args: {},
|
||||
} %}
|
||||
<finish>
|
||||
{% endstory %}
|
||||
]],
|
||||
{ name = i(1, "default"), label = i(2), finish = i(0) }
|
||||
),
|
||||
}
|
||||
|
||||
return M
|
Loading…
Reference in a new issue