You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
the wiki states that it includes sql snippets. However when i go into a .sql file and start typing, no snippets come up. In fact there is no completion box showing or anything. what could i be doing wrong? below is a snippet (pun intended) of my neovim config if it helps.
localcmp=require("cmp")
require("luasnip.loaders.from_vscode").lazy_load()
--require("luasnip").config.setup {} -- from https://youtu.be/Co7gcSvq6jA?list=PLko9chwSoP-2RxNuglpJriLO5HHXIcP6x&t=550localluasnip=require'luasnip'luasnip.config.setup {}
cmp.setup({
snippet= {
expand=function(args)
require("luasnip").lsp_expand(args.body)
end,
},
window= {
completion=cmp.config.window.bordered(),
documentation=cmp.config.window.bordered(),
},
-- https://github.com/nvim-lua/kickstart.nvim/blob/master/init.lua-- For an understanding of why these mappings were-- chosen, you will need to read `:help ins-completion`---- No, but seriously. Please read `:help ins-completion`, it is really good!mapping=cmp.mapping.preset.insert({
--['<C-n>'] = cmp.mapping.select_next_item(), -- this is used to move down the menu when the window pops up.--['<C-p>'] = cmp.mapping.select_prev_item(),--["<C-b>"] = cmp.mapping.scroll_docs(-4), -- sometimes the snippet will be longer than window. This is used to scroll further down.--["<C-f>"] = cmp.mapping.scroll_docs(4),--["<C-Space>"] = cmp.mapping.complete(),--["<C-e>"] = cmp.mapping.abort(),--["<CR>"] = cmp.mapping.confirm({ select = true }),-- Select the [n]ext item
['<C-n>'] =cmp.mapping.select_next_item(),
-- Select the [p]revious item
['<C-p>'] =cmp.mapping.select_prev_item(),
-- Scroll the documentation window [b]ack / [f]orward
['<C-b>'] =cmp.mapping.scroll_docs(-4),
['<C-f>'] =cmp.mapping.scroll_docs(4),
-- Accept ([y]es) the completion.-- This will auto-import if your LSP supports it.-- This will expand snippets if the LSP sent a snippet.
['<C-y>'] =cmp.mapping.confirm { select=true },
-- If you prefer more traditional completion keymaps,-- you can uncomment the following lines--['<CR>'] = cmp.mapping.confirm { select = true },--['<Tab>'] = cmp.mapping.select_next_item(),--['<S-Tab>'] = cmp.mapping.select_prev_item(),-- Manually trigger a completion from nvim-cmp.-- Generally you don't need this, because nvim-cmp will display-- completions whenever it has completion options available.
['<C-Space>'] =cmp.mapping.complete {},
-- Think of <c-l> as moving to the right of your snippet expansion.-- So if you have a snippet that's like:-- function $name($args)-- $body-- end---- <c-l> will move you to the right of each of the expansion locations.-- <c-h> is similar, except moving you backwards.
['<C-l>'] =cmp.mapping(function()
ifluasnip.expand_or_locally_jumpable() thenluasnip.expand_or_jump()
endend, { 'i', 's' }),
['<C-h>'] =cmp.mapping(function()
ifluasnip.locally_jumpable(-1) thenluasnip.jump(-1)
endend, { 'i', 's' }),
}),
-- https://youtu.be/_DnmphIwnjo?t=537sources=cmp.config.sources(
{
{ name="luasnip" },
{ name="nvim_lsp" },
{ name="path" }
},
{
{ name="buffer" }
} --TODO can i move into above block
),
})
-- https://github.com/hrsh7th/cmp-cmdline?tab=readme-ov-file#setup-- https://youtu.be/upM6FOtdLeU?t=239-- `/` cmdline setup.cmp.setup.cmdline('/', {
mapping=cmp.mapping.preset.cmdline(),
sources= {
{ name='buffer' }
}
})
-- `:` cmdline setup.cmp.setup.cmdline(':', {
mapping=cmp.mapping.preset.cmdline(),
sources=cmp.config.sources({
{ name='path' }
}, {
{
name='cmdline',
option= {
ignore_cmds= { 'Man', '!' }
}
}
})
})
require("luasnip.loaders.from_vscode").lazy_load()
-- https://www.youtube.com/watch?v=FmHhonPjvvAlocalls=require"luasnip"locals=ls.snippetlocalt=ls.text_nodelocali=ls.insert_nodels.add_snippets("lua", {
s("hello", {
t('print("hello world")'),
})
})
ls.add_snippets("all", {
s("lf",
{ t('local $1 = function ($2)\n $0\nend'), }
)
})
ls.snippets= {
all= {
-- Available in any filetypels.parser.parse_snippet("expand", "-- this is what was expanded!"),
},
}
The text was updated successfully, but these errors were encountered:
Based on the fact nothing shows, it seems like you might have not done this step. If you have let us know and someone is bound to be able to offer further assistance.
the wiki states that it includes sql snippets. However when i go into a .sql file and start typing, no snippets come up. In fact there is no completion box showing or anything. what could i be doing wrong? below is a snippet (pun intended) of my neovim config if it helps.
The text was updated successfully, but these errors were encountered: