Change the “send code to interpreter” (C-c |) command in python-mode

我们两清 提交于 2019-12-07 15:55:43

问题


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!


回答1:


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)))


来源:https://stackoverflow.com/questions/25222833/change-the-send-code-to-interpreter-c-c-command-in-python-mode

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