Re: Vim R plugin installation issue
Quote:
Originally Posted by
bgc
[...] Is it also possible to change any of the keybindings? [...]
I released a new version yesterday, and now it's possible to change the key bindings in the vimrc. There is also an option to choose the terminal emulator. The plugin's documentation has the details.
Is anyone editing the plugin to change its behavior? I would like to know because I could implement optional behaviors which would benefit people with different preferences.
Re: Vim R plugin installation issue
Hi! Thanks for the plugin! Everything works fine as far as I can tell! Look forward to further progress, but so far happy with being able to use vim with R with very few issues indeed!
Re: Vim R plugin installation issue
Quote:
Originally Posted by
bgc
Hi! Thanks for the plugin! Everything works fine as far as I can tell! Look forward to further progress, but so far happy with being able to use vim with R with very few issues indeed!
You are welcome! And, please, tell me if you have any idea of how to improve the plugin.
My TODO list is almost empty. I have to fix a small bug in code indentation and I could add a few more options like all vim buffers using the same pipe file and avoiding omni completion of zero length strings, but perhaps nobody needs these options.
The only improvement that I've made in my configuration that might be worth noting was the use of less as the default pager. I've created and made executable the file ~/bin/rpager with the following content:
Code:
#!/bin/sh
RHELPFILE="/tmp/R-help-$USER"
cat > $RHELPFILE
XTT=`head -n 1 $RHELPFILE | awk '{print $1}'`
xterm -T "$XTT - R Help" -e less $RHELPFILE &
Then, I put in my .Rprofile:
Code:
if (interactive()) {
local({
options(editor='gvim -f -c "set ft=r"')
options(pager="~/bin/rpager")
})
}
Now, the help system is usable even without calling 'help.start()'.
Re: Vim R plugin installation issue
Well, the only issues are the ones you mentioned already: limit of how much code can be sent to R, colour coding of R (e.g. errors). Other than that I can't think of much, but then again I'm new to this so still in the discovery phase! But it's proving to be great not to depend on Win, Tinn-R, etc.!
Re: Vim R plugin installation issue
Hi, I don't know if it is the indentation bug that you mention, but despite adding 'set shiftwidth=2' in the .vimrc file, the sw is 4 every time I open a file. Manually setting it in the file itself solves the issue.
Re: Vim R plugin installation issue
Quote:
Originally Posted by
bgc
Hi, I don't know if it is the indentation bug that you mention, but despite adding 'set shiftwidth=2' in the .vimrc file, the sw is 4 every time I open a file. Manually setting it in the file itself solves the issue.
I also prefer shiftwidth=2. I commented out three lines of my ftplugin/r.vim that were there to increase compatibility with emacs (expandtab, shiftwidth, tabstop). I put a note in the documentation about these options. You will not have to edit the code again after the next release of the plugin!
The indentation bug happens when we have code like:
Code:
if(T){
a <- b
}
else {
}
This is the code style shown when R prints a function content. I already fixed it here. I also fixed a bug in string recognition at "_" to " <- " conversion. I'll release the new version with these minor bugs fixed soon.
Re: Vim R plugin installation issue
One useful feature would be a easy way to turn off the replacement of "_" with "<-", if desired. I have been having problems where I need to insert an underscore in the middle of a line. The help says to type an underscore twice when a real underscore is needed. Currently, hitting "_" twice in a row, when in the middle of a line, leads to the insertion of a "<-" at the original position of the cursor, and then the insertion of an "_" at the end of the line.
Re: Vim R plugin installation issue
Quote:
Originally Posted by
azvoleff
One useful feature would be a easy way to turn off the replacement of "_" with "<-", if desired. I have been having problems where I need to insert an underscore in the middle of a line. The help says to type an underscore twice when a real underscore is needed. Currently, hitting "_" twice in a row, when in the middle of a line, leads to the insertion of a "<-" at the original position of the cursor, and then the insertion of an "_" at the end of the line.
Thanks for reporting the bug. I added the option that you requested. You may put in your .vimrc:
let g:vimrplugin_underscore = 1
But I believe that I fixed the bug and before using the option above you could test the underscore replacement in the new version of the plugin that I just released.
Re: Vim R plugin installation issue
Thanks again for all of your work. The bug is fixed - the new version works as you described.
Re: Vim R plugin installation issue
There's also something else I've noticed, although I'm not sure if it is me doing something wrong. If you open R through a file, then maybe close that R session and then try to send code to R (through some confusion, especially when working on more than one file), you get a message at the bottom of Vi saying ":call send block to R" and then seems to freeze.
It wouldn't happen if I kept track of what I open and with which file though!
Thanks for the new version!