5

I want all the file tabs in Sublime text to be of uniform size that increase or decrease uniformly depending on the number of tabs that are added or removed (Like how tabs work in Google Chrome). Currently the size of the tab changes according to the length of the file name that is open in that tab. This results in uneven sized tabs. I am currently using the Default Sublime theme Adaptive.sublime-theme. I tried adding the tab_width property to this theme but it didn't make any difference.

 // Tabs
{
    "class": "tabset_control",
    "layer0.opacity": 1.0,
    "content_margin": [4, 0, 8, 0],
    "tint_index": 0,
    "tab_height": 34,
    "tab_overlap": 16,
    "tab_width":10
},
2
  • 1
    Ended up here because I also want this. Did you ever manage it?
    – Chud37
    Commented Mar 5, 2019 at 13:18
  • @Chud37 I kind of gave up on it, I am hoping someone with better understanding of sublime text will come along and read this question and give me some kind of hint. But considering the low number of upvotes on this question I doubt anyone will see this question unless they search for similar keywords.
    – Ghos3t
    Commented Mar 6, 2019 at 1:07

2 Answers 2

1

I was looking for the exact functionality you described. You can check out Sublime's theme docs on tabs, and unfortunately, there is no tab_max_width property, which would be ideal, but there is a work around.

Basically the strategy I went with is to set the tab_min_width wide enough to fit almost any file name. So since you're using the Adaptive theme, create a file of the same name in the Sublime User folder called Adaptive.sublime-theme, and add the following:

[
  {
    "class": "tabset_control",
    "tab_min_width": 270,
  }
]

Since the file is of the same name as the current theme, it will overwrite any rules set there. 270 is what worked for me since I'm dealing with pretty long file names. The downside is that short file names have a lot of padding in their tabs. Also, really, really long file names will still have tabs wider than the others, so it's not a perfect solution, but works for me 99% of the time.

1

As the other poster pointed out, there's no setting in Sublime 4 for fixed tab width (annoying!) However the tab behavior can be brought closer to Sublime 3 with this setting:

"enable_tab_scrolling": false,

Newly opened tabs will force older tabs to shrink, and Sublime 4 proportionally shrinks the longest tabs first. To maximize tab area, I also remove the new tab button (which I never click on):

"hide_new_tab_button": true,

Hope that helps.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .