Skip to content
VimL R
Find file
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.


This is a mirror of

The rcom ftplugin uses one of the following methods to evaluate R code:

    screen ... default method; works under Linux & Windows (with cygwin/mintty & Windows Rterm)
    screen or tmux ... via the screen vim plugin; works under Linux & Windows
    RServe ... requires +ruby and the rserve-client rubygem; works under Linux & (less reliably) under Windows
    RCom interface ... requires; works under Windows

With the exception of RCOM, most methods should work also under Mac OS 
but that was not tested.

After installation, interaction with R is enabled for all
buffers with filetype r. For other filetypes, you can use the
functions |rcom#EvaluateInBuffer()|.


    - Evaluate R code
    - Operator map
    - Maps for normal, visual, and insert mode
    - Keyword map (|K|)
    - Inspect & edit/fix object (<LocalLeader>K)
    - Debug functions

The following features are supported only with some methods:

    - Omnicompletion for R
    - Get return values from R


The ftplugin provides several maps (see also |g:rcom_map|, 
|g:rcom_mapp|) to evaluate R code and optionally print the result in 
normal, insert, and visual mode. There is also an operator (see 

Default Maps:
    <c-cr>    ... Evaluate the current line
    <c-s-cr>  ... Evaluate the current line & print result
    +.        ... Evaluate the current line (normal mode)
    +{motion} ... Operator
    [visual]+ ... Evaluate the visual area
    +p        ... Toggle printing for the above maps
    +d        ... Toggle a function's debug status
    +l        ... Open the log window
    ++        ... Evaluate the |maparg| previously mapped to +
    K         ... Info on the word under cursor
    <LocalLeader>K ... Inspect/edit/fix the object under cursor

Normal usage~

    0.  Optional steps:
            a. Prepare a running instance of RGui if using the RCOM 
            b. RCOM and screen methods: The results get printed in the R 
               window. You might want to arrange the windows in a way, 
               so that you can see VIM, R console and R graphic device 
               at the same time.
    1.  Open an R source file in VIM.
    2a. Type <c-cr> to evaluate the current line/visual area in R.
    2b. Type [count]+ or +{motion} to evaluate some text in R. (You can 
        type ++ to invoke |+|.)

Something went wrong with that request. Please try again.