nikvdp/nvim-lsp-config

How to use autocomplete? When i press tab it is not working..?

Closed this issue · 3 comments

The completion popup comes but how do i get it ? I tried entering tab or enter but cannot . For example when i type :
import req
it shows requests in the pop up but i cannot access it. I am forced to type full word.

github.mp4

Hey @3301n good to hear from you! This setup just uses vim's default mechanisms for completion, so you can use the up/down arrows and and ctrl+n/ctrl-p to select a completion from the list and Enter to insert it.

That said, it's definitely possible to setup tab completion to work the way it usually works in other IDEs. This comment on the compe repo (compe is the plugin that powers completion for his config) has some simple mappings that might work for you: hrsh7th/nvim-compe#141 (comment) and compe's own README has some documentation on this as well here.

Hey where should i place the code mentined in the README file of nvim-compe for tab completion according to your setup??

Wherever you prefer! Personally I would probably paste it into the bottom of lua/completion.lua but you could also just put it in your init.vim. If you go with init.vim you'd need to wrap it like so:

lua <<EOF
...code from readme...
EOF