[R] R (unix) command line editing for native speakers of vi

Liaw, Andy andy_liaw at merck.com
Fri Nov 19 21:55:06 CET 2004


If you have the following in your ~/.inputrc, you won't need to set it
manually every time (at least according to the readline manual):

set editing-mode vi

HTH,
Andy

> From: Steve Dutky
> 
> As an inveterate user of vi, I was pleased to stumble on how 
> to use it for editing R commands.  
> 
> When an interactive R session is launched under unix, the 
> command line editor most likely defaults to emacs. Typing 
> <esc>,<ctrl>+j will switch this to vi editing mode (see below 
> for possible exceptions).
> 
> excerpted from readline(3) manpage:
> vi-editing-mode (M-C-j)
>   When in emacs editing mode, this causes a switch to        
> vi editing mode.
> 
> emacs-editing-mode (C-e)
>   When in vi editing mode, this causes  a  switch  to emacs 
> editing mode.
> 
> 
> An  emacs-style  notation  is  used  to denote keystrokes. 
> Control keys are denoted by C-key, e.g.,C-n  means  Control-
> N.  Similarly, meta keys are denoted by M-key, so M-x means 
> Meta-X.  (On keyboards without a meta key, M-x means ESC  x,  
> i.e.,  press the Escape key then the x key.  This makes ESC 
> the meta prefix.  The combination M-C-x means ESC-Control-x,  
> or press the Escape key then hold the Control key while 
> pressing the x key.)
> 
> see also:
> An Introduction to R Appendix C: The command-line editor.
> http://cran.r-project.org/doc/manuals/R-intro.html#The%
> 20command-line%20editor
> 
> Steve Dutky (sdutky at terpalum.umd.edu)
> 
> ______________________________________________
> R-help at stat.math.ethz.ch mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide! 
> http://www.R-project.org/posting-guide.html
> 
>




More information about the R-help mailing list