nerd stuff
1return {
2 {
3 "hrsh7th/cmp-nvim-lsp",
4 },
5 {
6 "L3MON4D3/LuaSnip",
7 dependencies = {
8 "saadparwaiz1/cmp_luasnip",
9 "rafamadriz/friendly-snippets",
10 },
11 },
12 {
13 "hrsh7th/nvim-cmp",
14 dependencies = {
15 "onsails/lspkind.nvim",
16 },
17 config = function()
18 require("luasnip.loaders.from_vscode").lazy_load()
19 local cmp = require("cmp")
20 local lspkind = require("lspkind")
21 cmp.setup({
22 snippet = {
23 expand = function(args)
24 require("luasnip").lsp_expand(args.body)
25 end,
26 },
27 window = {
28 completion = cmp.config.window.bordered(),
29 documentation = cmp.config.window.bordered(),
30 },
31 mapping = cmp.mapping.preset.insert({
32 ["<C-b>"] = cmp.mapping.scroll_docs(-4),
33 ["<C-f>"] = cmp.mapping.scroll_docs(4),
34 ["<C-Space>"] = cmp.mapping.complete(),
35 ["<C-e>"] = cmp.mapping.abort(),
36 ["<Tab>"] = cmp.mapping.confirm({ select = true }),
37 }),
38 sources = cmp.config.sources({
39 { name = "nvim_lsp" },
40 { name = "luasnip" },
41 { name = "buffer" },
42 { name = "path" },
43 --{ name = "copilot" }, disabled copilot bc holy fuck im going crazy with these garbage completions
44 }),
45 formatting = {
46 format = lspkind.cmp_format({
47 mode = "symbol_text",
48 maxwidth = {
49 menu = 50, -- leading text (labelDetails)
50 abbr = 50, -- actual suggestion item
51 },
52 ellipsis_char = "...",
53 show_labelDetails = true,
54
55 before = function(entry, vim_item)
56 return vim_item
57 end,
58 }),
59 },
60 })
61 end,
62 },
63}