Hi, I'm wondering if R provide a vi mode in the command line just like other shells such as bash do. Can somebody let me know? Regards, Peng
I've no idea about vi. But there is one called ESS(emacs speaks statistics) in Emacs. I'm very curious how VI is going to work on generating X11 output. On Thu, Aug 6, 2009 at 2:54 PM, Peng Yu<pengyu.ut at gmail.com> wrote:> Hi, > > I'm wondering if R provide a vi mode in the command line just like > other shells such as bash do. Can somebody let me know? > > Regards, > Peng > > ______________________________________________ > R-help at r-project.org mailing list > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide http://www.R-project.org/posting-guide.html > and provide commented, minimal, self-contained, reproducible code. >-- ??? Hesen Peng http://hesen.peng.googlepages.com/
On Fri, Aug 7, 2009 at 5:04 AM, Jakson Alves de Aquino<jaksonaquino at gmail.com> wrote:> Peng Yu wrote: >> I'm wondering if R provide a vi mode in the command line just like >> other shells such as bash do. Can somebody let me know? > > I maintain a Vim plugin that makes the interaction with R easier: > > ?http://www.vim.org/scripts/script.php?script_id=2628 > > The commands are sent through a pipe, and this approach has some > limitations which are explained in the plugin's documentation. The > plugin has been discussed here: > > ?http://ubuntuforums.org/showthread.php?t=776492I have difficulties in understanding how to use it. I have successfully installed it and I see the menu item 'R' after I open a .R file with gvim. I then press <F2>, but nothing happens. What I should do, for example, if I want run the script in .R file that I just opened? Regards, Peng
If you are using R in a *nix machine then R is usually compiled with support for gnu-readline which does have a vi mode. You need a file called ".inputrc" in your home directory containing the following line: set editing-mode vi in order to activate it. It works exactly like the vi mode in bash (which also uses gnu-readline). I don't think you can get a vi mode for the R command prompt in Windows. Regards, Trevor Peng Yu wrote:> Hi, > > I'm wondering if R provide a vi mode in the command line just like > other shells such as bash do. Can somebody let me know? > > Regards, > Peng >
On 8/6/09, Peng Yu <pengyu.ut at gmail.com> wrote:> Hi, > > I'm wondering if R provide a vi mode in the command line just like > other shells such as bash do. Can somebody let me know?I've never used vi-mode, but vi mode in bash (at least) is provided by the readline library, and R uses the same library. If you set up your bash to use vi-mode, e.g., by including set editing-mode vi in your ~/.inputrc, and then start R, you should get into vi-mode. Alternatively, if you start up R in emacs editing mode, M-C-j will change to vi mode. -Deepayan
On Fri, Aug 7, 2009 at 5:04 AM, Jakson Alves de Aquino<jaksonaquino at gmail.com> wrote:> Peng Yu wrote: >> I'm wondering if R provide a vi mode in the command line just like >> other shells such as bash do. Can somebody let me know? > > I maintain a Vim plugin that makes the interaction with R easier: > > ?http://www.vim.org/scripts/script.php?script_id=2628 > > The commands are sent through a pipe, and this approach has some > limitations which are explained in the plugin's documentation. The > plugin has been discussed here: > > ?http://ubuntuforums.org/showthread.php?t=776492 > > Regards, > > JaksonHi, After I installed your package, then I run the following command. gvim run.R 2>&1 But I got the error below. Do you know what the problem was? Regards, Peng 1 ToolBar 10 Open n* :browse confirm e<CR> v* <C-C>:browse confirm e<CR><C-\><C-G> s* <C-C>:browse confirm e<CR><C-\><C-G> o* <C-C>:browse confirm e<CR><C-\><C-G> 20 Save n*s :if expand("%") == ""|browse confirm w|else|confirm w|endif<CR> v*s <C-C>:if expand("%") == ""|browse confirm w|else|confirm w|endif<CR><C-\><C-G> s*s <C-C>:if expand("%") == ""|browse confirm w|else|confirm w|endif<CR><C-\><C-G> o*s <C-C>:if expand("%") == ""|browse confirm w|else|confirm w|endif<CR><C-\><C-G> 30 SaveAll n* :browse confirm wa<CR> v* <C-C>:browse confirm wa<CR><C-\><C-G> s* <C-C>:browse confirm wa<CR><C-\><C-G> o* <C-C>:browse confirm wa<CR><C-\><C-G> 40 Print n* :hardcopy<CR> v* :hardcopy<CR> s* :hardcopy<CR> o* <C-C>:hardcopy<CR><C-\><C-G> 45 -sep1- n* <Nop> v* <Nop> s* <Nop> o* <Nop> 50 Undo n* u v* <C-C>u<C-\><C-G> s* <C-C>u<C-\><C-G> o* <C-C>u<C-\><C-G> 60 Redo n* <C-R> v* <C-C><C-R><C-\><C-G> s* <C-C><C-R><C-\><C-G> o* <C-C><C-R><C-\><C-G> 65 -sep2- n* <Nop> v* <Nop> s* <Nop> o* <Nop> 70 Cut v* "+x s* "+x 80 Copy v* "+y s* "+y 90 Paste n* "+gP v& "-c<Esc>:call paste#Paste()<CR> s& "-c<Esc>:call paste#Paste()<CR> 95 -sep3- n* <Nop> v* <Nop> s* <Nop> o* <Nop> 100 Replace n* :promptrepl<CR> v* y:promptrepl <C-R>=<SNR>3_FixFText()<CR><CR> s* y:promptrepl <C-R>=<SNR>3_FixFText()<CR><CR> o* <C-C>:promptrepl<CR><C-\><C-G> 110 FindNext n* n v* <C-C>n<C-\><C-G> s* <C-C>n<C-\><C-G> o* <C-C>n<C-\><C-G> 120 FindPrev n* N v* <C-C>N<C-\><C-G> ...(truncated)