This commit is contained in:
newbie 2023-12-25 13:03:32 +08:00
parent 90c900c602
commit c2bfcb8ff8

View File

@ -78,7 +78,6 @@ return {
"jsonls",
"yamlls"
}
})
end
},
@ -157,7 +156,7 @@ return {
}
require("symbols-outline").setup(opts)
G.map({
{ "n", "<leader>o", "<cmd>SymbolsOutline<cr>", { noremap = true } },
{ "n", "<cs-o>", "<cmd>SymbolsOutline<cr>", { noremap = true } },
})
end
},
@ -201,8 +200,6 @@ return {
end,
}),
["<Tab>"] = cmp.mapping(function(fallback)
if cmp.visible() then
cmp.select_next_item()
@ -245,14 +242,6 @@ return {
local kind = require("lspkind").cmp_format({
mode = "symbol_text",
maxwidth = 50,
-- before = function(entry, vim_item)
-- vim_item.kind = kind_icons[vim_item.kind]
-- vim_item.menu = ({
-- buffer = "[Buffer]",
-- nvim_lsp = "[LSP]",
-- })[entry.source.name]
-- return vim_item
-- end,
})(entry, vim_item)
local strings = vim.split(kind.kind, "%s", { trimempty = true })
kind.kind = kind_icons[vim_item.kind]
@ -284,26 +273,7 @@ return {
{ name = 'buffer' },
}),
mapping = cmp.mapping.preset.insert({
['<CR>'] = cmp.mapping.confirm({ select = false }),
["<Tab>"] = cmp.mapping(function(fallback)
if cmp.visible() then
cmp.select_next_item()
elseif vim.fn["vsnip#available"](1) == 1 then
feedkey("<Plug>(vsnip-expand-or-jump)", "")
elseif has_words_before() then
cmp.complete()
else
fallback()
end
end, { "i", "s" }),
["<S-Tab>"] = cmp.mapping(function()
if cmp.visible() then
cmp.select_prev_item()
elseif vim.fn["vsnip#jumpable"](-1) == 1 then
feedkey("<Plug>(vsnip-jump-prev)", "")
end
end, { "i", "s" }),
-- ['<CR>'] = cmp.mapping.confirm({ select = true }),
}),
})
cmp.setup.cmdline(':', {
@ -315,28 +285,7 @@ return {
{ name = 'cmdline' }
}),
mapping = cmp.mapping.preset.insert({
-- ['<CR>'] = cmp.mapping.confirm({ select = false }),
["<Tab>"] = cmp.mapping(function(fallback)
if cmp.visible() then
cmp.select_next_item()
elseif vim.fn["vsnip#available"](1) == 1 then
feedkey("<Plug>(vsnip-expand-or-jump)", "")
elseif has_words_before() then
cmp.complete()
else
fallback()
end
end, { "i", "s" }),
["<S-tab>"] = cmp.mapping(function()
if cmp.visible() then
cmp.select_prev_item()
elseif vim.fn["vsnip#jumpable"](-1) == 1 then
feedkey("<Plug>(vsnip-jump-prev)", "")
end
end, { "i", "s" }),
}),
})
end,