将“发送代码更改为解释器” (C-c |)命令在python模式 [英] Change the "send code to interpreter" (C-c |) command in python-mode

查看:176
本文介绍了将“发送代码更改为解释器” (C-c |)命令在python模式的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我习惯于用C-C C-r命令向R中的解释器发送代码,Emacs会说出统计信息。如何将python-mode设置为使用C-c C-r而不是C-c以避免代码?



谢谢!

解决方案

它已经绑定到内置的python中的 Cc Cr .el,但这是一个绑定密钥的命令。如果您使用的是python-mode.el,则必须更改库名称,命令和地图。

 (eval-after-loadpython
'(progn
(define-key python-mode-map(kbdCc Cr)'python-shell-send-region)))


I am used to "C-c C-r" command to send code to the interpreter in R with Emacs speaks statistics. How can I set python-mode to use "C-c C-r" rather than "C-c |" to evaulate code?

Thanks!

解决方案

It's already bound to C-c C-r in the built-in python.el, but here's a command that binds the key. If you're using python-mode.el, you'll have to change the library name, the command, and maybe the map.

(eval-after-load "python"
  '(progn
     (define-key python-mode-map (kbd "C-c C-r") 'python-shell-send-region)))

这篇关于将“发送代码更改为解释器” (C-c |)命令在python模式的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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