Vim-R-plugin: Installation

On Ubuntu 12.04, I took to the following steps to install Vim-R-plugin:

  1. First I had to install timux: sudo apt-get installl tmux
  2. Having already installed vim-pathogen, I used git to clone to install vim-r-plugin and vim-screen plugin, which is also required: cd ~/.vim/bundle
    git clone git://github.com/vim-scripts/Vim-R-plugin
    git clone git://github.com/vim-scripts/Screen-vim---gnu-screentmux
  3. Then I changed my localleader to “,”, by adding: let maplocalleader = ",", to my .vimrc file.
  4. Finally I added the following lines to my .Rprofile:

    if(interactive()){
    library(colorout)
    library(setwidth)
    library(vimcom)
    }

That it, everything works perfectly.

About these ads
This entry was posted in BASH, R, vim. Bookmark the permalink.

8 Responses to Vim-R-plugin: Installation

  1. Andrea says:

    Hi, I am interested in using vim + R. Since I need often to work on a remote machine, a terminal-based R environment is really what I am looking for. The remote server is running Ubuntu 12.04, but I have only a rough knowledge about vim. Can you add some more explanation on your procedure to configure vim? Is it the standard procedure? Do you know where to find a tutorial for using vim-r-plugin?

    Thank you,

    Andrea

    • svenski says:

      I have exactly the same set up as above except for having installed a newer tmux version from source — I had some trouble with the one in the ubuntu repositories.

      As for the r-vim plugin I really recommend the vim-r plugin documentation, it is excellent:

      http://www.lepem.ufc.br/jaa/r-plugin.html#r-plugin-use

    • kariert says:

      Andrea, I would also refer to the vim-r-plugin documentation (as svenski did already). It is very extensive and covers everything you need to get started. Which steps in the vim configuration do you have troubles with?

      • Andrea says:

        Thank you for your replies :-)

        I have followed the steps for the installation and it seems that everything in the procedure worked fine. However I was not able to use the plugin key bindings and to send commands to R when I open a *.R file with vim.

        The only thing that I managed is to start a R session, but only via a customization of the key binding, by adding to my .~/vimrc the lines:

           nmap  RStart
           imap  RStart
           vmap  RStart
        

        and then pressing F2 during the vim session.

        I am using a terminal on a OSX machine and I am connected via ssh to a remote Ubuntu server.

      • Andrea says:

        Hi, I resolved the problem…
        It seems that the commands of the plugin have to be issued in a small time window… You need to input the sequence of letter very fast, otherwise it won’t work…

  2. Siddhant says:

    Hi, how and where do I access this file .Rprofile?

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s