neovim: Use Lua snippets for rstate
This commit is contained in:
parent
8205c6a269
commit
321c20de0d
3 changed files with 18 additions and 2 deletions
16
neovim/luasnippets/react.lua
Normal file
16
neovim/luasnippets/react.lua
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
local snippets = {
|
||||
-- const [show, setShow] = useState(false);
|
||||
s("rstate", {
|
||||
t("const ["),
|
||||
i(1),
|
||||
t(","),
|
||||
l(l._1:gsub("^%l", string.upper):gsub("^", "set"), 1),
|
||||
t("] = useState("),
|
||||
i(0),
|
||||
t(");"),
|
||||
}),
|
||||
}
|
||||
|
||||
local autosnippets = {}
|
||||
|
||||
return snippets, autosnippets
|
||||
Loading…
Add table
Add a link
Reference in a new issue