hrsh7th / nvim-compe

Auto completion Lua plugin for nvim

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

<Plug>(vsnip-expand-or-jump) literally inserted when tabbing through menu

mroavi opened this issue · comments

I've spent quite some time already trying to fix this but still haven't been able to find the solution. I'm hoping you can help me since I think this is an issue with my configuration and not with the package. I actually had this working fine in the past.

Checkhealth

Put result of :checkhealth compe.

health#compe#check
========================================================================
## compe:snippet
  - OK: snippet engine detected.

## compe:mapping
  - OK: `compe#complete` is mapped: (`i  <C-Space>     compe#complete()`)
  - OK: `compe#confirm` is mapped: (`i  <CR>        * compe#confirm('<CR>')`)
  - INFO: `compe#close` is not mapped
  - INFO: `compe#scroll` is not mapped

Describe the bug

I added the configuration in the How to use tab to navigate completion menu section. Whenever I hit <Tab> to go to the next snippet placeholder, the literal text <Plug>(vsnip-expand-or-jump) gets inserted.

Here is a demo of this happening:

Peek 2021-07-27 19-54_issue_with_compe

Additional context (optional)

I don't know if this is relevant, but this is how I'm configuring the Lua LSP server:

local capabilities = vim.lsp.protocol.make_client_capabilities()
capabilities.textDocument.completion.completionItem.snippetSupport = true

local lua_lsp_dir = "/home/mroavi/lsp-servers/lua-language-server/"
lspconfig.sumneko_lua.setup{
	cmd = {lua_lsp_dir .. "bin/Linux/lua-language-server", "-E", lua_lsp_dir .. "/main.lua"},
	capabilities = capabilities,
	settings = {
		Lua = {
			runtime = {version = "LuaJIT", path = vim.split(package.path, ";")},
			diagnostics = {globals = {"vim"}},
			workspace = {
				-- Make the server aware of Neovim runtime files
				library = {
					[vim.fn.expand "$VIMRUNTIME/lua"] = true,
					[vim.fn.expand "$VIMRUNTIME/lua/vim/lsp"] = true
				}
			}
		}
	}
}

Thanks in advance.

Solved. The problem was including noremap = true in the <Tab> and <S-Tab> mappings. After removing these, the "jump to the next placeholder" behavior works like expected.