mirror of
https://github.com/CompeyDev/my-nvim-setup.git
synced 2024-12-13 05:20:38 +00:00
fix: Fixing the luasnip error while tabbing
This commit is contained in:
parent
57d0714362
commit
b63e1502a5
1 changed files with 7 additions and 4 deletions
|
@ -1,6 +1,5 @@
|
|||
vim.opt.completeopt = "menuone,noselect"
|
||||
|
||||
local lspkind = require "plugins.configs.lspkind_icons"
|
||||
local cmp = require "cmp"
|
||||
|
||||
-- nvim-cmp setup
|
||||
|
@ -13,7 +12,11 @@ cmp.setup {
|
|||
formatting = {
|
||||
format = function(entry, vim_item)
|
||||
-- load lspkind icons
|
||||
vim_item.kind = string.format("%s %s", lspkind.icons[vim_item.kind], vim_item.kind)
|
||||
vim_item.kind = string.format(
|
||||
"%s %s",
|
||||
require("plugins.configs.lspkind_icons").icons[vim_item.kind],
|
||||
vim_item.kind
|
||||
)
|
||||
|
||||
vim_item.menu = ({
|
||||
nvim_lsp = "[LSP]",
|
||||
|
@ -38,7 +41,7 @@ cmp.setup {
|
|||
["<Tab>"] = function(fallback)
|
||||
if vim.fn.pumvisible() == 1 then
|
||||
vim.fn.feedkeys(vim.api.nvim_replace_termcodes("<C-n>", true, true, true), "n")
|
||||
elseif luasnip.expand_or_jumpable() then
|
||||
elseif require("luasnip").expand_or_jumpable() then
|
||||
vim.fn.feedkeys(vim.api.nvim_replace_termcodes("<Plug>luasnip-expand-or-jump", true, true, true), "")
|
||||
else
|
||||
fallback()
|
||||
|
@ -47,7 +50,7 @@ cmp.setup {
|
|||
["<S-Tab>"] = function(fallback)
|
||||
if vim.fn.pumvisible() == 1 then
|
||||
vim.fn.feedkeys(vim.api.nvim_replace_termcodes("<C-p>", true, true, true), "n")
|
||||
elseif luasnip.jumpable(-1) then
|
||||
elseif require("luasnip").jumpable(-1) then
|
||||
vim.fn.feedkeys(vim.api.nvim_replace_termcodes("<Plug>luasnip-jump-prev", true, true, true), "")
|
||||
else
|
||||
fallback()
|
||||
|
|
Loading…
Reference in a new issue