Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

In emacs, how do I bind C-l to clear screen in slime?

Is there a way to bind C-l in SLIME to clear the screen?

Thank you!

like image 517
nosefouratyou Avatar asked Sep 18 '25 14:09

nosefouratyou


2 Answers

What you probably want is slime-repl-clear-buffer, which is by default bound to C-c M-o. You can bind the function on the Slime REPL buffer in the normal way, for example

(local-set-key [(control l)] 'slime-repl-clear-buffer)
like image 101
jlahd Avatar answered Sep 21 '25 07:09

jlahd


@nosefouratyou the problem with the add-hook was that you need to add it to the 'slime-repl-mode-hook instead of 'slime-mode-hook:

(defun my-slime-keybindings ()
  "For use in `slime-mode-hook' and 'slime-repl-mode-hook."
  (local-set-key (kbd "C-l") 'slime-repl-clear-buffer))

(add-hook 'slime-mode-hook      #'my-slime-keybindings)
(add-hook 'slime-repl-mode-hook #'my-slime-keybindings)
like image 24
Everton J. Carpes Avatar answered Sep 21 '25 07:09

Everton J. Carpes