??????Ϣ??ο???
- Reference for Command Palette
- Complete documentation on the command palette options.
- ???????ο??ĵ?
- ?й????????ѡ????????ĵ???
Overview¶
The command palette is an interactive list bound to Ctrl+Shift+P whose
purpose is to execute commands. The command palette is fed entries with
commands files. Usually, commands that don’t warrant creating a key binding of
their own are good candidates for inclusion in a .sublime-commands file.
?????????һ???????? Ctrl+Shift+P ?Ľ????б??Ŀ??????ִ????????????
???????ļ????ϵ??ͨ?????????֤????һ?????????????? .sublime-commands
????ΪһЩ?ܺõĺ?ѡ??
File Format (Commands Files) ?ļ???ʽ???????ļ??? ============================
Commands files use JSON and have the .sublime-commands extension.
?????ļ?ʹ??JSON????????һ?? .sublime-commands ????չ??
Here’s an excerpt from Packages/Default/Default.sublime-commands::
?????????? Packages/Default/Default.sublime-commands ??ʵ??:
[
{ "caption": "Project: Save As", "command": "save_project_as" },
{ "caption": "Project: Close", "command": "close_project" },
{ "caption": "Project: Add Folder", "command": "prompt_add_folder" },
{ "caption": "Preferences: Default File Settings", "command": "open_file", "args": {"file": "${packages}/Default/Base File.sublime-settings"} },
{ "caption": "Preferences: User File Settings", "command": "open_file", "args": {"file": "${packages}/User/Base File.sublime-settings"} },
{ "caption": "Preferences: Default Global Settings", "command": "open_file", "args": {"file": "${packages}/Default/Global.sublime-settings"} },
{ "caption": "Preferences: User Global Settings", "command": "open_file", "args": {"file": "${packages}/User/Global.sublime-settings"} },
{ "caption": "Preferences: Browse Packages", "command": "open_dir", "args": {"dir": "$packages"} }
]
caption- Text for display in the command palette. ??ʾ??????????еı???.
command- Command to be executed. ??ִ?е?????.
args- Arguments to pass to
command. ????command?IJ?????
How to Use the Command Palette ???ʹ????????? ==============================
- Press
Ctrl+Shift+P - ???¼??̵?`Ctrl+Shift+P`
- Select command
- ѡ??????
The command palette filters entries by context, so whenever you open it, you
won’t always see all the commands defined in every .sublime-commands file.
???????ͨ???ı?????ѡ?????????ʲôʱ????㶼???ῴ??ÿһ?? .sublime-commands
?ļ??????????