Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to scroll up in Vim buffer with R (using Nvim-R)

Tags:

vim

r

I'm a happy user of the Nvim-R plugin, but I cannot find out how to scroll up in the buffer window that the plugin opens with R. Say for instance that I have a large output in console, but I cannot see the top of it - how do I scroll up to see this? In tmux for instance there's a copy mode that quite handily lets you do this, but how is this done in the R buffer?

An example below where I'm very curious to see what's on the line above the one begining with "is.na(a)...". How can this be achieved?

I have scoured the documentation found here, but without luck.

enter image description here

like image 436
avriis Avatar asked Apr 04 '18 12:04

avriis


1 Answers

The answer is apparently to use Ctrl+\ Ctrl+n according to this answer on the bugreports for NVim-R.

Here's what my output looks like when I output mtcars:

enter image description here

When I hit Ctrl+\ Ctrl+n, I can move the cursor and I get line numbers:

enter image description here

To get back to interactive, I just use i, the same way I normally would.

Apparently, if you are using neovim, then you can add let R_esc_term = 0 in your ~/.vimrc file and you can then use the escape key, but if you don't use neovim, you are stuck using the two ctrl commands ¯\_(ツ)_/¯.

like image 145
ZNK Avatar answered Oct 26 '22 10:10

ZNK