Change the Emacs “send code to interpreter” C-c C-r command in IPython-mode

后端 未结 3 1653
迷失自我
迷失自我 2021-01-03 06:48

The question here is related (but NOT identical) and complementary to Change the "send code to interpreter" (C-c |) command in python-mode .

I work on a M

3条回答
  •  失恋的感觉
    2021-01-03 07:05

    Use (kbd "RET")

    Try this with python.el

    (eval-after-load "python"
      '(define-key python-mode-map [(control c)(kbd "RET")] 'python-shell-send-region))
    

    WRT python-mode.el:

    (eval-after-load "python-mode"
      '(define-key python-mode-map [(control c) (kbd "RET")] 'py-execute-region))
    

    BTW unless IPython-exclusiv features are needed, recommend to execute code from Emacs through a common Python. IPython implements a bunch of cool things, which might appear orthogonal to Emacs, which also implements a bunch of cool things.

提交回复
热议问题