Re-open *scratch* buffer in Emacs?

后端 未结 16 1318
北海茫月
北海茫月 2020-12-12 10:29

If I accidentally closed the scratch buffer in Emacs, how do I create a new scratch buffer?

16条回答
  •  無奈伤痛
    2020-12-12 10:55

    (global-set-key (kbd "C-x M-z")
                    '(lambda ()
                       (interactive)
                       (switch-to-buffer "*scratch*")))
    

    This will not only quickly switch to *scratch* buffer(since I do this frequently), but recreate a *scratch* buffer and enable lisp-interaction-mode automatically if you kill it accidentally. Change the binding as you like.

提交回复
热议问题