Sublime Forum

Indicate tab (window) on status bar


On the status bar, a user has indication of Line and Column where the cursor currently resides. Would it be possible to indicate the number for the tab (i.e., document) where the cursor resides? The key combination of “Alt”+"{1-9}" quickly permits switching documents. I realised it would by handy to know where I am – assuming it is 1 to 9 – before switching to another file in order to return to the original tab using just “Alt”+"#". If the cursor resides outside the range of 1-9, then show nothing.



Can be achieved via tiny plugin.

Create a in your User package and paste following content.

import sublime_plugin

class TabStatusListener(sublime_plugin.EventListener):
	def on_activated(self, view):
		window = view.window()
		if window:
			group, tab = window.get_view_index(view)
			view.set_status("zzz_group_view_index", f"Group {group + 1}, Tab {tab + 1}")


Works like a charm! Thanks, deathaxe!



FWIW: Ctrl+Tab will get you back to the last view if that helps (this includes if you had a split view).