Skip to content

Instantly share code, notes, and snippets.

@dsjt
Last active January 24, 2017 03:02
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dsjt/a9e76f11191446f6e32c7cfe3b188b2a to your computer and use it in GitHub Desktop.
Save dsjt/a9e76f11191446f6e32c7cfe3b188b2a to your computer and use it in GitHub Desktop.
開いたバッファを掃除するemacsコマンド
(require 'cl)
;;;###autoload
(defun my/kill-other-buffers ()
"Kill all other buffers."
(interactive)
(loop for buf in (buffer-list)
unless (or
(get-buffer-window buf)
(string= (substring (buffer-name buf) 0 1) " ")
(get-buffer-process buf)
(member (buffer-name buf) ;; 消さないバッファ名を指定
'("*Messages*" "*Compile-Log*" "*Help*"
"*scratch*")))
do (kill-buffer buf)))
(global-set-key (kbd "C-l C-c C-c") 'my/kill-other-buffers)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment