Change the “send code to interpreter” (C-c |) comm

2019-05-13 18:20发布

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条回答
三岁会撩人
2楼-- · 2019-05-13 19:16

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)))
查看更多
登录 后发表回答