Sublime Forum

Indicate tab (window) on status bar

#1

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.

0 Likes

#2

Can be achieved via tiny plugin.

Create a view_status.py 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}")
3 Likes

#3

Works like a charm! Thanks, deathaxe!

0 Likes

#4

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

0 Likes