coq_nvim
coq_nvim copied to clipboard
Tab doesn't trigger completion & no snippet is shown
Hi there,
Recently I switched from coc to lsp, and decided to go with coq as the completion plugin. So far it's been really impressive!
However, I'm experiencing two issues. I've looked at the docs, but found no luck. Sorry if the question is elementary!
The first issue is that tab doesn't trigger completion. I wonder if there's a keymap conflict or something like that. The suggestions are shown, but I'm unable to select them using tab:
The second issue is that the snippets won't show up. I have installed the three plugins, and added coq.lsp_ensure_capabilities()
to my config. The relevant configs are below:
Plug 'ms-jpq/coq_nvim', {'branch': 'coq'}
Plug 'ms-jpq/coq.artifacts', {'branch': 'artifacts'}
Plug 'ms-jpq/coq.thirdparty', {'branch': '3p'}
lua << EOF
local lspconfig = require'lspconfig'
local servers = { 'pyright', 'clangd' }
local coq = require'coq'
for _, lsp in pairs(servers) do
lspconfig[lsp].setup {
on_attach = on_attach,
coq.lsp_ensure_capabilities(),
flags = {
debounce_text_changes = 150
}
}
end
EOF
Thank you!
Hi !
You can try changing your config like how I have mine where coq.lsp_ensure_capabilities()
covers everything in the setup function.
for _, lsp in pairs(servers) do
lspconfig[lsp].setup(coq.lsp_ensure_capabilities({
on_attach = on_attach,
flags = {
debounce_text_changes = 150
}
}))
end
@axelcalixte Hi! Unfortunately it still doesn't work when I change it. Whenever I press "tab", it doesn't trigger any sort of completion. Do you have any other ideas? Thanks!
do you have any autopair plugin installed?
Tab doesn*t work for me either. Or, worse, it sometimes works and sometimes doesn`t -- I haven't found any relations yet.
(Note the »
., which is my tab symbol)
I don't think I have any autopair plugin installed, but I am also pretty nooby, so here is my list of plugins (from :PackerStatus
)
• alpha-nvim • calendar-vim • coq.artifacts • coq.thirdparty • coq_nvim • everforest • feline.nvim • fzf • fzf.vim • gitsigns.nvim • goyo.vim • limelight.vim • nvim-cursorline • nvim-lspconfig • nvim-lspfuzzy • nvim-startup.lua • nvim-treesitter • nvim-web-devicons • packer.nvim • playground • plenary.nvim • popup.nvim • sqlite.lua • telekasten.nvim • telescope-frecency.nvim • telescope-fzf-native.nvim • telescope-media-files.nvim • telescope.nvim • vim-dadbod • vimwiki • vista.vim • which-key.nvim
Update: I think for me this is related to vimwiki
. There seems to be a binding for <Tab>
predefined. I have both Telekasten and VimWiki enabled, and both work on Markdown .md
files.. That means depending on which was active in the buffer <Tab>
was working or not :/
I wonder if it's possible for coq_nvim to enable the completion menu only with ctrl+n and ctrl+p. I'm sure not everyone needs to tab complete and it would respect more the "natural" way of doing completions in vim/neovim/. Then, coq_nvim which is a general plugin wouldn't conflict with vimwiki.
ino <silent><expr> <Tab> pumvisible() ? "\<C-n>" : "\<Tab>"
This setting is the default setting for coq_nvim if you don't specify your personal keybinds.
See docs/KEYBIND.md
Update: I think for me this is related to
vimwiki
. There seems to be a binding for<Tab>
predefined. I have both Telekasten and VimWiki enabled, and both work on Markdown.md
files.. That means depending on which was active in the buffer<Tab>
was working or not :/
happens to me and I don't have that plugin
But (based on my experience) it should be a similar issue: Some other plugin likely uses the same mapping for <Tab>
.
- Check which plugins map to the keybinding. For example with
:Telescope keymaps
-> search for<Tab>
. - Does it always happen in the same filetype? Does it sometimes happen in the same filetype? (I.e. for me in
.md
files) - Try disabling all the plugins that affect that file. Try to disabling all the plugins except Coq.
- Try mapping the Coq keybind to something besides
<Tab>
, to check if it works then.
I hope that helps.
E: And for the collective wisdom you could also maybe post a list of all your plugins.
But (based on my experience) it should be a similar issue: Some other plugin likely uses the same mapping for
<Tab>
.* Check which plugins map to the keybinding. For example with `:Telescope keymaps` -> search for `<Tab>`. * Does it always happen in the same filetype? Does it sometimes happen in the same filetype? (I.e. for me in `.md` files) * Try disabling all the plugins that affect that file. Try to disabling all the plugins except Coq. * Try mapping the Coq keybind to something besides `<Tab>`, to check if it works then.
I hope that helps.
E: And for the collective wisdom you could also maybe post a list of all your plugins.
for me it just happens everywhere, also