Smart Systems for Home

Plain how-to guides for smart home, security and home Wi-Fi

Fix Sublime Text "Error Trying to Parse Settings

· 6 min read · Home Tech

In this article
  1. What You'll Need
  2. Step-by-Step
  3. Common Mistakes
  4. Tips
  5. Troubleshooting
  6. Frequently Asked Questions

When Sublime Text shows "Error trying to parse settings," it means one of your JSON settings files has a syntax error—usually a missing comma, a stray quote, or an extra brace. The fix is to locate the broken file, correct the JSON, and reload Sublime Text. Below is a step-by-step guide to find and repair the issue.

What You'll Need

  • Access to Sublime Text's installation and user configuration folders (usually under %APPDATA%\Sublime Text on Windows, ~/Library/Application Support/Sublime Text on macOS, and ~/.config/sublime-text on Linux).
  • A text editor that can show line numbers (Sublime Text itself, Notepad++, or any plain text editor).
  • Basic familiarity with JSON syntax (commas between items, curly braces for objects, square brackets for arrays).

Step-by-Step

  1. Open Sublime Text. If it crashes or shows the error dialog, note the exact filename mentioned in the error message. If no filename is shown, proceed to step 2.
  2. Close Sublime Text completely. Make sure no Sublime Text processes are running in the background (check the system tray or use Task Manager on Windows, Activity Monitor on macOS).
  3. Locate your user settings folder. This is where your personal configuration files live. The path varies by OS:
    - Windows: C:\Users\[YourUsername]\AppData\Roaming\Sublime Text\Packages\User
    - macOS: /Users/[YourUsername]/Library/Application Support/Sublime Text/Packages/User
    - Linux: /home/[YourUsername]/.config/sublime-text/Packages/User
    If you can't find it, in Sublime Text go to Preferences > Browse Packages (or Sublime Text > Preferences > Browse Packages on macOS) to open the Packages folder, then open the User subfolder.
  4. Look for recently modified files. The error is usually in a file you just edited or installed. Common culprits include Preferences.sublime-settings, Package Control.sublime-settings, or a keymap file like Default (Windows).sublime-keymap. Sort files by date modified to find the most recent ones.
  5. Open the suspected file in a text editor. Use Sublime Text itself if it still opens, or any plain text editor. Avoid word processors that add formatting.
  6. Check the JSON syntax. Look for these common issues:
    - Missing commas between key-value pairs or array items.
    - Trailing commas (JSON does not allow a comma after the last item).
    - Unbalanced curly braces { or square brackets [.
    - Unquoted keys or values (keys must be in double quotes).
    - Single quotes instead of double quotes.
    - Stray characters like a semicolon at the end.
  7. Use a JSON validator. Copy the file's contents into an online JSON validator (like jsonlint.com) or use a local tool. The validator will point to the exact line and column of the error.
  8. Fix the error. Correct the syntax based on the validator's feedback. For example, if it says "Unexpected token } at line 5," check if you have an extra closing brace or a missing comma before it.
  9. Save the file. Use File > Save (Ctrl+S on Windows/Linux, Cmd+S on macOS).
  10. Reopen Sublime Text. The error should no longer appear. If it does, repeat steps 3–9 for other recently modified files.

Common Mistakes

  • Editing the wrong file. There are both default settings (read-only) and user settings. The error is almost always in the user settings, not the defaults.
  • Forgetting to close Sublime Text. Some files are only read at startup, so the error might persist until you fully restart the application.
  • Using a word processor. Programs like Microsoft Word or Google Docs can insert smart quotes or other invisible characters that break JSON.
  • Adding comments. JSON does not support comments. If you added // or /* */, remove them.
  • Copy-pasting from a webpage. Sometimes copied text contains non-breaking spaces or other Unicode characters that look like spaces but aren't.

Tips

  • Back up your settings. Before making changes, copy the entire User folder to a safe location. This way you can restore if something goes wrong.
  • Use a JSON-aware editor. Sublime Text itself highlights JSON syntax errors with a red squiggly underline. If you can open the file in Sublime Text, look for the red marks.
  • Start with the most recently changed file. The error is almost always in a file you just edited or installed a package for.
  • If you use Package Control, check its settings. Sometimes a malformed package installation can corrupt the Package Control settings file.
  • Consider resetting a single setting. If you can't find the error, try removing the last few lines you added and test again.

Troubleshooting

If the error persists after fixing the obvious file:

  • Check all .sublime-settings files in the User folder. Open each one and validate it. The error message might not name the file, so you have to check them all.
  • Look in the Installed Packages folder. Some packages ship with their own settings that might be malformed. Navigate to Packages/User and also check Packages for any .sublime-settings files that are not in subfolders.
  • Temporarily rename the User folder. Close Sublime Text, rename the User folder to User_backup, and restart Sublime Text. If the error is gone, the problem is in one of your user files. You can then re-apply settings one by one from the backup.
  • Check the Sublime Text console. Open the console with Ctrl+` (backtick) on Windows/Linux, or Ctrl+` on macOS. The console might show a more detailed error message, including the file path and line number.
  • Update Sublime Text. If you're on an old version, a bug might be causing the issue. Download the latest version from the official website and install it (your settings are preserved).
  • Reinstall Sublime Text. As a last resort, uninstall and reinstall. This will not delete your user settings, but it will reset default settings. Back up your User folder first.

Frequently Asked Questions

What does "Error trying to parse settings" mean?

It means Sublime Text found a syntax error in one of its JSON settings files, so it couldn't read the file. The error prevents the settings from loading, which can cause features to break.

Will I lose my settings if I fix the error?

No. Fixing the syntax error only corrects the file's structure. Your actual settings (like theme, font size, key bindings) remain intact.

Can I use comments in Sublime Text settings files?

No. Sublime Text settings files are pure JSON, which does not support comments. If you see comments in examples online, they are often for illustration only and must be removed.

Why does the error mention a file I never edited?

Sometimes a package you installed writes its own settings file. The error might be in that file. Check the Packages/User folder for files from recently installed packages.

How do I find the exact line of the error?

Use an online JSON validator or open the file in Sublime Text and look for red squiggly underlines. The console (Ctrl+`) often shows the file path and line number.

Is there a way to reset all settings without losing everything?

You can temporarily rename the User folder to start fresh. Then copy back individual files one at a time to isolate the problem. This way you keep most of your settings.