diff options
| author | srdusr <trevorgray@srdusr.com> | 2025-09-24 02:56:53 +0200 |
|---|---|---|
| committer | srdusr <trevorgray@srdusr.com> | 2025-09-24 02:56:53 +0200 |
| commit | 0f6cee92221dc517bd756083e260dd9373851b82 (patch) | |
| tree | c6d929fa5832d17a2d1fe3c85744bae7621ed447 /common/nvim/lua/plugins/cmp.lua | |
| parent | 3cf613ec7c90ab4933728b0f19e49b0c955c17bb (diff) | |
| download | dotfiles-0f6cee92221dc517bd756083e260dd9373851b82.tar.gz dotfiles-0f6cee92221dc517bd756083e260dd9373851b82.zip | |
Moved files to common/
Diffstat (limited to 'common/nvim/lua/plugins/cmp.lua')
| -rwxr-xr-x | common/nvim/lua/plugins/cmp.lua | 67 |
1 files changed, 0 insertions, 67 deletions
diff --git a/common/nvim/lua/plugins/cmp.lua b/common/nvim/lua/plugins/cmp.lua deleted file mode 100755 index 7de04ad..0000000 --- a/common/nvim/lua/plugins/cmp.lua +++ /dev/null @@ -1,67 +0,0 @@ -local M = {} - ---- Setup and configure nvim-cmp --- This function initializes and configures the completion plugin --- @return boolean True if setup was successful, false otherwise -function M.setup() - -- Check Neovim version - local nvim_version = vim.version() - if nvim_version.major == 0 and nvim_version.minor < 5 then - return false - end - - -- Try to load required modules - local cmp = pcall(require, 'cmp') and require('cmp') - if not cmp then - return false - end - - local luasnip_ok, luasnip = pcall(require, 'luasnip') - if not luasnip_ok then - vim.notify("luasnip not found, some features may be limited", vim.log.levels.WARN) - end - - -- Setup nvim-cmp - cmp.setup({ - snippet = { - expand = function(args) - if luasnip_ok then luasnip.lsp_expand(args.body) end - end, - }, - mapping = cmp.mapping.preset.insert({ - ['<C-Space>'] = cmp.mapping.complete(), - ['<CR>'] = cmp.mapping.confirm({ select = true }), - ['<Tab>'] = cmp.mapping.select_next_item(), - ['<S-Tab>'] = cmp.mapping.select_prev_item(), - }), - sources = cmp.config.sources({ - { name = 'nvim_lsp' }, - { name = 'luasnip' }, - { name = 'buffer' }, - }), -}) - -vim.cmd([[ - highlight! link CmpItemMenu Comment - " gray - highlight! CmpItemAbbrDeprecated guibg=NONE gui=strikethrough guifg=#808080 - " blue - highlight! CmpItemAbbrMatch guibg=NONE guifg=#569CD6 - highlight! CmpItemAbbrMatchFuzzy guibg=NONE guifg=#569CD6 - " light blue - highlight! CmpItemKindVariable guibg=NONE guifg=#9CDCFE - highlight! CmpItemKindInterface guibg=NONE guifg=#9CDCFE - highlight! CmpItemKindText guibg=NONE guifg=#9CDCFE - " pink - highlight! CmpItemKindFunction guibg=NONE guifg=#C586C0 - highlight! CmpItemKindMethod guibg=NONE guifg=#C586C0 - " front - highlight! CmpItemKindKeyword guibg=NONE guifg=#D4D4D4 - highlight! CmpItemKindProperty guibg=NONE guifg=#D4D4D4 - highlight! CmpItemKindUnit guibg=NONE guifg=#D4D4D4 - ]]) - - return true -end - -return M |
