Skip to content

Commit

Permalink
fix: cmp-omni messes with the lsp completion
Browse files Browse the repository at this point in the history
If we use cmp-omni and lsp together, it seems that it will mess the
autocompletion. So we only use it with tex file, where lsp in not used.
  • Loading branch information
jdhao committed Nov 22, 2022
1 parent 509a8bc commit 43c1615
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion lua/config/nvim-cmp.lua
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ cmp.setup {
{ name = "ultisnips" }, -- For ultisnips user.
{ name = "path" }, -- for path completion
{ name = "buffer", keyword_length = 2 }, -- for buffer word completion
{ name = "omni" },
{ name = "emoji", insert = true }, -- emoji completion
},
completion = {
Expand All @@ -61,6 +60,15 @@ cmp.setup {
},
}

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
Expand Down

0 comments on commit 43c1615

Please sign in to comment.