Main Tab Commands: slightly better keyboard shortcuts to open/close/switch tabs

Disclaimer

Is this plugin open source? Yes!
Is this plugin completely free? Yes!
Is this plugin vibe-coded beyond the author’s ability to comprehend how it works? No, it is not vibe-coded at all!
Community Directory: Main Tab Commands - Obsidian Plugin


Has this ever happened to you?

  • You have a bunch of tabs open with different notes
  • You press ctrl+W to close the current note
  • But instead it closes a sidebar widget!! What the heck!!!

If you answered yes, then this plugin is for you! It adds commands for tab management (close current tab, go to next/previous tab, etc) that only apply to your note tabs, not to sidebar widget tabs.

Obsidian’s built-in tab management commands will apply to the tab group you most recently interacted with. So, most of the time they will affect your note tabs. But if you’ve just clicked on a sidebar widget, they will affect your sidebar widget tabs instead. I personally hate this behavior and so I made this plugin to make the shortcuts reliably apply to your note tabs.

Bonus feature!

This plugin also has a setting to control which tab is focused after you close the current tab.

Check out my plugin if you want to

A little bit of setup is required after you install this plugin. Click here to get the plugin, and make sure to read the setup guide in the plugin description: Main Tab Commands - Obsidian Plugin

I hope it is useful to you :​)

1 Like

Just released an update. I added an option to prevent closing pinned tabs (since this plugin is incompatible with other plugins which add this functionality) and I renamed the plugin to “Slightly Better Tab Commands”.

1 Like

Thanks for That! BTW, this plugin(post) reminded me why I don’t use Ctrl+W to close tabs, I forgot that it was problematic. I somehow erased that shortcut from my brain and was closing tabs with mouse. I tried using it now and closed Vertical Tabs tab(I use it on the right to have file tree and vertical tabs at the same time, makes me feel smart).

Tab management in Obsidian needs overhaul(and well thought out NATIVE vertical tabs, but this have to be airtight or/and with maaany options/profiles). Guys from Vertical Tabs doing excellent job, but it is just a plugin.

1 Like

I tried your plugin for the “bonus feature” of landing on the desired tab when closing a tab.
It works on one level, but not recursively, which is not satisfactory.
Suppose I open/create tab First. Then Second. Then Third. If I close Third, I land in Second, which is correct. But if I now close Second I do not get on First.

When one works on something, one wants to be able to either view or create other notes, and then same from those other notes and so on. Closing tabs should pop the stack and lead us where we’re coming from.

Thanks for trying out my plugin and for giving feedback :​) Yeah, I only gave the “previous tab” setting one layer of recursion because that’s my personal preferred behavior.

However I just released version 2.1.0 of the plugin which adds a slider to increase the length of the history.

Please try out the update and let me know how it works for you!

I have 2.1.2 and now this function doesn’t work at all anymore, not only on one level.