feat: add kill-other-buffers function
Convenience function to prune buffers. This will kill all buffers except for scratch and Messages
This commit is contained in:
parent
8014257b46
commit
342307ce23
1 changed files with 18 additions and 0 deletions
18
config.org
18
config.org
|
|
@ -10,6 +10,7 @@
|
|||
- [[#emacs-262][Emacs 26.2]]
|
||||
- [[#utils][Utils]]
|
||||
- [[#custom-command-line-arguments][Custom command line arguments]]
|
||||
- [[#kill-other-buffers][Kill other buffers]]
|
||||
- [[#global-variables][Global variables]]
|
||||
- [[#ripgrep][Ripgrep]]
|
||||
- [[#term][Term]]
|
||||
|
|
@ -143,6 +144,23 @@ If it was found, we delete it from the list of command line arguments.
|
|||
found-switch))
|
||||
#+END_SRC
|
||||
|
||||
** Kill other buffers
|
||||
|
||||
Function to kill other buffers but the current open one (and some standard buffers which should be kept alive).
|
||||
Stolen from https://www.emacswiki.org/emacs/KillingBuffers .
|
||||
|
||||
#+BEGIN_SRC emacs-lisp
|
||||
|
||||
(setq not-to-kill-buffer-list '("*scratch*" "*Messages*"))
|
||||
|
||||
(defun kill-other-buffers ()
|
||||
"Kill all other buffers."
|
||||
(interactive)
|
||||
(if (member (buffer-name (current-buffer)) not-to-kill-buffer-list)
|
||||
(bury-buffer)
|
||||
(kill-buffer (current-buffer))))
|
||||
#+END_SRC
|
||||
|
||||
** Global variables
|
||||
|
||||
Some package behave strangely if we have custom command line parameters.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue