vi mode to emacs mode while on R

北慕城南 提交于 2019-12-12 15:18:42

问题


Sometimes while on the R console I accidentally type an unknown keyboard short cut that changes the editing mode from emacs to vi.

Does anyone know what is usually this combination of keys to change from one to the other?

I am on a Fedora 16 machine

I checked the info on this question but using meta+v or meta+e doesn't change anything.

UPDATE: The keystrokes shown the answer below work ONLY WITHIN R!


回答1:


R uses the GNU readline library for keyboard editing modes. I think the answer is therefore meta-ctrl-j, based on these links: http://cnswww.cns.cwru.edu/php/chet/readline/readline.html#SEC22 , http://www.algorithm-forge.com/techblog/2009/09/shortcuts-in-r-under-unix-from-the-readline-library/ ...

(I'm running Ubuntu 10.04 under VMWare on MacOS 10.6, so I actually have to hit theAlt-fn-j key combination to switch modes. I've never done it by accident!)

edit: as pointed out by the OP, Ctrl-e goes back from emacs to vi mode. http://unixhelp.ed.ac.uk/CGI/man-cgi?readline+3 does say

   "C-E"  emacs-editing-mode

but this was pretty hard to dig up!



来源:https://stackoverflow.com/questions/13399874/vi-mode-to-emacs-mode-while-on-r

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!