From aab38f32e0a02e43565a554d0a76ff65636499b8 Mon Sep 17 00:00:00 2001 From: Michal Hanus Date: Sat, 2 Mar 2024 18:49:55 +0100 Subject: crazyshit --- lua/config/nvim-cmp.lua | 91 ------------------------------------------------- 1 file changed, 91 deletions(-) delete mode 100644 lua/config/nvim-cmp.lua (limited to 'lua/config/nvim-cmp.lua') diff --git a/lua/config/nvim-cmp.lua b/lua/config/nvim-cmp.lua deleted file mode 100644 index a402f1c..0000000 --- a/lua/config/nvim-cmp.lua +++ /dev/null @@ -1,91 +0,0 @@ --- Setup nvim-cmp. -local cmp = require("cmp") -local lspkind = require("lspkind") - -cmp.setup { - snippet = { - expand = function(args) - -- For `ultisnips` user. - vim.fn["UltiSnips#Anon"](args.body) - end, - }, - mapping = cmp.mapping.preset.insert { - [""] = function(fallback) - if cmp.visible() then - cmp.select_next_item() - else - fallback() - end - end, - [""] = function(fallback) - if cmp.visible() then - cmp.select_prev_item() - else - fallback() - end - end, - [""] = cmp.mapping.confirm { select = true }, - [""] = cmp.mapping.abort(), - [""] = cmp.mapping.close(), - [""] = cmp.mapping.scroll_docs(-4), - [""] = cmp.mapping.scroll_docs(4), - }, - sources = { - { name = "nvim_lsp" }, -- For nvim-lsp - { name = "ultisnips" }, -- For ultisnips user. - { name = "path" }, -- for path completion - { name = "buffer", keyword_length = 2 }, -- for buffer word completion - { name = "emoji", insert = true }, -- emoji completion - }, - completion = { - keyword_length = 1, - completeopt = "menu,noselect", - }, - view = { - entries = "custom", - }, - formatting = { - format = lspkind.cmp_format { - mode = "symbol_text", - menu = { - nvim_lsp = "[LSP]", - ultisnips = "[US]", - nvim_lua = "[Lua]", - path = "[Path]", - buffer = "[Buffer]", - emoji = "[Emoji]", - omni = "[Omni]", - }, - }, - }, -} - -cmp.setup.filetype("tex", { - sources = { - { name = "omni" }, - { name = "ultisnips" }, -- For ultisnips user. - { name = "buffer", keyword_length = 2 }, -- for buffer word completion - { name = "path" }, -- for path completion - }, -}) - --- see https://github.com/hrsh7th/nvim-cmp/wiki/Menu-Appearance#how-to-add-visual-studio-code-dark-theme-colors-to-the-menu -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 -]]) -- cgit v1.2.3