mirror of
https://github.com/pojokcodeid/nvim-lazy.git
synced 2025-06-22 00:49:01 +02:00
update
This commit is contained in:
parent
645bb933f3
commit
25b04f10d1
2 changed files with 89 additions and 87 deletions
|
@ -1,91 +1,94 @@
|
||||||
return {
|
return {
|
||||||
"hrsh7th/nvim-cmp",
|
{ "nvim-treesitter/nvim-treesitter" },
|
||||||
version = false, -- last release is way too old
|
{
|
||||||
event = "InsertEnter",
|
"hrsh7th/nvim-cmp",
|
||||||
dependencies = {
|
version = false, -- last release is way too old
|
||||||
"hrsh7th/cmp-nvim-lsp",
|
event = "InsertEnter",
|
||||||
"hrsh7th/cmp-buffer",
|
dependencies = {
|
||||||
"hrsh7th/cmp-path",
|
"hrsh7th/cmp-nvim-lsp",
|
||||||
"saadparwaiz1/cmp_luasnip",
|
"hrsh7th/cmp-buffer",
|
||||||
"hrsh7th/cmp-nvim-lua",
|
"hrsh7th/cmp-path",
|
||||||
-- {
|
"saadparwaiz1/cmp_luasnip",
|
||||||
-- "hrsh7th/cmp-cmdline",
|
"hrsh7th/cmp-nvim-lua",
|
||||||
-- --event = "BufWinEnter",
|
-- {
|
||||||
-- event = "VeryLazy",
|
-- "hrsh7th/cmp-cmdline",
|
||||||
-- config = function()
|
-- --event = "BufWinEnter",
|
||||||
-- require("user.cmdline")
|
-- event = "VeryLazy",
|
||||||
-- end,
|
-- config = function()
|
||||||
-- },
|
-- require("user.cmdline")
|
||||||
},
|
-- end,
|
||||||
opts = function()
|
-- },
|
||||||
local cmp = require("cmp")
|
},
|
||||||
local luasnip = require("luasnip")
|
opts = function()
|
||||||
|
local cmp = require("cmp")
|
||||||
|
local luasnip = require("luasnip")
|
||||||
|
|
||||||
local check_backspace = function()
|
local check_backspace = function()
|
||||||
local col = vim.fn.col(".") - 1
|
local col = vim.fn.col(".") - 1
|
||||||
return col == 0 or vim.fn.getline("."):sub(col, col):match("%s")
|
return col == 0 or vim.fn.getline("."):sub(col, col):match("%s")
|
||||||
end
|
end
|
||||||
|
|
||||||
return {
|
return {
|
||||||
completion = {
|
completion = {
|
||||||
completeopt = "menu,menuone,noinsert",
|
completeopt = "menu,menuone,noinsert",
|
||||||
},
|
},
|
||||||
snippet = {
|
snippet = {
|
||||||
expand = function(args)
|
expand = function(args)
|
||||||
require("luasnip").lsp_expand(args.body)
|
require("luasnip").lsp_expand(args.body)
|
||||||
end,
|
end,
|
||||||
},
|
},
|
||||||
mapping = cmp.mapping.preset.insert({
|
mapping = cmp.mapping.preset.insert({
|
||||||
["<C-b>"] = cmp.mapping.scroll_docs(-4),
|
["<C-b>"] = cmp.mapping.scroll_docs(-4),
|
||||||
["<C-f>"] = cmp.mapping.scroll_docs(4),
|
["<C-f>"] = cmp.mapping.scroll_docs(4),
|
||||||
["<C-Space>"] = cmp.mapping.complete(),
|
["<C-Space>"] = cmp.mapping.complete(),
|
||||||
["<C-e>"] = cmp.mapping.abort(),
|
["<C-e>"] = cmp.mapping.abort(),
|
||||||
["<CR>"] = cmp.mapping.confirm({ select = true }), -- Accept currently selected item. Set `select` to `false` to only confirm explicitly selected items.
|
["<CR>"] = cmp.mapping.confirm({ select = true }), -- Accept currently selected item. Set `select` to `false` to only confirm explicitly selected items.
|
||||||
["<Tab>"] = cmp.mapping(function(fallback)
|
["<Tab>"] = cmp.mapping(function(fallback)
|
||||||
if cmp.visible() then
|
if cmp.visible() then
|
||||||
cmp.select_next_item()
|
cmp.select_next_item()
|
||||||
elseif luasnip.expandable() then
|
elseif luasnip.expandable() then
|
||||||
luasnip.expand()
|
luasnip.expand()
|
||||||
elseif luasnip.expand_or_jumpable() then
|
elseif luasnip.expand_or_jumpable() then
|
||||||
luasnip.expand_or_jump()
|
luasnip.expand_or_jump()
|
||||||
elseif check_backspace() then
|
elseif check_backspace() then
|
||||||
fallback()
|
fallback()
|
||||||
else
|
else
|
||||||
fallback()
|
fallback()
|
||||||
end
|
end
|
||||||
end, {
|
end, {
|
||||||
"i",
|
"i",
|
||||||
"s",
|
"s",
|
||||||
|
}),
|
||||||
}),
|
}),
|
||||||
}),
|
sources = cmp.config.sources({
|
||||||
sources = cmp.config.sources({
|
{ name = "nvim_lsp" },
|
||||||
{ name = "nvim_lsp" },
|
{ name = "luasnip" },
|
||||||
{ name = "luasnip" },
|
{ name = "buffer" },
|
||||||
{ name = "buffer" },
|
{ name = "path" },
|
||||||
{ name = "path" },
|
{ name = "nvim_lua" },
|
||||||
{ name = "nvim_lua" },
|
}),
|
||||||
}),
|
formatting = {
|
||||||
formatting = {
|
fields = { "kind", "abbr", "menu" },
|
||||||
fields = { "kind", "abbr", "menu" },
|
format = function(entry, vim_item)
|
||||||
format = function(entry, vim_item)
|
vim_item.kind = string.format("%s", require("user.icons")["kind"][vim_item.kind])
|
||||||
vim_item.kind = string.format("%s", require("user.icons")["kind"][vim_item.kind])
|
vim_item.menu = ({
|
||||||
vim_item.menu = ({
|
nvim_lsp = "(LSP)",
|
||||||
nvim_lsp = "(LSP)",
|
luasnip = "(Snippet)",
|
||||||
luasnip = "(Snippet)",
|
buffer = "(Buffer)",
|
||||||
buffer = "(Buffer)",
|
path = "(Path)",
|
||||||
path = "(Path)",
|
})[entry.source.name]
|
||||||
})[entry.source.name]
|
return vim_item
|
||||||
return vim_item
|
end,
|
||||||
end,
|
},
|
||||||
},
|
window = {
|
||||||
window = {
|
completion = cmp.config.window.bordered(),
|
||||||
completion = cmp.config.window.bordered(),
|
documentation = cmp.config.window.bordered(),
|
||||||
documentation = cmp.config.window.bordered(),
|
},
|
||||||
},
|
experimental = {
|
||||||
experimental = {
|
ghost_text = false,
|
||||||
ghost_text = false,
|
native_menu = false,
|
||||||
native_menu = false,
|
},
|
||||||
},
|
}
|
||||||
}
|
end,
|
||||||
end,
|
},
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,5 +1,4 @@
|
||||||
return {
|
return {
|
||||||
{ "nvim-treesitter/nvim-treesitter" },
|
|
||||||
-- {
|
-- {
|
||||||
-- "hrsh7th/cmp-cmdline",
|
-- "hrsh7th/cmp-cmdline",
|
||||||
-- event = "BufWinEnter",
|
-- event = "BufWinEnter",
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue