Sublime Forum

Example preferences file?

#1

Trying to adjust the settings for this editor is killing me, and I’m not a dumb guy. The total lack of documentation really is not helping. I can’t even figure out the structure of the user preferences file because it doesn’t seem to match the structure of the default preferences file. Can anybody point me to an example of a user preferences file with more than one section?

I’m trying to increase the size of the font in the side bar by copying the relevant settings from the default settings file in Default.sublime-theme into my user preferences file in Preferences.sublime-settings, as I’ve seen many people advise. But nobody is posting example code, there is very little useful documentation, and this doesn’t work:


	{
		"color_scheme": "Packages/Color Scheme - Default/Solarized (Light).tmTheme",
		"font_size": 15.0,
		"rulers": [100]
	},
	{
	    "class": "sidebar_label",
	    "parents": {"class": "tree_row", "attributes": "selected"]}],
	    "color": [255, 255, 255],
	    "font_size": 20
	    // , "shadow_color": [60, 60, 60], "shadow_offset": [0, 1]
	}
]

The sample preferences file in the documentation is kind of useless because it only contains one section. I tried to turn that one section into multiple sections by turning it into a JSON array like in the default preferences file, but when I do that the entire user preferences file is ignored and the Solarized theme doesn’t get used.

This also doesn’t work: (no surprise)

{
	"color_scheme": "Packages/Color Scheme - Default/Solarized (Light).tmTheme",
	"font_size": 15.0,
	"rulers": [100]
}

{
    "class": "sidebar_label",
    "parents": {"class": "tree_row", "attributes": "selected"]}],
    "color": [255, 255, 255],
    "font_size": 20
    // , "shadow_color": [60, 60, 60], "shadow_offset": [0, 1]
}

This also doesn’t work: (no surprise)

{
	"color_scheme": "Packages/Color Scheme - Default/Solarized (Light).tmTheme",
	"font_size": 15.0,
	"rulers": [100]

	"class": "sidebar_label",
	"parents": {"class": "tree_row", "attributes": "selected"]}],
	"color": [255, 255, 255],
	"font_size": 20
}

I’ve wasted a solid hour on this and I’m giving up now. This kind of massive time-wasting hassle is the main reason why I’m still undecided about switching from TextMate to Sublime Text 2.

0 Likes

#2
{
	"font_face": "Droid Sans mono",
	"font_options":
	
		"directwrite",
		"subpixel_antialias"
	],
	"font_size": 11,
	"indent_guide_options":
	
		"draw_normal",
		"draw_active"
	],
	"indent_subsequent_lines": true,
	"new_window_settings":
	{
		"show_minimap": true,
		"show_tabs": true,
		"side_bar_visible": true,
		"status_bar_visible": true
	}
        //etc...
}
0 Likes

#3

Your last attempt almost worked…you were just missing a comma after the first section of settings.

This should work:

    {
       "color_scheme": "Packages/Color Scheme - Default/Solarized (Light).tmTheme",
       "font_size": 15.0,
       "rulers": [100],

       "class": "sidebar_label",
       "parents": {"class": "tree_row", "attributes": "selected"]}],
       "color": [255, 255, 255],
       "font_size": 20
    }
0 Likes

#4

[quote=“jbjornson”]Your last attempt almost worked…you were just missing a comma after the first section of settings.

This should work:

[code]
{
“color_scheme”: “Packages/Color Scheme - Default/Solarized (Light).tmTheme”,
“font_size”: 15.0,
“rulers”: [100],

   "class": "sidebar_label",
   "parents": {"class": "tree_row", "attributes": "selected"]}],
   "color": [255, 255, 255],
   "font_size": 20
}

[/code][/quote]

Thank you very much for trying to help. But no, that doesn’t work. That sets the font for the editor, not the side bar.

Thank you for posting your actual preferences file. I’m going to try to express what I’m trying to do with nested JSON hashes like in the “new_window_settings” section in your file.

But the simple fact that this is turning into a multi-hour coding exercise that doesn’t happen easily even with people helping just really doesn’t say good things about Sublime Text 2. I don’t mind hacking JSON or XML or whatever to configure software, but if that’s how it’s going to work then the documentation and examples really need some massive improvement.

0 Likes

#5

Sorry, I missed this in the initial post. I think (guess) that the sidebar font is set in the theme file (*.sublime-theme). Assuming you are using the default theme, you need to make a Default.sublime-theme file in the User directory and add your changes there.

The following contents changed the size of the text in my sidebar, but the height of the tree entries would also need to be adjusted to make space for the entries. It’s not exactly what you want, but it’s a start.


    {
        "class": "sidebar_label",
        "font.size": 18
    }
]

[quote=“ryaninmiami”]
But the simple fact that this is turning into a multi-hour coding exercise that doesn’t happen easily even with people helping just really doesn’t say good things about Sublime Text 2. I don’t mind hacking JSON or XML or whatever to configure software, but if that’s how it’s going to work then the documentation and examples really need some massive improvement.[/quote]

I agree that the documentation is sparse. The themes (skins) for Sublime are pretty user-unfriendly but there is no suggestion anywhere that they are easy to change. I would suggest looking at some of the user-submitted themes for something closer to your liking (or simply to find out how they were able to achieve a change that you like). The first user generated themes that I remember were the Soda Light and Soda Dark themes by buymeasoda (github.com/buymeasoda/soda-them … tomisation ). You might also find some other user-submitted themes that provide the look that you want. Here are a few that I have tried (I am currently using Pheonix Dark):
github.com/buymeasoda/soda-theme
github.com/netatoo/phoenix-theme
github.com/cafarm/aqua-theme
github.com/nilium/st2-nil-theme

Good luck and remember to post your results if you are able to get it working.

0 Likes

#6

