new snippet for golang
This commit is contained in:
parent
c448f89268
commit
def2a93c3f
|
|
@ -1,16 +1,10 @@
|
||||||
local ls = require 'luasnip'
|
local ls = require 'luasnip'
|
||||||
local s = ls.snippet
|
local s = ls.snippet
|
||||||
local t = ls.text_node
|
local t = ls.text_node
|
||||||
local i = ls.insert_node
|
|
||||||
|
|
||||||
return {
|
return {
|
||||||
s('main', {
|
|
||||||
t { 'func main() {', '\t' },
|
|
||||||
i(1),
|
|
||||||
t { '', '}' },
|
|
||||||
}),
|
|
||||||
|
|
||||||
s('reverseString', {
|
s('reverseString!', {
|
||||||
t {
|
t {
|
||||||
'func reverseString(s string) string {',
|
'func reverseString(s string) string {',
|
||||||
'\trunes := []rune(s)',
|
'\trunes := []rune(s)',
|
||||||
|
|
@ -21,4 +15,5 @@ return {
|
||||||
'}',
|
'}',
|
||||||
},
|
},
|
||||||
}),
|
}),
|
||||||
|
-- new snipp
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue