not quite sure what I've done here
This commit is contained in:
parent
b22873f45f
commit
83aaa5aef3
18 changed files with 392 additions and 392 deletions
|
|
@ -1,49 +1,49 @@
|
|||
local map = core.misc.map
|
||||
|
||||
return { "L3MON4D3/LuaSnip",
|
||||
branch = "v2.*",
|
||||
config = function()
|
||||
vim.cmd("make install_jsregexp")
|
||||
end,
|
||||
lazy = function(load)
|
||||
load:keymap({"i", "s"}, "<c-a>")
|
||||
load:keymap({"i", "s"}, "<c-e>")
|
||||
load:keymap({"i", "s"}, "<c-j>")
|
||||
load:keymap({"i", "s"}, "<c-k>")
|
||||
load:auto("InsertEnter")
|
||||
end,
|
||||
load = function()
|
||||
local ls = require("luasnip")
|
||||
branch = "v2.*",
|
||||
config = function()
|
||||
vim.cmd("make install_jsregexp")
|
||||
end,
|
||||
lazy = function(load)
|
||||
load:keymap({"i", "s"}, "<c-a>")
|
||||
load:keymap({"i", "s"}, "<c-e>")
|
||||
load:keymap({"i", "s"}, "<c-j>")
|
||||
load:keymap({"i", "s"}, "<c-k>")
|
||||
load:auto("InsertEnter")
|
||||
end,
|
||||
load = function()
|
||||
local ls = require("luasnip")
|
||||
|
||||
-- replace the builtin snippet handler with luasnip so I get all my fancy
|
||||
-- stuff
|
||||
vim.snippet.expand = ls.lsp_expand
|
||||
-- replace the builtin snippet handler with luasnip so I get all my fancy
|
||||
-- stuff
|
||||
vim.snippet.expand = ls.lsp_expand
|
||||
|
||||
ls.config.setup {
|
||||
keep_roots = true,
|
||||
link_roots = true,
|
||||
link_children = true,
|
||||
exit_roots = not true
|
||||
}
|
||||
ls.config.setup {
|
||||
keep_roots = true,
|
||||
link_roots = true,
|
||||
link_children = true,
|
||||
exit_roots = not true
|
||||
}
|
||||
|
||||
map({"i", "s"}, "<C-e>", ls.expand)
|
||||
map({"i", "s"}, "<C-j>", function() ls.jump(1) end)
|
||||
map({"i", "s"}, "<C-k>", function() ls.jump(-1) end)
|
||||
map({"i", "s"}, "<C-a>", function()
|
||||
if ls.choice_active() then
|
||||
ls.change_choice(1)
|
||||
end
|
||||
end)
|
||||
map({"i", "s"}, "<C-e>", ls.expand)
|
||||
map({"i", "s"}, "<C-j>", function() ls.jump(1) end)
|
||||
map({"i", "s"}, "<C-k>", function() ls.jump(-1) end)
|
||||
map({"i", "s"}, "<C-a>", function()
|
||||
if ls.choice_active() then
|
||||
ls.change_choice(1)
|
||||
end
|
||||
end)
|
||||
|
||||
-- collect all snippets and add them
|
||||
for _, file in ipairs(vim.api.nvim_get_runtime_file("lua/snippets/*.lua",
|
||||
true)) do
|
||||
local fn = file:gsub("^.*/", ""):gsub("%.lua$", "")
|
||||
-- collect all snippets and add them
|
||||
for _, file in ipairs(vim.api.nvim_get_runtime_file("lua/snippets/*.lua",
|
||||
true)) do
|
||||
local fn = file:gsub("^.*/", ""):gsub("%.lua$", "")
|
||||
|
||||
local ret = require("snippets."..fn)
|
||||
if type(ret) ~= "boolean" then
|
||||
ls.add_snippets(fn, ret, { key = fn })
|
||||
end
|
||||
end
|
||||
end
|
||||
local ret = require("snippets."..fn)
|
||||
if type(ret) ~= "boolean" then
|
||||
ls.add_snippets(fn, ret, { key = fn })
|
||||
end
|
||||
end
|
||||
end
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue