Sublime Text 3 how to change the font size of the file sidebar?

119,554

Solution 1

The answers are omitting the square brackets, in the case one is creating the file from scratch.

To recap, for the ST3 users who don't have the Default.sublime-theme file (which is actually the default configuration), the simplest procedure is:

  1. Navigate to Sublime Text -> Preferences -> Browse Packages
  2. Open the User directory
  3. Create a file named Default.sublime-theme (if you're using the default theme, otherwise use the theme name, e.g. Material-Theme-Darker.sublime-theme) with the following content (modify font.size as required):

[
    {
        "class": "sidebar_label",
        "color": [0, 0, 0],
        "font.bold": false,
        "font.size": 12
    },
]

For reference, here there is the full file (as found in ST2).

Ubuntu 18.04

Location of theme setting on Ubuntu 18.04, installed via sudo apt install sublime-text:

~/.config/sublime-text-3/Packages/User/Default.sublime-theme

MacOS

Location of theme setting on MacOS, installed via DMG:

~/Library/Application\ Support/Sublime\ Text\ 3/Packages/User/Default.sublime-theme

Solution 2

On Ubuntu, for versions of Sublime older than 3.2, what worked for me was changing the dpi scale in Preferences > Settings — User by adding this line:

"dpi_scale": 1.10 

For Sublime 3.2, you can use the following line instead:

"ui_scale": 1.10

Adjust the scale value as needed. After this change, you have to restart Sublime Text for it to take effect.

Solution 3

I followed these instructions but then found that the menu hover color was wrong.

I am using the Spacegray theme in Sublime 3 beta 3074. So to accomplish the sidebar font color change and also hover color change, on OSX, I created a new file ~/Library/"Application Support"/"Sublime Text 3"/Packages/User/Spacegray.sublime-theme

then added this code to it:

[
    {
        "class": "sidebar_label",
        "color": [192,197,203],
        "font.bold": false,
        "font.size": 15
    },
     {
        "class": "sidebar_label",
        "parents": [{"class": "tree_row","attributes": ["hover"]}],
        "color": [255,255,255] 
    },
]

It is possible to tweak many other settings for your theme if you can see the original default:

https://gist.github.com/nateflink/0355eee823b89fe7681e

I extracted this file from the sublime package zip file by installing the PackageResourceViewer following MattDMo's instructions (https://stackoverflow.com/users/1426065/mattdmo) here:

How to change default code snippets in Sublime Text 3?

Solution 4

Navigate to Sublime Text>Preferences>Browse Packages. You should see a file tree.

In the Packages folder, you should see

Theme - Default > Default.sublime-theme (substitute Default for your theme name)

Open that file and find the "class": "sidebar_label: entry and add "font.size".

example:

    {
        "class": "sidebar_label",
        "color": [0, 0, 0],
        "font.bold": false,
        "font.size": 14
    },

Solution 5

I'm using Sublime Text 3.2.1, a 4k display and a Mac. Tab titles and the sidebar are difficult to read with default ST3 settings. I used the menus Sublime Text -> Preferences -> Settings which opens two files: Preferences.sublime-settings--Default and Preferences.sublime-settings--User.

You can only edit the User file. The Default file is useful for showing what variables you can set. Around line 350 of the Default file are two variables as shown below:

// Magnifies the entire user interface. Sublime Text must be restarted for
// this to take effect.
"ui_scale": 1.0,

// Linux only. Sets the app DPI scale - a decimal number such as 1.0, 1.5,
// 2.0, etc. A value of 0 auto-detects the DPI scale. Sublime Text must be
// restarted for this to take effect.
"dpi_scale": 0,

"dpi_scale": 3.0 did nothing on my Mac "ui_scale": 1.5 worked well. The following is my User file.

{
    "dictionary": "Packages/Language - English/en_US.dic",
    "font_size": 17,
    "ignored_packages":
    [
        "Vintage"
    ],
    "theme": "Default.sublime-theme",
    "ui_scale": 1.5
}
Share:
119,554
zhxchen17
Author by

zhxchen17

I love orange juice.

Updated on August 03, 2022

Comments

  • zhxchen17
    zhxchen17 almost 2 years

    Though I have tried to modify "font.size" in classes like "Label_control" and "sidebar_control" in the Package "Theme-Default", the font size of the editor does not change at all. Is there anything different in sublime text3?

  • dmackerman
    dmackerman over 10 years
    @Jails: I can confirm that it does indeed with with ST3.
  • daslicht
    daslicht about 10 years
    There no Theme Default in: "Sublime Text>Preferences>Browse Package" at least with the latest SL3 ?!
  • daslicht
    daslicht about 10 years
    Thats the SublimeText 3 theme default on my machine : gist.github.com/daslicht/eede77db7094e8518d5b There is no such entry ?
  • user937284
    user937284 over 9 years
    needed to add the complete config from gist.github.com/anonymous/89867e9cb63f7e811a39 to get it working.
  • Hung Tran
    Hung Tran over 9 years
    Because we need to use PackageResourceViewer, I think the answer needs to be updated.
  • Fery W
    Fery W about 9 years
    As per @nate-flink said, filename should be same as your current theme. I am using Material-Theme-Darker so I create Material-Theme-Darker.sublime-theme file under User folder.
  • Desmondo
    Desmondo over 8 years
    I'm using ST3 with Color Sublime, so I had to leave the file name as Default.sublime-theme instead of the Color Sublime theme name.
  • Enrico
    Enrico about 8 years
    This is a better solution if the whole UI is looking small (for example, when using a 4k display). I used a value of 1.5 under Ubuntu+XFCE.
  • Qwerty
    Qwerty about 8 years
    When changing the "font.size" I also recommend changing "sidebar_tree", "row_padding". I use [0,1]. See the linked ST2 file for syntax.
  • zooglash
    zooglash almost 8 years
    Simplest solution, but note that you have to restart Sublime Text for it to take effect.
  • R891
    R891 almost 8 years
    This seems like it should be the correct answer, because it should persist even if you change the theme.
  • gravidThoughts
    gravidThoughts almost 8 years
    In windows, this setting introduces line spacing some may not like. Use the [line_padding_top] and [line_padding_bottom] preferences to remove. For example, if you scale to 1.5, set both padding to values to -1.5. This will remove the spacing.
  • slashwhatever
    slashwhatever almost 8 years
    Only drawback here is that with fileicons enabled, these get stretched out too making it look pretty nasty: puu.sh/rd0TA/0600aa5ae9.png
  • TheRealFakeNews
    TheRealFakeNews over 7 years
    I used Solarized (Light), and creating a Solarized-(Light).sublime-theme file didn't work. Using Default.sublime-theme did.
  • Anwar
    Anwar over 7 years
    Great! Looking for it
  • DemoniacDeath
    DemoniacDeath over 7 years
    @gravidThoughts I encountered the same problem, although in my case there was also an increased width spacing between characters in a line. Setting line padding options solved the problem with line spacing, but not the problem with character spacing. Through experimenting with settings I figured out the solution to both problems: "font_options": ["gdi"] At least it works in my case (Windows 10)
  • gravidThoughts
    gravidThoughts over 7 years
    @DemoniacDeath Thanks for the tip.
  • ULI-R0
    ULI-R0 over 6 years
    @Jails Amazing! thanks for that, it worked like charm, in ST3 the method marked as answer here didn't worked for me as now packages are packed, and I needed what you suggested in order to view and edit the file :D! your suggestion should be the answer!
  • SAYE
    SAYE about 6 years
    thenks worked for me ! sublime 3 with Material Theme
  • Paulo Coghi
    Paulo Coghi about 5 years
    I can't find Preferences-> Default File preferences on ST3
  • Asaf
    Asaf about 5 years
    From Sublime 3.2 it's called ui_scale instead.
  • Mark Amery
    Mark Amery over 4 years
    This answer, now accepted, assumes the reader saw other answers first and is thus highly confusing to a new reader like me. "The answers are omitting the square brackets" - what? Which answers? Which brackets? "... in the case one is creating the file from scratch" - huh? Which file? "To recap" - what?! But this is the first thing I've read on this topic! "or the ST3 users who don't have the Default.sublime-theme file" - aah, what? How do I know if I have this file? A sentence and a half in, I'm already bewildered and unsure if the rest of this answer is relevant to me.
  • Mark Amery
    Mark Amery over 4 years
    dpi_scale seems to be entirely removed now (Sublime 3.2.2 on Ubuntu). ui_scale, on the other hand, still works perfectly for me.
  • Mark Amery
    Mark Amery over 4 years
    This changes the font size of the main editor region, not the sidebar.
  • bananaforscale
    bananaforscale over 4 years
    ST 3.2.2 on OS X - ui_scale is working as expected
  • Chud37
    Chud37 about 4 years
    @Asaf thanks, thats so helpful. For months i've been mildly annoyed by this using it on my 4k.
  • Martin Thoma
    Martin Thoma about 4 years
    I like Ubuntu Mono way better
  • Chud37
    Chud37 over 3 years
    Thanks for this. I think this is a better option than changing filesize, because if the font is too big the line spacing gets in the way. Whereas with this method the space is correct and the font looks bigger and easier to read. Also on a 4k monitor.
  • jeffci
    jeffci about 3 years
    Awesome ui_scale setting. This is an excellent setting for 4k!
  • hylaea
    hylaea over 2 years
    I found that I had to make changes in the theme settings, which can be found through Preferences > Customize Theme, rather than in color scheme settings, but I am using version 4. See sublimetext.com/docs/themes.html.
  • khaz
    khaz over 2 years
    ui_scale worked like a charm, thanks! As mentioned, it did require a restart, though