简体   繁体   中英

Close all buffers in Emacs but preserve neotree open

I'm using the Emacs Neotree plugin that provides a filebrowser sidebar for Emacs, and I have this function to close all buffers but the current one:

(defun kill-other-buffers ()
  "Close all other buffers."
  (interactive)
  (mapc 'kill-buffer (delq (current-buffer) (buffer-list))))

It works ok, but it closes the neotree navigation too and I want it to remain open. Any idea on how I can get this done?

由于neo-buffer-name在neotreel.el中定义为*NeoTree* ,因此以下更改应可解决问题:

(mapc 'kill-buffer (delq neo-buffer-name (delq (current-buffer) (buffer-list))))

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM