Ⅰ. 插件描述
Send R code from a VIM buffer to RⅡ. 基本信息
|
Ⅲ. 安装方法
使用Vundle管理器安装
在你的.vimrc下添加:Plugin '/r-vim'
… 然后在Vim中运行以下命令:
:source %
:PluginInstall
对于Vundle版本 < 0.10.2,请用上面的Bundle替换Plugin。
使用NeoBundle管理器安装
在你的.vimrc下添加:NeoBundle '/r-vim'
… 然后在Vim中运行以下命令:
:source %
:NeoBundleInstall
使用VimPlug管理器安装
在你的.vimrc下添加:Plug '/r-vim'
… 然后在Vim中运行以下命令:
:source %
:PlugInstall
使用Pathogen管理器安装
在终端中运行以下命令:cd ~/.vim/bundle
git clone https://github.com/vim-scripts/R.vim
Ⅳ. 文档说明
The plugin is not maintained any more. Please use the excellent vimscript #2628. It even lets you use the "r" key to send a visual selection to R (let vimrplugin_map_r=1) if you got used to this using my plugin. The following is only kept for archiving purposes.
Send R code from a VIM buffer to R on Unix type systems using funnel.pl from vimscript #221. Contains
README.R_with_vim
ftplugin/r.vim
ftplugin/rnoweb.vim
ftplugin/funnel.pl
syntax/rhelp.vim
syntax/rnoweb.vim
Makefile.rnoweb
Fernando Henrique Ferraz Pereira da Rosa is now a coauthor of this plugin (starting from version 0.03). He helped me fixing a bug and started the syntax file for mixed highlighting of Latex and R syntax (syntax/rnoweb.vim).
I set up a small project page for this plugin, featuring a screenshot:
http://www.uft.uni-bremen.de/chemie/ranke/?page=vim_R_linux
You can browse the subversion repository where these files are at home: http://kriemhild.uft.uni-bremen.de/viewcvs/?root=vim
Alternatives for Mac Os X include vimscript #1741 and vimscript #2104.
Under Windows, I am now using a quite simple solution, consisting of the installation of the rcom package for R which requires statconnDCOM from http://rcom.univie.ac.at and ActiveState Perl in the PATH (watch out if you use R tools, because GNU perl does not have the DCOM interface, so ActiveState perl needs to be first in the path).
My ftplugin/r.vim under Windows:
perl << EOF
sub rsourceclipboard
{
use Win32::OLE;
my $R = Win32::OLE->GetActiveObject('RCOMServerLib.StatConnector')
|| Win32::OLE->new('RCOMServerLib.StatConnector');
$R->Evaluate("source('clipboard', echo=TRUE)");
$R->Close;
}
EOF
vnoremap <buffer> r "*y:perl rsourceclipboard<CR>
This means that the visual selection is pasted to the clipboard and the clipboard content is sourced by R when the key "r" is pressed in visual mode.