hrsh7th / cmp-cmdline

nvim-cmp source for vim's cmdline
MIT License
567 stars 45 forks source link

Problem in latex files #104

Open Tokariew opened 1 year ago

Tokariew commented 1 year ago

I have a little problem when i have enabled cmdline source with the latex files. When i start inputing with \ for latex commands it give me errors:

Error detected while processing TextChangedI Autocommands for "*":
E10: \ should be followed by /, ? or &

when i disable cmdline source it seems ok.

I use luasnip with friendly-snippets

My cmp config ``` local cmp = require 'cmp' local luasnip = require 'luasnip' require("luasnip.loaders.from_vscode").lazy_load() luasnip.config.setup {} local kind_icons = { Text = "", Method = "󰆧", Function = "󰊕", Constructor = "", Field = "󰇽", Variable = "󰂡", Class = "󰠱", Interface = "", Module = "", Property = "󰜢", Unit = "", Value = "󰎠", Enum = "", Keyword = "󰌋", Snippet = "", Color = "󰏘", File = "󰈙", Reference = "", Folder = "󰉋", EnumMember = "", Constant = "󰏿", Struct = "", Event = "", Operator = "󰆕", TypeParameter = "󰅲", } cmp.setup { snippet = { expand = function(args) luasnip.lsp_expand(args.body) end, }, mapping = cmp.mapping.preset.insert { [''] = cmp.mapping.scroll_docs(-4), [''] = cmp.mapping.scroll_docs(4), [''] = cmp.mapping.complete {}, [''] = cmp.mapping.confirm { behavior = cmp.ConfirmBehavior.Replace, select = true, }, [''] = cmp.mapping(function(fallback) if cmp.visible() then cmp.select_next_item() elseif luasnip.expand_or_jumpable() then luasnip.expand_or_jump() else fallback() end end, { 'i', 's' }), [''] = cmp.mapping(function(fallback) if cmp.visible() then cmp.select_prev_item() elseif luasnip.jumpable(-1) then luasnip.jump(-1) else fallback() end end, { 'i', 's' }), }, sources = { { name = 'luasnip', option = { use_show_condition = false } }, { name = 'nvim_lsp' }, { name = 'path' }, { name = 'buffer' }, { name = 'cmdline' }, }, formatting = { format = function(entry, vim_item) -- Kind icons vim_item.kind = string.format('%s %s', kind_icons[vim_item.kind], vim_item.kind) -- This concatonates the icons with the name of the item kind -- Source return vim_item end }, } ```