parent
7932fb1d55
commit
7d1e320c30
4 changed files with 55 additions and 37 deletions
9
roles/neovim/files/lua/opdavies/snippets/javascript.lua
Normal file
9
roles/neovim/files/lua/opdavies/snippets/javascript.lua
Normal file
|
@ -0,0 +1,9 @@
|
|||
local luasnip = require "luasnip"
|
||||
local snippet = luasnip.s
|
||||
|
||||
local insert = luasnip.insert_node
|
||||
local text = luasnip.text_node
|
||||
|
||||
return {
|
||||
snippet({ trig = "log", dscr = "console.log" }, { text "console.log(", insert(1, "value"), text ");" }),
|
||||
}
|
14
roles/neovim/files/lua/opdavies/snippets/markdown.lua
Normal file
14
roles/neovim/files/lua/opdavies/snippets/markdown.lua
Normal file
|
@ -0,0 +1,14 @@
|
|||
local luasnip = require "luasnip"
|
||||
local snippet = luasnip.s
|
||||
|
||||
local insert = luasnip.insert_node
|
||||
local text = luasnip.text_node
|
||||
|
||||
return {
|
||||
snippet({ trig = "frontmatter", dscr = "Document frontmatter" }, {
|
||||
text { "---", "tags: " },
|
||||
insert(1, "value"),
|
||||
text { "", "---", "" },
|
||||
insert(0),
|
||||
}),
|
||||
}
|
23
roles/neovim/files/lua/opdavies/snippets/php.lua
Normal file
23
roles/neovim/files/lua/opdavies/snippets/php.lua
Normal file
|
@ -0,0 +1,23 @@
|
|||
local luasnip = require "luasnip"
|
||||
local snippet = luasnip.s
|
||||
|
||||
local choice = luasnip.choice_node
|
||||
local insert = luasnip.insert_node
|
||||
local text = luasnip.text_node
|
||||
|
||||
return {
|
||||
snippet({ trig = "test", dscr = "Test block" }, {
|
||||
text { "/* @test **/", "" },
|
||||
text "public function ",
|
||||
choice(1, {
|
||||
text "test",
|
||||
text "it",
|
||||
text "should",
|
||||
}),
|
||||
insert(2), -- The method name.
|
||||
text { "(): void {", "" },
|
||||
text " ",
|
||||
insert(0), -- The method body.
|
||||
text { "", "}" },
|
||||
}),
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue