Skip to content
Advertisement

Running Nvim-R via PuTTy: setting up r_term_cdm

I would like to run Nvim-R on a remote machine via when I try to open a *.R file the remote machine returns an error message:

Please set the variable g:R_term_cmd in your vimrc. Read the plugin documentation …

According to the documentation, the R_term_cmd should be used in the following manner:

If |R_in_buffer| = 0 and the X Window System is running and is installed, then R will run in an external terminal emulator. The plugin uses the first terminal emulator that it finds in the following list:

JavaScript

10. xterm.

If Vim does not select your favorite emulator, you may define it in your vimrc by setting the variable R_term, as shown below:

JavaScript

If your terminal emulator is not listed above, or if you are not satisfied with the way your terminal emulator is called by the plugin, you may define in your vimrc the variable R_term_cmd, as in the examples below:

JavaScript

However, this variable does not appear to be utilised by the sample configuration files available through the Vim-R-Tmux: An Integrated Working Environment for R. Furthermore, the settings in vimrc:

JavaScript

<LocalLeader> settings

The suggested <LocalLeader> settings not appear to work as pressing F2 does not launch connected R session.

Software versions

JavaScript

Advertisement

Answer

You have two options

Use Tmux, which you apparently are

This way, Nvim-R can actually use a tmux pane to start an R console.

Please refer to section 9.21 Integration with Tmux in the documentation.

You need to put the following in your vimrc:

JavaScript

Or just use NeoVim

NeoVim has a builtin terminal, which actually just works with the Nvim-R plugin.

User contributions licensed under: CC BY-SA
7 People found this is helpful
Advertisement