after luasnip
This commit is contained in:
parent
0abe06adc2
commit
89fd2eb367
28
nvim/.config/nvim/after/plugin/luasnip.lua
Normal file
28
nvim/.config/nvim/after/plugin/luasnip.lua
Normal file
@ -0,0 +1,28 @@
|
|||||||
|
local ls = require "luasnip"
|
||||||
|
|
||||||
|
ls.config.set_config {
|
||||||
|
history = true,
|
||||||
|
updateevents = "TextChanged,TextChangedI",
|
||||||
|
}
|
||||||
|
|
||||||
|
vim.keymap.set({ 'i', 's' }, "<c-k>", function()
|
||||||
|
if ls.expand_or_jumpable() then
|
||||||
|
ls.expand_or_jump()
|
||||||
|
end
|
||||||
|
end, { silent = true })
|
||||||
|
|
||||||
|
vim.keymap.set({ 'i', 's' }, "<c-j>", function()
|
||||||
|
if ls.jumpable(-1) then
|
||||||
|
ls.jump(-1)
|
||||||
|
end
|
||||||
|
end, { silent = true })
|
||||||
|
|
||||||
|
vim.keymap.set({ 'i', 's' }, "<c-l>", function()
|
||||||
|
if ls.choice_active() then
|
||||||
|
ls.change_choice(1)
|
||||||
|
end
|
||||||
|
end, { silent = true })
|
||||||
|
|
||||||
|
ls.add_snippets("lua", {
|
||||||
|
ls.parser.parse_snippet("tc", "-- TODO: $0."),
|
||||||
|
}, { key = "my_lua" })
|
Loading…
x
Reference in New Issue
Block a user