jcfaria / Vim-R-plugin

Plugin to work with R (forked for development only)
http://www.vim.org/scripts/script.php?script_id=2628
121 stars 34 forks source link

Sporadic failures to send code chunks to R #185

Closed klmr closed 9 years ago

klmr commented 9 years ago

I’m experiencing intermittent issues where Vim-R isn’t able to open a temporary file to send code to R.

Typing :messages in Vim shows this:

I’m experiencing intermittent issues where Vim-R isn’t able to open a temporary file to send code to R.

Typing :messages in Vim shows this:

The Vim application that comes with MacVim cannot receive messages from R "scripts/codon_usage.r" 128L, 4543C written "scripts/codon_usage.r" 127L, 4540C written Error detected while processing function SendRmdChunkToR..RSourceLines: line 8: E482: Can't create file /var/folders/9t/zz9zg0v914z_64yc4v2qtcp40000gn/T/r-plugin-rudolph/Rsource-51583 Error detected while processing function SendRmdChunkToR..RSourceLines: line 8: E482: Can't create file /var/folders/9t/zz9zg0v914z_64yc4v2qtcp40000gn/T/r-plugin-rudolph/Rsource-51583 Error detected while processing function SendSelectionToR..RSourceLines: line 8: E482: Can't create file /var/folders/9t/zz9zg0v914z_64yc4v2qtcp40000gn/T/r-plugin-rudolph/Rsource-51583 The Vim application that comes with MacVim cannot receive messages from R. Error detected while processing function StartR: line 15: E482: Can't create file /var/folders/9t/zz9zg0v914z_64yc4v2qtcp40000gn/T/r-plugin-rudolph/globenv_srlocallibpython27sitepackagesYoushouldunsetPYTHONPATHtofixthis line 16: E482: Can't create file /var/folders/9t/zz9zg0v914z_64yc4v2qtcp40000gn/T/r-plugin-rudolph/liblist_srlocallibpython27sitepackagesYoushouldunsetPYTHONPATHtofixthis line 63: E482: Can't create file /var/folders/9t/zz9zg0v914z_64yc4v2qtcp40000gn/T/r-plugin-rudolph/start_options.R Error detected while processing function StartR..StartR_TmuxSplit: line 10: E482: Can't create file /var/folders/9t/zz9zg0v914z_64yc4v2qtcp40000gn/T/r-plugin-rudolph/tmuxsrlocallibpython27sitepackagesYoushouldunsetPYTHONPATHtofixthis.conf The package vimcom wasn't loaded yet.

Two things:

  1. Unsetting PYTHONPATH seems to help. However, since the problem only occurs sometimes (and PYTHONPATH is actually set on purpose!), I’m not sure how this is connected.
  2. The messages claim that Vim cannot receive messages from R. It’s true that I’m using MacVim; however, in following the documentation, I aliased vim to vim --servername VIM (and I’ve verified that this alias is indeed being used). Shouldn’t this fix the communication?
jalvesaq commented 9 years ago

You cannot use the Vim application that comes with MacVim. In Mac OS X, you have two options:

  1. Use the graphical application MacVim.
  2. Compile Vim with X11 clientserver support and use it in the terminal emulator.
klmr commented 9 years ago

You cannot use the Vim application that comes with MacVim

That’s unfortunate. Furthermore, it used to work. Why the regression?

jalvesaq commented 9 years ago

It is not a regression. The plugin did not work with MacVim at all until January. Now it at least works with the graphical MacVim. Please, read the last paragraph of section 3.2 of the Vim-R-plugin documentation (Preliminary system setup on Mac OS X).

klmr commented 9 years ago

The plugin did not work with MacVim at all until January.

Wait, it definitely worked for me, I’ve been using it for years. It stopped working when I recently updated after not touching it for about a year.

Just to clarify, it’s entirely possible that not all features of the Vim-R plugin ever worked. However, I’ve never noticed a lack. Now, however, some features definitely stopped working, such as Vim not recognising functions loaded from packages, and failure to invoke the documentation of functions inside R.

jalvesaq commented 9 years ago

I have had access to a Mac OS X in January. I am sorry the changes that I made created new bugs, but I no longer have access to any Mac, and we have to wait until someone else fix the bug.

You could try Neovim with Nvim-R (which a never tested on Mac OS X). Perhaps, it works in your case.

And, of course, you can also use an older version of the Vim-R-plugin.

klmr commented 9 years ago

Yes, NeoVim is what I’m going to try (been meaning to switch anyway), hence why I closed the bug.