Thank you very much. But that doesn’t seem to work. When I try to structure my user preferences file as a JSON array like in your example, Sublime Text 2 simply ignores the entire user preferences file. Which leads me to the conclusion that the structure for the user preferences file is NOT the same as the structure for the default preferences file that I’m supposed to be copying settings out of.

[quote=“jbjornson”]I would suggest looking at some of the user-submitted themes for something closer to your liking (or simply to find out how they were able to achieve a change that you like). The first user generated themes that I remember were the Soda Light and Soda Dark themes by buymeasoda (github.com/buymeasoda/soda-them … tomisation ). You might also find some other user-submitted themes that provide the look that you want. Here are a few that I have tried (I am currently using Pheonix Dark):
github.com/buymeasoda/soda-theme
github.com/netatoo/phoenix-theme
github.com/cafarm/aqua-theme
github.com/nilium/st2-nil-theme
[/quote]

All of the theme files in those examples seem to be structured as a JSON array of nested hashes, rather than as a hash like in the user preferences file. Even your example that you posted here is structured as a hash, not an array. If I try to structure my user preferences file as an array then Sublime Text 2 ignores it.

It leaves a really sour taste in my mouth for software developers to tell me that I have to edit a text file to change any preferences – without providing useful documentation on how to do that. It’s the same kind of sour taste that I was left with after I paid for TextMate right before it was abandoned for years. Two days (so far) and hours of time invested, just to figure out how to specify a font setting. Any professional software developer’s time is worth too much to spend it hassling over tools that lack either documentation or source code.

0 Likes

#7

[quote=“ryaninmiami”]
But that doesn’t seem to work. When I try to structure my user preferences file …[/quote]

Please re-read my post. You need to add this to a .sublime-theme file and not the user preferences file.

0 Likes

#8

Okay yes thank you, that might be the part that I’m missing.

So then what’s the purpose of the user preferences file? Is this documentation just totally incorrect, or am I missing something?

[quote]To see what settings are available, and a description of each, take a look at Packages/Default/Preferences.sublime-settings. You can access this file from the Preferences/Settings - Default menu item.

When you’ve found some settings you’d like to change, add them to your User Settings (accessible from the Preferences/Settings - User menu), so they’re preserved when upgrading.

from: sublimetext.com/docs/2/settings.html
[/quote]

0 Likes

#9

[quote=“ryaninmiami”]Okay yes thank you, that might be the part that I’m missing.

So then what’s the purpose of the user preferences file? Is this documentation just totally incorrect, or am I missing something?
[/quote]

I think you’re taking that statement a bit too literally. Not everything is controlled by the user preferences file, especially things that require lots of settings like the editor look and feel (.sublime-theme) or the syntax highlighting specifications (.tmTheme). These kind of settings require their own settings file and are referred to in the user preferences, for example:

    "theme": "Default.sublime-theme",
    "color_scheme": "Packages/Color Scheme - Default/Monokai.tmTheme",

It wouldn’t make sense to have changes to the editor theme or color scheme cluttering up the user preferences: have a look at one of these files and you’ll see that there is quite a bit of information in them.

There are a lot of other settings for the editor that are stored in files other than the user preferences. For example:

  • Snippets are stored in .sublime-snippet files
  • Build definitions are stored in .sublime-build files
  • Keyboard shortcuts are stored in .sublime-keymap files
  • Plugins are stored in python files (.py)
  • Language specifications are stored in .tmLanguage files
  • etc…

You might find this site helpful: docs.sublimetext.info

It’s a bit unfortunate that you chose part of the editor look-and-feel as your first attempt at customization, which is not the simplest of tasks.

0 Likes

#10

Thank you very much for helping me out here. When I set out to change a font setting, I didn’t think of it as “customization” of a theme. I really appreciate your help.

This experience really doesn’t make me more inclined to pay money for this editor. I feel like I have to hassle as much with Sublime Text 2 as with Emacs or Vi just to change simple settings, and there is a LOT more documentation on how to deal with those products. But ultimately, reverse engineering a bunch of source files to change a font setting is not how I want to spend my valuable time, whether the product is free or not. The whole point of paying money for a newer GUI editor is to advance beyond those decades-old editors and their arcane configuration files. This thing just feels like an Emacs that’s based on Python instead of Lisp. With less documentation.

0 Likes

#11

Obviously it’s your prerogative to like or dislike the editor. Part of the reason there is very little documentation is because the editor is only a few years old (whereas vim and emacs are decades old). I’ve been using it for about 2.5 years and I honestly can’t imagine working without it. I would suggest that you have some patience and discover the reasons why so many people are so passionate about using SublimeText. Changing the font in the sidebar isn’t a necessity, so you should be able to still learn about the core functionality in the mean time. You might discover that some of the other features make it worth buying, even if it isn’t as easy as you want to be able to change the sidebar. Hell, Jon might eventually include something that will help out with customization of SublimeText.

0 Likes

#12

I’m sorry to vent on you like that. I really do appreciate your help.

Today I’m allowing one hour to figure out how to set the default indentation for Ruby mode to two spaces instead of tabs. I think that an hour is being very generous with the patience when we’re talking about a tools that’s supposed to be making me more productive instead of less. If I can’t set the default indentation to two spaces within an hour then I’m deleting this editor.

0 Likes

#13

Well, it just barely made the cut. Not due to good documentation, but because indentation settings happen to be the example in this file: sublimetext.com/docs/2/settings.html

Thank you again for your help with the “theme customization” (setting). I guess I’ll be around for a least a little while longer. I was originally considering whether to purchase this editor for the developers who work under me but if I did that then I would become the guy who would have to hassle with all of these configuration issues for a bunch of other people and that is definitely not going to happen. Chocolat for them, I think. But I’ll keep tinkering with Sublime.

0 Likes