gaalcaras / ncm-R

R autocompletion for Neovim and vim 8 :memo: :bar_chart: :zap:
GNU General Public License v3.0
118 stars 10 forks source link

Does ncm-R works on vim #2

Closed statquant closed 6 years ago

statquant commented 6 years ago

Hello, sorry for the stupid question but does ncm-R works on vim 8.0+ like nvim-R ? Maybe it would be worth mentioning in the readme

gaalcaras commented 6 years ago

No, ncm-R does not support vim. I've been careful to only mention Neovim (and not vim) in the README. But you're right, I guess I can be more specific.

I don't plan to support vim 8 any time soon, ncm-R is still a young project and I want to keep the development focused on Neovim for now. But I'm not excluding the possibility, especially if it's a feature people want.

Since vim 8 isn't my daily editor, I have no idea what completion framework could be a good fit. Suggestions, ideas and of course PR are welcome.

statquant commented 6 years ago

Hello, agreed you never mentioned vim. Maybe it is just me but some people seem to assume no mention implies compatibility... anyway. Regarding the completion engine it seems that nvim-completion-manager support vim8 (from reading its readme, modulo installation of another addin)

gaalcaras commented 6 years ago

I didn't realise NCM was compatible with vim 8, thanks!

So... maybe ncm-R actually works with vim 8, I'd have to check. I'll add it to my todo list, but it's not a priority for me at the moment. If you have some time to look into this, I'd appreciate your feedback.

statquant commented 6 years ago

Ok, I just reinstall everything from scatch in neovim and the completion does not seem to work... Strangely enough I do get a snip completion on lib[rary] but no completion on any function like pl[ot?]. Is there a way for me to diagnose the issue ?

gaalcaras commented 6 years ago

First, you should use the next branch, it fixes some bugs and outputs messages to guide the user when something doesn't work. I'll be merging it into master soon.

To diagnose the issue, the following should help:

  1. Is NCM working with other filetypes, like Python?
  2. Do you see files named omnils_{PKGNAME}_{PKGVERSION} in your g:g:rplugin_compldir directory? If not, try to generate some by loading some R packages in Nvim-R.
  3. Start nvim with NVIM_PYTHON_LOG_FILE=nvim.log NVIM_PYTHON_LOG_LEVEL=INFO nvim, start an R session with Nvim-R and type some text that should trigger completion (read.csv or summary are good test cases). Then check the contents of nvim.log_py3_cm_core. Do you get lines like word: "read.csv", func: "", pkg: , pipe: None or Cannot find loaded R packages? If not, that means ncm-R is not loaded by NCM, maybe because of a Python version incompatibility.
statquant commented 6 years ago

Hello thanks for the steps. 1 and 2 are affirmative (well I do not do python but installing jedi and jedi-vim I get completion with C-space) 3 does not work, I mean I get a lot of stuff in nvim.log_py3_cm_core but nothing like word: "read.csv", func: "", pkg: , pipe:

I use Fedora 26 all up to date

statquant  ~  1  python2
Python 2.7.14 (default, Nov  2 2017, 18:42:05) 
[GCC 7.2.1 20170915 (Red Hat 7.2.1-2)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> exit()
 statquant  ~  1  python3
Python 3.6.3 (default, Oct  9 2017, 12:11:29) 
[GCC 7.2.1 20170915 (Red Hat 7.2.1-2)] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> 
gaalcaras commented 6 years ago

Thanks for the feedback.

You should not have to type C-Space to trigger completion, NCM has a "suggest as you type" behavior. Please make sure NCM works as intented before testing ncm-R.

If after that, ncm-R still doesn't work in neovim, please go to #1, maybe try some of the fixes suggested and give your feedback over there.

I'll leave this issue open in case you want to test ncm-R with vim 8.

gaalcaras commented 6 years ago

I've just tried ncm-R with vim8, and I'm glad to report it works.

However it's all dependent on you getting NCM to work with vim8, there is some additional work to get there: https://github.com/roxma/nvim-completion-manager#requirements . And since there's a compatibility layer between NCM and vim, ncm-R is a bit slower on vim 8 (though it felt perfectly usable during my short test).

I'll update the README accordingly in the future.