roxma/nvim-completion-manager

Inconsistent behavior for "import" keyword in Python

Closed this issue · 2 comments

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.)

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)

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.