-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathCommand.txt
246 lines (243 loc) · 82.8 KB
/
Command.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
Commands
All ST's features, actions, behaviours, are combination of commands
There're Built-in commands [[#Built-in commands]] and User-written commands stored as *.py [[Plugin.txt]]
Commands can be triggered via:
Menubar
ST default items: [[Sublime Text.txt#Features (accessible via Menu bar)]]
User can add his own menus: [[sublime-menu.txt#Main.sublime-menu]]
Command Pallete [[Sublime Text.txt#Command Pallete]] [[#.sublime-commands]]
show_quick_panel [[Plugin.API.txt#show_quick_panel]]
Keybinding [[Key Binding.txt]]
Macro [[Macro.txt]]
Mouse click [[settings.txt#.sublime-mousemap]]
Console, i.e: Ctrl+` → window.run_command("insert", {"characters": "\n"})
*.py files
sublime.run_command("command_name", {<argument>}) # only fire ApplicationCommand
view.run_command("command_name", {<argument>}) # only fire TextCommands
self.view.window().run_command("command_name", {<argument>}) # fire all kind of commands
Example: self.view.window().run_command("insert", {"characters": "\n"})
*.sublime-commands files indicate which commands are shown in Tools > Command Pallete
Example of .sublime-commands:
[
{ "caption": "Save Project As", "command": "save_project_as" },
{ "caption": "Close Project", "command": "close_workspace" },
{ "caption": "Preferences: Browse Packages", "command": "open_dir", "args": {"dir": "$packages"} }
]
caption: Text for display in the command palette.
command: Name of command to be executed
args: Arguments to pass to command.
Built-in variable
| $packages | Folder path to \Data\Packages |
| $file_path | Current file path (without file name) |
| $file_name | Current file's base name & extension |
Built-in commands:
| Command Name | Required Argument | Optional Argument | Note |
|-----------------------------------------|------------------------------------------------------------|-------------------------------------------------|--------------------------------------|
| toggle_setting | "setting": "word_wrap" | | |
| insert | "characters": "some text" | | |
| set_encoding | "encoding": "utf-16 le" | | |
| | "encoding": "utf-16 be with bom" | | |
| | "encoding": "utf-8" | | |
| | "encoding": "Western (Windows 1252)" | | |
| show_panel | "panel": "find_in_files" | "where": "<current file>" | |
| | "panel": "incremental_find" | "case_sensitive": "false" | |
| | "panel": "find" | "highlight": "true" | |
| | "panel": "replace" | "in_selection": "false" | |
| | | "preserve_case": "false" | |
| | | "regex": "false" | |
| | | "show_context": "true" | |
| | | "use_buffer2": "true" | |
| | | "whole_word": "false" | |
| | | "wrap": "true" | |
| | "panel": "console" | "toggle": true | |
| clear_location | | | Clear "where" field of find_in_files |
| wrap_block | "begin": "{", "end": "}" | | Wrap next indented lines |
| add_directory | | | Add "where" field of find_in_files |
| hide_panel | "cancel": true | | |
| hide_overlay | | | |
| hide_auto_complete | | | |
| new_window | | | |
| save_all | | | |
| revert | | | |
| clone_file | | | |
| close_all | | | |
| close_window | | | |
| open_file | "file": "${packages}/Default/Preferences.sublime-settings" | "platform": "Windows" | |
| open_dir | "dir": "$packages" | | |
| prompt_open_file | | | |
| reopen_last_file | | | |
| switch_file | "extensions": ["cpp", "cxx",] | | |
| new_file | | | |
| save | | | |
| prompt_save_as | | | |
| close_file | | | |
| close | | | |
| reveal_in_side_bar | | | |
| toggle_side_bar | | | |
| toggle_show_open_files | | | |
| toggle_minimap | | | |
| toggle_tabs | | | |
| toggle_status_bar | | | |
| toggle_menu | | | |
| toggle_full_screen | | | |
| toggle_distraction_free | | | |
| save_project_and_workspace_as | | | |
| close_workspace | | | |
| prompt_add_folder | | | |
| refresh_folder_list | | | |
| left_delete | | | |
| right_delete | | | |
| undo | | | |
| redo | | | |
| redo_or_repeat | | | |
| soft_undo | | | |
| soft_redo | | | |
| cut | | | |
| copy | | | |
| copymove | | | |
| paste | | | |
| paste_and_indent | | | |
| paste_from_history | | | |
| move | "by": "characters" | "forward": true | |
| | "by": "lines" | "extend": true | |
| | "by": "words" | | |
| | "by": "word_ends" | | |
| | "by": "subwords" | | |
| | "by": "pages" | | |
| | "by": "stops" | "empty_line": true | |
| select_lines | "forward": true | | |
| move_to | "to": "bol" | "extend": true | |
| | "to": "eol" | | |
| | "to": "bof" | | |
| | "to": "eof" | | |
| scroll_lines | "amount": 1.0 | | |
| next_view | | | |
| prev_view | | | |
| next_view_in_stack | | | |
| prev_view_in_stack | | | |
| select_all | | | |
| split_selection_into_lines | | | |
| single_selection | | | |
| clear_fields | | | |
| insert_best_completion | "default": "\t" | "exact": true | |
| replace_completion_with_next_completion | | | |
| reindent | | "single_line": false | |
| indent | | | |
| next_field | | | |
| commit_completion | | | |
| insert | | | |
| unindent | | | |
| prev_field | | | |
| toggle_overwrite | | | |
| expand_selection | "to": "line" | | |
| | "to": "brackets" | | |
| | "to": "indentation" | | |
| | "to": "tag" | | |
| | "to": "scope" | | |
| expand_selection_to_paragraph | | | |
| find_under_expand | | | Expand Selection to Word |
| find_under_expandclose_tag | | | |
| toggle_record_macro | | | |
| run_macro | | | |
| run_macro_file | "file": "res://Packages/Default/Add Line.sublime-macro" | | |
| find_under_expand_skip | | | |
| commit_completion | | | |
| show_overlay | "overlay": "goto" | "text": "@" | |
| | | "show_files": true | |
| | "overlay": "command_palette" | "text": "something" | |
| goto_definition | | | |
| goto_symbol_in_project | | | |
| jump_back | | | |
| jump_forward | | | |
| jump_back | | | |
| jump_forward | | | |
| replace_next | | | |
| find_next | | | |
| find_prev | | | |
| find_under | | | |
| find_under_prev | | | |
| find_all_under | | | |
| slurp_find_string | | | |
| slurp_replace_string | | | |
| next_result | | | |
| prev_result | | | |
| next_misspelling | | | |
| prev_misspelling | | | |
| swap_line_up | | | |
| swap_line_down | | | |
| delete_word | "forward": false | | |
| toggle_comment | "block": true | | |
| | | | |
| join_lines | | | |
| duplicate_line | | | |
| auto_complete | | | Show Completions |
| replace_completion_with_auto_complete | | | |
| show_scope_name | | | |
| build | "variant": "Run" | | |
| exec | "kill": true | | |
| encode_html_entities | | | HTML: Encode Special Characters |
| transpose | | | |
| rot13 | | | Rot13 Selection |
| sort_lines | "case_sensitive": true | | |
| permute_lines | "operation": "reverse" | | |
| | "operation": "unique" | | |
| | "operation": "shuffle" | | |
| permute_selection | "operation": "reverse" | | |
| | "operation": "unique" | | |
| | "operation": "shuffle" | | |
| sort_selection | "case_sensitive": false | | |
| insert_snippet | "contents": "\"$0\"" | "name": "Packages/XML/long-tag.sublime-snippet" | |
| set_layout | "cols": [0.0, 1.0] | | |
| | "rows": [0.0, 1.0] | | |
| | "cells": [[0, 0, 1, 1]] | | |
| focus_group | "group": 1 | | |
| move_to_group | "group": 1 | | |
| focus_side_bar | | | |
| new_pane | | "move": false | |
| close_pane | | | |
| set_max_columns | "columns": 1 | | |
| focus_neighboring_group | | "forward": false | |
| detect_indentation | | | Guess Settings From Buffer |
| | | | |
| move_to_neighboring_group | | | |
| unexpand_tabs | "set_translate_tabs": true | | Indentation: Convert to Tabs |
| expand_tabs | "set_translate_tabs": true | | Indentation: Convert to Spaces |
| select_by_index | "index": 1 | | |
| next_bookmark | | | |
| prev_bookmark | | | |
| toggle_bookmark | | | |
| clear_bookmarks | | | |
| select_all_bookmarks | | | |
| wrap_lines | | "width": 70 | |
| upper_case | | | |
| lower_case | | | |
| title_case | | | |
| swap_case | | | |
| set_mark | | | |
| select_to_mark | | | |
| delete_to_mark | | | |
| swap_with_mark | | | |
| yank | | | |
| clear_bookmarks | "name": "mark" | | |
| show_at_center | | | Scroll to Selection |
| increase_font_size | | | |
| decrease_font_size | | | |
| fold | | | |
| unfold | | | |
| fold_by_level | "level": 1 | | |
| unfold_all | | | |
| fold_tag_attributes | | | |
| context_menu | | | |
| toggle_case_sensitive | | | |
| toggle_regex | | | |
| toggle_whole_word | | | |
| toggle_preserve_case | | | |
| find_all | "close_panel": true | | |
| replace_all | "close_panel": true | | |
| close_tag | "insert_slash": true | | |
| show_about_window | | | |
|-----------------------------------------|------------------------------------------------------------|-------------------------------------------------|--------------------------------------|
For more reference:
Preferences → Key bindings Default
Rename \Packages\Default.sublime-package to .zip → Extract → Open Default.sublime-commands
Data\Packages\User\Project\*.sublime-workspace → "find_state"