tags:

views:

163

answers:

2

I have used Stata and gVim on Windows for a while now. Recently I have switched to Linux, and I am planning to also change from Stata to R.

A friend of mine is using R and Emacs ESS which seems to work perfect, however i'd rather like to keep using vim. I have installed the vim-r-plugin2, however, i can only send code to a seperate terminal running R. I would much rather split my screen into a buffer running R and one buffer with my .R file, and then send code from one to the other. With ESS in Emacs this seems to work, you can run a terminal/R in a buffer without a problem. I haven't found a way to make this work. The R plugin for vim uses screen, and the only way to open a buffer running a shell I could find is the Conque Shell plugin.

I know that unlike Emacs, Vim is designed to be a simple text editor. However, having R run in a buffer seems just so much more practical.

I hope my problem is understandable, please bear with me I only recently switched to Linux and know virtually nothing about programming besides statistics. Thanks!

+2  A: 

If you do not need to input unicode, you can consider using ConqueShell plugin.

ZyX
I know about the ConqueShell plugin. But how do I get the vim-r-plugin to work with it?
ilprincipe
@ilprincipe It cannot work with ConqueShell out-of-the box, but you can try to use my fork of this plugin: http://github.com/ZyX-I/vim-r-plugin2: it adds initial ConqueShell support, in order to use it set `g:vimrplugin_conqueplugin` in your vimrc. Maybe this changes will be pulled by the author later.
ZyX
ive tried your solution, it works partly, some of the keybindings dont work since conqueshell can only send selections to a shell, not strings. ive shared your files with the author here: http://ubuntuforums.org/showthread.php?p=9836800#post9836800
ilprincipe
@ilprincipe It can send strings to shell, review my solution. But this is undocumented and so may be changed in future versions without notice (though I do not think that this is likely).
ZyX
@ilprincipe By the way, my commit was pulled into base repository. I do not know, whether package was updated, if not you can use [vim-addon-manager](http://github.com/MarcWeber/vim-addon-manager) to install it from Git (you will need git installed). Add `call scriptmanager#Activate("Vim-R-plugin2")` to your vimrc and answer `y<CR>` on all queries at startup (one `y` and one `<CR>`, ignoring the fact that it will 'repeat' prompt after you press `y`).
ZyX
my mistake, it works now. thanks alot for your help!
ilprincipe
A: 

Another option, and forgive me for pointing you back to EMACS,

viper-mode

http://www.informatik.uni-hamburg.de/RZ/software/emacs/viper/viper_3.html

It's an EMACS mode that makes EMACS feel more like Vim, while giving you full access to the wonderful, mind-boggling complexity of EMACS if you ever want it.

Choens
thanks, I know about viper mode, but if I'm using emacs, I'm using emacs and not a hybrid. however, I'd rather continue to use vim.
ilprincipe