Home Download Buy Blog Forum Support

Example preferences file?

Example preferences file?

Postby ryaninmiami on Wed Sep 05, 2012 3:05 pm

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:

Code: Select all
[
   {
      "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)

Code: Select all
{
   "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)

Code: Select all
{
   "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.
ryaninmiami
 
Posts: 7
Joined: Wed Sep 05, 2012 2:53 pm

Re: Example preferences file?

Postby jbjornson on Wed Sep 05, 2012 3:16 pm

Code: Select all
{
   "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...
}
jbjornson
 
Posts: 348
Joined: Tue Oct 27, 2009 4:25 pm
Location: Zurich, Switzerland

Re: Example preferences file?

Postby jbjornson on Wed Sep 05, 2012 3:20 pm

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

This should work:
Code: Select all
    {
       "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
    }
jbjornson
 
Posts: 348
Joined: Tue Oct 27, 2009 4:25 pm
Location: Zurich, Switzerland

Re: Example preferences file?

Postby ryaninmiami on Wed Sep 05, 2012 3:38 pm

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

This should work:
Code: Select all
    {
       "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
    }


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.
ryaninmiami
 
Posts: 7
Joined: Wed Sep 05, 2012 2:53 pm

Re: Example preferences file?

Postby jbjornson on Thu Sep 06, 2012 8:41 am

ryaninmiami wrote: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.


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.
Code: Select all
[
    {
        "class": "sidebar_label",
        "font.size": 18
    }
]


ryaninmiami wrote: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.


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 (https://github.com/buymeasoda/soda-theme/). A bunch more have cropped up (mostly based on the Soda themes) and buymeasoda has even created a bit of documentation on how to make customization to themes (https://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):
https://github.com/buymeasoda/soda-theme
https://github.com/netatoo/phoenix-theme
https://github.com/cafarm/aqua-theme
https://github.com/nilium/st2-nil-theme

Good luck and remember to post your results if you are able to get it working.
jbjornson
 
Posts: 348
Joined: Tue Oct 27, 2009 4:25 pm
Location: Zurich, Switzerland

Re: Example preferences file?

Postby ryaninmiami on Thu Sep 06, 2012 2:00 pm

jbjornson wrote: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.
Code: Select all
[
    {
        "class": "sidebar_label",
        "font.size": 18
    }
]



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.

jbjornson wrote: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 (https://github.com/buymeasoda/soda-theme/). A bunch more have cropped up (mostly based on the Soda themes) and buymeasoda has even created a bit of documentation on how to make customization to themes (https://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):
https://github.com/buymeasoda/soda-theme
https://github.com/netatoo/phoenix-theme
https://github.com/cafarm/aqua-theme
https://github.com/nilium/st2-nil-theme


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.
ryaninmiami
 
Posts: 7
Joined: Wed Sep 05, 2012 2:53 pm

Re: Example preferences file?

Postby jbjornson on Thu Sep 06, 2012 2:05 pm

ryaninmiami wrote:But that doesn't seem to work. When I try to structure my user preferences file ...


Please re-read my post. You need to add this to a .sublime-theme file and not the user preferences file.
jbjornson
 
Posts: 348
Joined: Tue Oct 27, 2009 4:25 pm
Location: Zurich, Switzerland

Re: Example preferences file?

Postby ryaninmiami on Fri Sep 07, 2012 2:04 pm

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?

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: http://www.sublimetext.com/docs/2/settings.html
ryaninmiami
 
Posts: 7
Joined: Wed Sep 05, 2012 2:53 pm

Re: Example preferences file?

Postby jbjornson on Mon Sep 10, 2012 7:49 am

ryaninmiami wrote: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?


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:
Code: Select all
    "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: http://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.
jbjornson
 
Posts: 348
Joined: Tue Oct 27, 2009 4:25 pm
Location: Zurich, Switzerland

Re: Example preferences file?

Postby ryaninmiami on Mon Sep 10, 2012 3:15 pm

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.
ryaninmiami
 
Posts: 7
Joined: Wed Sep 05, 2012 2:53 pm

Next

Return to Technical Support

Who is online

Users browsing this forum: QED1224 and 26 guests