标准 python 解释器有 vi 命令模式吗? [英] Standard python interpreter has a vi command mode?

查看:36
本文介绍了标准 python 解释器有 vi 命令模式吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在 python 解释器(RHEL 5.3 上的 python 2.4)中工作了一些,突然发现自己处于一种似乎是vi 命令模式"的状态.也就是说,我可以使用典型的 vi 键绑定编辑以前的命令,使用 h 向左,使用 x 删除...

I was working a bit in the python interpreter (python 2.4 on RHEL 5.3), and suddenly found myself in what seems to be a 'vi command mode'. That is, I can edit previous commands with typical vi key bindings, going left with h, deleting with x...

我喜欢它 - 唯一的问题是,我不知道我是怎么来到这里的(也许是通过我导入的模块之一:pylab/matplotlib?).

I love it - the only thing is, I don't know how I got here (perhaps it's through one of the modules I've imported: pylab/matplotlib?).

谁能解释一下如何在解释器中启用这种模式?

Can anyone shed some light on how to enable this mode in the interpreter?

推荐答案

Ctrl-Alt-J 在 readline 程序.

Ctrl-Alt-J switches from Emacs mode to Vi mode in readline programs.

或者将设置编辑模式 vi"添加到您的 ~/.inputrc

Alternatively add "set editing-mode vi" to your ~/.inputrc

这篇关于标准 python 解释器有 vi 命令模式吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