Sublime Forum

Default.sublime-commands not taking effect for Sublime Text

#1

I’m using the build 3211. The contents of the file at location /Users/me/Library/Application Support/Sublime Text 3/Packages/User/Default.sublime-commands is the following.

[
    {
        "caption": "Preferences: Clang Format Settings - Default",
        "command": "open_file",
        "args": {"file": ["${packages}/User/clang_format.sublime-settings"]},
    },
]

But I don’t see any new command in the command palette even after an app restart. Has the behaviour changed?

0 Likes

#2

The file argument that you’re passing to the open_file command is a list of files, but it needs to be a single file. If you remove the [ and ] surrounding the file it should do what you want.

That said, the file it’s opening in is the User package; the - Default on the command name seems like a bit of a misnomer in that case since the - Default usually refers to the settings that are provided in some package. That’s not going to stop it from opening the file, though.

0 Likes

#3

oh wow, Thanks a lot!
I don’t see any logs in console… it could’ve been more helpful.

0 Likes

#4

Just used a package extractor to find edit_settings's usage in another package’s sublime-commands file:

[
  {
    "caption": "Preferences: Clang Format Settings",
    "command": "edit_settings",
    "args": {
      "base_file": "${packages}/Clang Format/clang_format.sublime-settings",
      "default": "// Settings in here override those in \"Clang Format/Clang Format.sublime-settings\"\n{\n\t$0\n}\n"}
    },
]
0 Likes