Menu

Don’t kill-buffer, kill-this-buffer instead

Here’s a tiny tip. By default C-x k runs the command kill-buffer which prompts you for which buffer you want to kill, defaulting to the current active buffer. I don’t know about you, but I rarely want to kill a different buffer than the one I am looking at, so I rebind C-x k to kill-this-buffer which just kills the current buffer without prompting (unless there are unsaved changes).

This is the kind of thing that is clearly better, but muscle memory might stop this from ever helping me. I’m going to try it out, but I’m expecting that for at least a month or two, I’m going to keep finding myself in a random directory after killing a buffer and instinctively hitting RET