centaur-tabs icon indicating copy to clipboard operation
centaur-tabs copied to clipboard

Keybindings to close current tab?

Open lararosekelley opened this issue 1 year ago • 2 comments

I'm hoping to write a function to allow me to redefine evil-quit in Evil mode so that when I type :q it does the following:

  1. Close current window if more than one window
  2. Close current centaur tab if more than one tab in current tab set
  3. Quit emacs if only one window/one tab

To do this, I need some way to call centaur-tabs-buffer-close-tab, but I'm not sure how to get the currently active tab to pass along - I noticed that centaur-tabs-do-close only responds to a mouse event. Is there a way to replicate that behavior programatically without the mouse?

lararosekelley avatar Nov 18 '24 20:11 lararosekelley

The tab displays depend on the buffer lists. If the buffer is killed, the tab is killed.

This is a bit out of the scope, so I recommend you add those changes to your configuration. You can also consider contributing to https://github.com/emacs-evil/evil-collection.

jcs090218 avatar Nov 19 '24 06:11 jcs090218

I would have thought kill-buffer is the function you want. C-x k

xpusostomos avatar Feb 07 '25 14:02 xpusostomos