aboutsummaryrefslogtreecommitdiff
path: root/lua/config
diff options
context:
space:
mode:
authorjdhao <jdhao@hotmail.com>2022-11-22 21:17:47 +0800
committerjdhao <jdhao@hotmail.com>2022-11-22 21:19:53 +0800
commit43c1615822eeeb29d8213ca117760476f9e9f4dc (patch)
tree446f91a25c1f9a08bb635bbfd599b08595604e6a /lua/config
parent509a8bce8c8f24781418f7b26cc19fbf67eb4bff (diff)
fix: cmp-omni messes with the lsp completion
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.
Diffstat (limited to 'lua/config')
-rw-r--r--lua/config/nvim-cmp.lua10
1 files changed, 9 insertions, 1 deletions
diff --git a/lua/config/nvim-cmp.lua b/lua/config/nvim-cmp.lua
index 188c985..a402f1c 100644
--- a/lua/config/nvim-cmp.lua
+++ b/lua/config/nvim-cmp.lua
@@ -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 = {
@@ -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