kickstart - working
This commit is contained in:
parent
a7ec8e276a
commit
989b3b4eba
4 changed files with 67 additions and 18 deletions
|
|
@ -8,10 +8,20 @@ local isn = ls.indent_snippet_node
|
|||
local t = ls.text_node
|
||||
local f = ls.function_node
|
||||
-- HELPER
|
||||
local filename = function()
|
||||
-- :p expand to full path
|
||||
-- :h head (last path component removed)
|
||||
-- :t tail (last path component only)
|
||||
-- :r root (one extension removed)
|
||||
-- :e extension only
|
||||
-- :lua print(vim.fn.expand '%:t') -- actual file only
|
||||
local full_filename = function()
|
||||
return { vim.fn.expand '%:p' }
|
||||
end
|
||||
|
||||
local filename = function()
|
||||
return { vim.fn.expand '%:t' }
|
||||
end
|
||||
|
||||
-- SNIPS
|
||||
ls.add_snippets('all', { -- `all` all filetypes, `lua` only lua ft
|
||||
s('luaxx', { t 'this is lua file!' }),
|
||||
|
|
@ -25,6 +35,13 @@ ls.add_snippets('all', { -- `all` all filetypes, `lua` only lua ft
|
|||
}, {
|
||||
f(filename, {}),
|
||||
}),
|
||||
s({
|
||||
trig = "long filename",
|
||||
namr = "long Filename",
|
||||
dscr = "insert canonical file name",
|
||||
}, {
|
||||
f(full_filename, {}),
|
||||
}),
|
||||
})
|
||||
---------------
|
||||
-- next line: allows use of snippet collection in vscode (??)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue