Sublime Forum

How Do I Access Tab Sidebar ("OPEN FILES") List from a Plugin?

#1

When I have 30+ files open I am finding it easy to “lose” files and have to take a long time to scan the OPEN FILES list with my eyes to find files I know I already have open. I am finding it easier sometimes (because the FOLDERS tree is organized by path) to go there and click the file again. But this is awfully time consuming.

Thus, I would very much like to be able to programmatically access the OPEN FILES list and perhaps create a Package that would offer the ability to sort the list and modify the coloring of individual items (with the side effect that the TABs [Sheets] also get sorted).

Examples I would find VERY useful: sort by:

  • full path (this groups related files together)
  • filename
  • file extension

And I would like to be able to color individual items based on the top-level directory in the full-path sort, thus causing files from “different projects” or different “mount points” in the FOLDERS list to have different foreground and/or background colors.

I have looked through the classes defined in sublime.py and sublime_plugin.py but haven’t found anything that looks promising yet.

0 Likes

How do I insert a snippet with $PARAMn variables from a plugin?
#2

The Sort​Tabs package seems to do what you want. On the programming side Window.views() gives you the list of open files.

0 Likes

#3

Thank you! I will check into both of these!

0 Likes