I use Coc-Python for Python autocompletions. It completes on Enter, however, I want to complete only on pressing Tab and reserve Enter for its normal behavior which is entering a new line. How do I do that?

  • The core CoC site on Github has an example configuration that I'm pretty sure does exactly what you're talking about. (OOC, did u recently install CoC-Python or have u had it for a while?)
    – B Layer
    May 31, 2021 at 9:56
  • @BLayer Just installed. Pretty much new to Vim in general :)
    – m_ocean
    May 31, 2021 at 10:07
  • 1
    Hi. No problem. Welcome to Vi&Vim SE. But take a look at the first line of the CoC-Python readme. It's a warning that recommends using CoC-Pyright (assuming you're using Python 3)...CoC-Python is archived and it says it's "too hard to maintain".
    – B Layer
    May 31, 2021 at 10:09
  • 2
    @BLayer Oh, okay. Thanks!
    – m_ocean
    May 31, 2021 at 10:21
  • @BLayer it is not related to the topic. Anyway put this in your vimrc or init.vim to use tab to navigate between completion results inoremap <expr> <Tab> pumvisible() ? "\<C-n>" : "\<Tab>"
    – TheVimmer
    Sep 23, 2021 at 9:44


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.