Option: On tab close select tab on right

Use case or problem

  • Tab behavior is different than Google Chrome, which generally selects tabs on the right.
  • Many popular editors allow on tab close, tab selection options

IntelliJ has options:

When the current tab is closed, activate:
- The tab on the left
- The tab on the right
- Most recently opened tab

Proposed solution

Add a setting like IntelliJ:

When the current tab is closed, activate:
- The tab on the left
- The tab on the right
- Most recently opened tab
3 Likes

partial work around

I’ve created a macro with the QuickAdd plugin that uses vanilla obsidian commands:

  • Close current tab
  • Wait for 100 ms
  • Go to next tab

Then reassigned the Ctrl+W hotkey from the default Close current tab command to this new macro. The “waiting” command is just there to allow the Close current tab command to execute before the Go to next tab, preventing the latter from executing prematurely. The sleep duration is entirely arbitrary and could be further shortened but works seamlessly as is.

Issues with solution

It is only a partial solution. If a user closes the last tab (as in last in the last in order) of a group, the Go to next tab cycles through and focuses on the first tab, instead of focusing on the new last tab as expected.