What Is the Key Sequence for Closing the Current Buffer in Emacs?

If I click on File -> Close, it closes the buffer like I want, but doesn't list a key mapping. What is the key mapping?

1

5 Answers

You can use C-x k to kill current buffer. See Emacs Manual .

4

BKB has already given correct answer. Just wanted to add that C-h b lists the key bindings applicable in current buffer

2

Well, you can view the shortcut of any function with the Help command (C-h).

Press C-hw and then type the command name as you would in M-x mode.


For example (in your case):

  1. Press C-hw
  2. Type the name of the command: kill-buffer ( you can also use tab/space to autocomplete :) )
  3. Press RET

Hope that helps :)

0

The question asks how to kill the current buffer. Use M-x kill-this-buffer. On my Emacs, it is mapped to s-k. Fewer keystrokes is better!

6
  1. C-x k to kill the current buffer.
  2. C-x 0 to close the current window.
  3. C-x 1 to close every other window.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Alexander Ross

Alexander Ross

Gaming, Esports & Interactive Media Writer

Alexander Ross has covered the video game industry for a decade, writing deep dives on game design, esports tournaments, VR developments, and gaming culture.

Share this article
Twitter Facebook Pinterest