Re-open *scratch* buffer in Emacs?

后端 未结 16 1320
北海茫月
北海茫月 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 11:08

    I add following in my .emacs:

    ;; bury *scratch* buffer instead of kill it
    (defadvice kill-buffer (around kill-buffer-around-advice activate)
      (let ((buffer-to-kill (ad-get-arg 0)))
        (if (equal buffer-to-kill "*scratch*")
            (bury-buffer)
          ad-do-it)))
    

    If I don't want to see scratch buffer I press C-x C-k , but it doesn't kill it, just place in the end of buffer list, so then I need it next time I don't have to create new one.

提交回复
热议问题