4

I'm trying out Sublime Text 2. I know that I can see the value of a particular setting by entering a console command like so:

>>> view.settings().get("word_wrap")
True

But is there a way to get all current settings—ideally in JSON format? Since these don't seem to be documented anywhere, I'm mainly looking for things I might want to override in my user settings file.

3 Answers 3

1

You can see the defaults for the program bu looking in the Preferences -> File settings - Default or Preferences -> Global settings - Default. These are the defaults you can overwrite with your settings, and are therefore what the values are when you first install the program.

By looking through these, you can see what you'd like to change.

1
  • Thanks, I was hoping to see everything in one place, but this is probably my best option. Jan 19, 2012 at 16:31
0

Which OS? Assuming Windows, even though you seem to be using Python?...

I have not tried the v2 beta, but on 1.4 I have the settings in the program folder in .\Data\Packages\Default\Options\Application.sublime-options. I have it installed as a portable app, so the file may be in %APPDATA% for you.

1
  • I'm on a Mac, but that shouldn't matter. Settings are handled differently in Sublime Text 2 (which has an integrated Python console); they're spread across several files. Jul 23, 2011 at 2:01
0

As of Sublime Text build 4126, you can use the to_dict() method to get a dictionary of the settings, and then iterate over it. So:

for k, v in view.settings().to_dict().items():  print(f"{k}: {v}")

or if you prefer multiple lines:

for k, v in view.settings().to_dict().items():
    print(f"{k}: {v}")

(note you can hit ctrl-enter (Linux/Win) to enter multi-line commands into the python console)

The output will look something like this (on my machine at least):

WrapPlus.break_long_words: False
WrapPlus.break_on_hyphens: False
WrapPlus.include_line_endings: auto
adaptive_dividers: False
allow_git_home_dir: False
always_prompt_for_file_reload: False
...
<snip>

You must log in to answer this question.

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