-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgo.lua
More file actions
40 lines (32 loc) Β· 657 Bytes
/
go.lua
File metadata and controls
40 lines (32 loc) Β· 657 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
-- REQUIRED {{{
local ls = require("luasnip")
local s = ls.s --> snippet
local i = ls.i --> insert node
local t = ls.t --> text node
local d = ls.dynamic_node
local c = ls.choice_node
local f = ls.function_node
local sn = ls.snippet_node
local fmt = require("luasnip.extras.fmt").fmt
local rep = require("luasnip.extras").rep
local snippets, autosnippets = {}, {}
-- }}}
-- BOILER PLATE SNIPPET {{{
local boiler = fmt(
[[
package main
import (
"fmt"
)
func main() {{
fmt.Println("{}")
}}
]],
{
i(1, "<++>"),
}
)
local boiler_snippet = s("!main", boiler)
table.insert(autosnippets, boiler_snippet)
-- }}}
return snippets, autosnippets