On 2009-May-23 , at 17:40 , Paul Heinrich Dietrich wrote:
> I'm interested in easing my way into learning VIM by first using the
> Cream
> text editor, liking the idea that it will work on both my Linux and
> Windows
> computers. I've installed Cream on my Linux machine, but can't
> figure out
> how to make Cream talk to R? Does anybody know? I'm using Ubuntu
> if it
> makes a difference. Thanks.
You should install the R Vim Plugin and its dependencies:
http://www.vim.org/scripts/script.php?script_id=2628
This creates commands and icons dedicated to the interaction between
Vim and R.
Then switch cream Settings > Preferences > Expert Mode.
This will allow you to work in Cream and have all the simple keyboard
shortcuts (Control-C, Control-V etc.) but still be able to switch
between modes as in vim. By default you are in insert mode. You need
to switch to normal mode (by pressing ESC) to be able to use the
commands of the R-Vim plugin.
The workflow is therefore:
- open a R file
- edit stuff
- press ESC (to switch to non-edit mode)
- start R in a terminal (click the icon or press F2)
- send lines/selection (F9) or document (F5)
- press ESC (to switch back to insert mode)
- edit 2 lines
- ESC
- F9
- F9
- ESC
- edit again
etc...
The terminal opened this way does not work completely as a regular one
and there are some caveats when reading help and using general command
line editing shortcuts (Ctrl-R for backward search for example). I
haven't found a way around them so I usually open a second terminal to
read the help in, or set R to display the help as HTML files in a
browser window.
I must say that those caveats can be quite serious and I often find
myself just using copy-paste from gedit in a terminal:
- set your desktop to "focus follow mouse"
- select text in your editor
- move the mouse to the terminal
- click middle mouse button
- move the mouse back to the editor
etc...
More cumbersome but reliable.
Final note: since you are on ubuntu, you may want to change the
terminal from the default X-term to gnome-terminal. You have to edit
the file .vim/ftplugin/r.vim. There is a line commented with the gnome-
terminal command instead of xterm. Uncomment this one and comment the
xterm one.
JiHO
---
http://jo.irisson.free.fr/