bfredl / nvim-ipy

IPython/Jupyter plugin for Neovim
MIT License
424 stars 29 forks source link

Integrating with supertab/default completion #14

Open dpavlic opened 8 years ago

dpavlic commented 8 years ago

One of the 'problems' I have is that I can add a completion to a shortcut (i.e., change from C-F), but I cannot use vim's default completion with nvim-ipy. In turn, this means I cannot use it with Supertab. Is there a way around this?

bfredl commented 8 years ago

If you enable both, what happens? does supertab overwrite the suggestion list that nvim-ipy provides?

dpavlic commented 8 years ago

It's not an issue with enabling both. I'd like to pull the suggestion list from nvim-ipy instead of supertab completions, which are useless to me. Context: I don't ever use jedi-vim or its derivatives because they break on complicated modules like pandas; whereas I can get completions via evaluating code with nvim-ipy, but I'd like to get them via a tab binding.

bfredl commented 8 years ago

It should be doable. The problem is that <Plug>(IPy-Complete) is async, so it might not work to just tell SupterTab to use it. "Worst case" would be to just implement a synchronous variant that could be used as &omnifunc. I will look into it.

dpavlic commented 8 years ago

Thank you for your hard work. This has become an indispensable vim plugin in my workflow.

bfredl commented 8 years ago

I took a stab at implementing an omnifunc. So with set omnifunc=IPyOmniFunc it should work if SuperTab is set to use omnifunc. But for an async framework like Deoplete using it is not recommended, I will try implement a Deoplete source as well.

dpavlic commented 8 years ago

Thanks for taking a look at this. I can't get it to work, although I'm not sure why that is. Doing:

:verbose set omnifunc

gives me:

omnifunc=IPyOmniFunc
Last set from ~/.config/nvim/init.vim

Notes: Attempt is with python3 (renaming directory from python to python3 in rplugin/) and updating plugin. Attempting to pull up omnifunc without supertab also doesn't appear to work. It could be on my end, I'll experiment a bit more soon.

rattletat commented 6 years ago

I took a stab at implementing an omnifunc. So with set omnifunc=IPyOmniFunc it should work if SuperTab is set to use omnifunc. But for an async framework like Deoplete using it is not recommended, I will try implement a Deoplete source as well.

Is there any update on the Deoplete source functionality? For me the set omnifunc=IPyOmniFunc works quite well, but I'm not sure how to specify it as an input for deoplete.