Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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!

like image 320
retrot Avatar asked Jul 17 '26 10:07

retrot


1 Answers

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)))
like image 73
jpkotta Avatar answered Jul 18 '26 23:07

jpkotta



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!