emacscommon-lispsbclslimespacemacs

Emacs/Spacemacs — rebind SLIME `eval-last-expression-in-repl` (, s e) to ctrl-enter


I’m using emacs / spacemacs.

I see that:

, s e      # slime-eval-last-expression-in-repl

sends the current highlighted line to the repl and runs it, exactly what I want.

How to add a binding into emacs/spacemacs to do the same but using ctrl-enter / ctrl-RET ?


Solution

  • Put the following lines in your ~/.emacs file:

    (eval-after-load 'slime-repl 
      (define-key slime-repl-mode-map (kbd "<C-return>")
                  'slime-eval-last-expression-in-repl))
    

    If you have trouble getting this to work in terminal emacs (emacs -nw), check out this related question.