remove broken code

This commit is contained in:
2025-11-23 15:46:52 -06:00
parent 5badfd8361
commit 3ccd05a690
9 changed files with 131 additions and 303 deletions

View File

@@ -1,86 +1,70 @@
return {
"hrsh7th/nvim-cmp",
dependencies = {
-- basic sources
"hrsh7th/cmp-buffer",
"hrsh7th/cmp-path",
-- cmdline completion for `:` and `/`
"hrsh7th/cmp-cmdline", -- :contentReference[oaicite:0]{index=0}
-- LSP
"hrsh7th/cmp-nvim-lsp", -- :contentReference[oaicite:1]{index=1}
-- Treesitter source
"ray-x/cmp-treesitter", -- :contentReference[oaicite:2]{index=2}
"hrsh7th/nvim-cmp",
dependencies = {
-- basic sources
"hrsh7th/cmp-buffer",
"hrsh7th/cmp-path",
-- cmdline completion for `:` and `/`
"hrsh7th/cmp-cmdline", -- :contentReference[oaicite:0]{index=0}
-- LSP
"hrsh7th/cmp-nvim-lsp", -- :contentReference[oaicite:1]{index=1}
-- Treesitter source
"ray-x/cmp-treesitter", -- :contentReference[oaicite:2]{index=2}
-- snippet engine & integration (optional)
{
"L3MON4D3/LuaSnip",
version = "v2.*",
build = "make install_jsregexp",
},
"saadparwaiz1/cmp_luasnip",
"rafamadriz/friendly-snippets",
"rafamadriz/friendly-snippets",
-- icons
"onsails/lspkind.nvim",
},
config = function()
local cmp = require("cmp")
local luasnip = require("luasnip")
local lspkind = require("lspkind")
-- icons
"onsails/lspkind.nvim",
},
-- load friendly-snippets
require("luasnip.loaders.from_vscode").lazy_load()
config = function()
local cmp = require("cmp")
local lspkind = require("lspkind")
-- nicer completions menu
vim.opt.completeopt = "menu,menuone,preview,noselect"
-- load friendly-snippets
cmp.setup({
snippet = {
expand = function(args)
luasnip.lsp_expand(args.body)
end,
},
mapping = cmp.mapping.preset.insert({
["<C-k>"] = cmp.mapping.select_prev_item(),
["<C-j>"] = cmp.mapping.select_next_item(),
["<C-b>"] = cmp.mapping.scroll_docs(-4),
["<C-f>"] = cmp.mapping.scroll_docs(4),
["<C-Space>"] = cmp.mapping.complete(),
["<C-e>"] = cmp.mapping.abort(),
["<CR>"] = cmp.mapping.confirm({ select = false }),
}),
sources = cmp.config.sources({
{ name = "luasnip" },
{ name = "nvim_lsp" },
{ name = "treesitter" },
{ name = "buffer" },
{ name = "path" },
}),
formatting = {
format = lspkind.cmp_format({
maxwidth = 50,
ellipsis_char = "...",
}),
},
})
-- nicer completions menu
vim.opt.completeopt = "menu,menuone,preview,noselect"
-- Commandline “:” → cmdline + path
cmp.setup.cmdline(":", {
mapping = cmp.mapping.preset.cmdline(),
sources = {
{ name = "path" },
{ name = "cmdline" },
},
})
cmp.setup({
mapping = cmp.mapping.preset.insert({
["<C-k>"] = cmp.mapping.select_prev_item(),
["<C-j>"] = cmp.mapping.select_next_item(),
["<C-b>"] = cmp.mapping.scroll_docs(-4),
["<C-f>"] = cmp.mapping.scroll_docs(4),
["<C-Space>"] = cmp.mapping.complete(),
["<C-e>"] = cmp.mapping.abort(),
["<CR>"] = cmp.mapping.confirm({ select = false }),
}),
sources = cmp.config.sources({
{ name = "nvim_lsp" },
{ name = "treesitter" },
{ name = "buffer" },
{ name = "path" },
}),
formatting = {
format = lspkind.cmp_format({
maxwidth = 50,
ellipsis_char = "...",
}),
},
})
-- Search/” → buffer
cmp.setup.cmdline("/", {
mapping = cmp.mapping.preset.cmdline(),
sources = {
{ name = "buffer" },
},
})
end,
-- Commandline:” → cmdline + path
cmp.setup.cmdline(":", {
mapping = cmp.mapping.preset.cmdline(),
sources = {
{ name = "path" },
{ name = "cmdline" },
},
})
-- Search “/” → buffer
cmp.setup.cmdline("/", {
mapping = cmp.mapping.preset.cmdline(),
sources = {
{ name = "buffer" },
},
})
end,
}