<commit_before>local cmp = require('cmp')
local lspkind = require('lspkind')
local luasnip = require('luasnip')

cmp.setup {
  experimental = {
    ghost_text = true
  },
  formatting = {
    format = lspkind.cmp_format {
      mode = 'symbol_text',
      menu = {
        buffer = '[BUF]',
        luasnip = '[SNP]',
        nvim_lsp = '[LSP]',
        nvim_lua = '[LUA]',
        path = '[PTH]',
        spell = '[SPL]'
      }
    }
  },
  mapping = cmp.mapping.preset.insert {
    ['<C-b>'] = cmp.mapping.scroll_docs(-4),
    ['<C-f>'] = cmp.mapping.scroll_docs(4),
    ['<C-Space>'] = cmp.mapping.complete(),
    ['<C-e>'] = cmp.mapping.abort(),
    ['<C-z>'] = cmp.mapping.confirm({ select = true }), -- Accept currently selected item. Set `select` to `false` to only confirm explicitly selected items.
  },
  sources = cmp.config.sources {
    {name = 'nvim_lua'},
    {name = 'nvim_lsp'},
--    {name = 'luasnip'},
    {name = 'buffer'},
    {name = 'path'},
    {name = 'spell', keyword_length = 3, max_item_count = 5}
  }
}

-- Use buffer source for `/` (if you enabled `native_menu`, this won't work anymore).
cmp.setup.cmdline('/', {
  mapping = cmp.mapping.preset.cmdline(),
  sources = {
    {name = 'buffer'}<commit_msg>Use all buffers for completion suggestions<commit_after>local cmp = require('cmp')
local lspkind = require('lspkind')
local luasnip = require('luasnip')

cmp.setup {
  experimental = {
    ghost_text = true
  },
  formatting = {
    format = lspkind.cmp_format {
      mode = 'symbol_text',
      menu = {
        buffer = '[BUF]',
        luasnip = '[SNP]',
        nvim_lsp = '[LSP]',
        nvim_lua = '[LUA]',
        path = '[PTH]',
        spell = '[SPL]'
      }
    }
  },
  mapping = cmp.mapping.preset.insert {
    ['<C-b>'] = cmp.mapping.scroll_docs(-4),
    ['<C-f>'] = cmp.mapping.scroll_docs(4),
    ['<C-Space>'] = cmp.mapping.complete(),
    ['<C-e>'] = cmp.mapping.abort(),
    ['<C-z>'] = cmp.mapping.confirm({ select = true }), -- Accept currently selected item. Set `select` to `false` to only confirm explicitly selected items.
  },
  sources = cmp.config.sources {
    {name = 'nvim_lua'},
    {name = 'nvim_lsp'},
--    {name = 'luasnip'},
    {
      name = 'buffer',
      option = {
        get_bufnrs = function()
          return vim.api.nvim_list_bufs()
        end
      }
    },
    {name = 'path'},
    {name = 'spell', keyword_length = 3, max_item_count = 5}
  }
}

-- Use buffer source for `/` (if you enabled `native_menu`, this won't work anymore).
cmp.setup.cmdline('/', {
  mapping = cmp.mapping.preset.cmdline(),
  sources = {
    {name = 'buffer'}
{'fraction_non_alphanumeric': 0.18719024018299657, 'fraction_numerical': 0.0030499428135722455, 'mean_word_length': 2.5555555555555554, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 13, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1323490', 'n_tokens_mistral': 962, 'n_tokens_neox': 953, 'n_words': 200}