Giter VIP home page Giter VIP logo

Comments (12)

jalvesaq avatar jalvesaq commented on August 24, 2024

The X server must be installed in the client machine, but the message "vimcom wasn't loaded yet" does not depend on the X server. Did you put library(vimcom) in your .Rprofile in the remote machine? Note that tmux and vim must both run in the remote machine.

Neovim does not require the X server to receive messages from vimcom. Its first version wasn't released yet but if you want to try the development version, you can build it with the following commands:

# Install pre-requisites to build Neovim in Debian/Ubuntu
# (other systems: https://github.com/neovim/neovim/wiki/Building-Neovim):
sudo apt-get install libtool libtool-bin autoconf automake cmake libncurses5-dev g++ pkg-config unzip

# Install python and clipboard support for Neovim:
sudo apt-get install pip libpython2.7-dev xsel
sudo pip install neovim

# Download and build Neovim:
git clone https://github.com/neovim/neovim.git
cd neovim
make
sudo make install

# Use Neovim with Vim configuration:
cd ~
ln -s .vimrc .nvimrc
ln -s .vim .nvim

# Use Neovim as you use Vim:
nvim file.R

from vimcom.

mbojan avatar mbojan commented on August 24, 2024

OK, thanks. I misunderstood the part on X server on the remote.

However the problem remains even though:

  • I login to remote with ssh -X user@machine
  • Launch tmux on remote
  • Launch vim --servername VIM file.R on remote within tmux.
  • I have library(vimcom) in .Rprofile on the remote. Calling search() shows package vimcom in the search path.

I'd rather not experiment with neovim at this moment...

Any further clues?

from vimcom.

jalvesaq avatar jalvesaq commented on August 24, 2024

Do you get meaningful output when you do Sys.getenv("VIMRPLUGIN_HOME") and Sys.getenv("VIMRPLUGIN_TMPDIR") in R?
And what is R output at startup and after you send the first command when you have this in your .Rprofile:

options(vimcom.verbose = 4)
library(vimcom)

from vimcom.

jalvesaq avatar jalvesaq commented on August 24, 2024

Since you didn't reply yet, I assume that you manage to use the plugin over ssh, and that I can close this issue...

from vimcom.

mbojan avatar mbojan commented on August 24, 2024

I'm sorry I did not reply, I got into a pre-Xmas and pre-end-of-FY2014 mayhem...

I did not solve this issue yet...

I am getting sensible values for VIMRPLUGIN_HOME and VIMRPLUGIN_TMPDIR.

However, there is no extra output whatsoever when I added those extra lines to .Rprofile. (?)

from vimcom.

jalvesaq avatar jalvesaq commented on August 24, 2024

With options(vimcom.verbose=1), you should see only vimcom 1.1.15 loaded at R startup, but with options(vimcom.verbose=4) you should get a lot of output when trying omnicompletion, completion of function arguments, :Rhelp, :Rinsert and :Rformat. If there is no extra output, then, vimcom was not loaded. To check if R is reading you entire ~/.Rprofile, you could put cat() at the first and at the last lines of your ~/.Rprofile, like these:

cat("This is the first line\n")
# The original content here.
cat("This is the last line\n")

from vimcom.

mbojan avatar mbojan commented on August 24, 2024

Hmm... All my .Rprofile gets executed with no errors. Package vimcom is not being loaded, which I can check with search().

The problem is that both my vimrc file and my .Rprofile got somewhat complex over time. Perhaps I'll try switching-off / commenting-out some of the stuff to isolate the problem. All in all, it seems that the key problem is that when I start R with \rf from vim vimcom package is not being loaded for some reason...

I guess I will try to start with some pristine settings. Luckily I keep both .vim and .Rprofile git-controlled.

I will report back.

from vimcom.

mbojan avatar mbojan commented on August 24, 2024

Where in the plugin (what script / line) vim tries to load vimcom?

from vimcom.

jalvesaq avatar jalvesaq commented on August 24, 2024

The Vim-R-plugin doesn't load the R library vimcom. It must be loaded in the ~/.Rprofile.

When vimcom is loaded, it saves a file in the $VIMRPLUGIN_TMPDIR directory. The Vim-R-plugin starts R and waits a few seconds for the file "vimcom_running_" to be written. If this file is not created, the Vim-R-plugin assumes that either R did not start or vimcom was not loaded.

If you open the $VIMRPLUGIN_TMPDIR directory in a graphical file manager, you will see some files being created and deleted.

from vimcom.

jalvesaq avatar jalvesaq commented on August 24, 2024

@mbojan did you solve the problem?

from vimcom.

mbojan avatar mbojan commented on August 24, 2024

Yes, in a sense... I think the issue was that I had some mismatch between versions of vimcom and vimrplugin. When I updated both to latest version the issue vanished.

Thanks for your help. This can be closed

from vimcom.

jalvesaq avatar jalvesaq commented on August 24, 2024

Thanks for your feedback.

from vimcom.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.