roxma / nvim-completion-manager

:warning: PLEASE USE https://github.com/ncm2/ncm2 INSTEAD
MIT License
917 stars 49 forks source link

Inconsistent behavior for "import" keyword in Python #189

Closed sassanh closed 6 years ago

sassanh commented 6 years ago

Sometimes when I write

from datetime |CURSOR HERE|

it automatically adds import and I end up with

from datetime import |CURSOR HERE|

but sometimes it opens a completion menu and I should select import (it's the only option.)

Any idea how can I make it consistent? (I prefer first case.)

lithammer commented 6 years ago

I think it's something Jedi does, try let g:jedi#smart_auto_mappings = 0.

------------------------------------------------------------------------------
6.13. `g:jedi#smart_auto_mappings`                  *g:jedi#smart_auto_mappings*

When you start typing `from module.name<space>` jedi-vim automatically
adds the "import" statement and displays the autocomplete popup.

This option can be disabled in the .vimrc:

`let g:jedi#smart_auto_mappings = 0`

Options: 0 or 1
Default: 1 (enabled by default)
sassanh commented 6 years ago

Thanks @renstrom I checked that variable and while it's 1 it mostly doesn't add import automatically. But I guess I should follow that in jedi's repo.