diff --git a/docs/reference/commands.md b/docs/reference/commands.md index 28523220..7caf4c77 100644 --- a/docs/reference/commands.md +++ b/docs/reference/commands.md @@ -33,696 +33,692 @@ Often, relative paths in arguments to commands are assumed to start at the ## Commands -`build` -: Runs a build system. - - **variant** (String): Optional. The name of the variant to be run. - -`set_build_system` -: Changes the current build system. +### `append` +: Inserts a string at the end of the view. - - **file** (String): Path to the build system. If empty, Sublime Text tries - to automatically find an appropriate build systems from specified - selectors. - - **index** (Int): Used in the **Tools | Build System** menu but otherwise - probably not useful. + - **characters** (String): String to be inserted. + - **force** (Bool): + - **scroll_to_end** (Bool): -`new_build_system` -: Creates a new buffer and inserts a build system template. +### `auto_complete` +: Opens the auto complete list. -`toggle_save_all_on_build` -: Toggles whether all open files should be saved before starting the build. +### `build` +: Runs a build system. + - **variant** (String): Optional. The name of the variant to be run. +### `clear_bookmarks` +: If no **name** argument, or the **name** "bookmarks" is specified, it + removes all bookmarks set in the current file, but not the marks. If + the **name** "mark" is specified as an argument, it removes all marks set + in the current file, but not the bookmarks. -`run_macro_file` -: Runs a *.sublime-macro* file. + - **name** (String): e.g. `"mark"`, `"bookmarks"`. - - **file** (String): Relative path to the macro file. +### `clear_fields` +: Breaks out of the active snippet field cycle. -`insert_snippet` -: Inserts a snippet from a string or *.sublime-snippet* file. +### `clear_recent_files` +: Deletes records of recently accessed files and folders. - - **contents** (String): Snippet as a string to be inserted. Remember that - backslashes `\` have to be escaped, like in every other JSON string. - - **name** (String): [Relative path][About Paths in Command Arguments] to the - *.sublime-snippet* file to be inserted. +### `clear_recent_projects` +: Deletes records of recently accessed projects. -::: seealso -[Snippets][] -: Documentation on snippets and their variable features. -::: +### `clone_file` +: Clones the current view into the same tab group, both sharing the same + buffer. That means you can drag one tab to another group and every update to + one view will be visible in the other one too. -[Snippets]: ../guide/extensibility/snippets +### `close_file` +: Closes the active view and, under certain circumsances, the whole + application. + -`insert` -: Inserts a string. +### `close_folder_list` +: Removes all folders from the current project. - - **caracters** (String): String to be inserted. +### `close_project` +: Closes the current project. -`append` -: Inserts a string at the end of the view. +### `close_tag` +: Surrounds the current inner text with the appropiate tags. - - **characters** (String): String to be inserted. - - **force** (Bool): - - **scroll_to_end** (Bool): +### `close_window` +: Closes the active window. -`move` -: Advances the caret by predefined units. +### `close` +: Closes the active view. - - **by** (Enum): Values: *characters*, *words*, *word_ends*, *subwords*, - *subword_ends*, *lines*, *pages*, *stops*. - - **forward** (Bool): Whether to advance or reverse in the buffer. - - **word_begin** (Bool) - - **empty_line** (Bool) - - **punct_begin** (Bool) - - **separators** (Bool) - - **extend** (Bool): Whether to extend the selection. Defaults to `false`. +### `commit_completion` +: Inserts into the buffer the item that's currently selected in the auto + complete list. + -`move_to` -: Advances the caret to predefined locations. +### `context_menu` +: Shows the context menu. - - **to** (Enum): Values: *bol*, *eol*, *bof*, *eof*, *brackets*. - - **extend** (Bool): Whether to extend the selection. Defaults to `false`. +### `copy` +: Sends the selected text to to the system clipboard. -`open_file` -: Opens the specified file. - Will dynamically open resource files - from [sublime-package archives][] as read-only - if the specified *override file* does not exist. +### `cut` +: Removes the selected text and sends it to the system clipboard. Put + differently, it cuts. - - **file** (String): [Absolute or relative path][About Paths in Command Arguments] - to the file to be opened. Relative paths will originate from the recently +### `decrease_font_size` +: Decreases the font size. - Expands snippet-like variables, such as `$platform` and `$packages`. +### `delete_to_mark` +: Deletes the text that `select_to_mark` would select. - - **contents** (String): This string will be written to the new buffer if - the file does not exist. accessed directory (e.g. the directory of the currently opened file). +### `detect_indentation` +: Guesses the indentation from the current file. - .. XXX more variables? +### `duplicate_line` +: Duplicates the current line. -`open_dir` -: Opens the specified directory with the default file manager. +### `exec` +: Runs an external process asynchronously. On Windows, GUIs are supressed. - - **dir** (String): The directory to open. + `exec` is the default command used by build systems, thus it provides + similar functionality. However, a few options in build systems are taken + care of by Sublime Text internally so they list below only contains + parameters accepted by this command. -`open_file_settings` -: Opens the syntax-specific user settings file for the current syntax. + - **cmd** [(String)] + - **shell_cmd** (String): Shell command to use. If given overrides + `cmd` and ignores `shell`. + - **file_regex** (String) + - **line_regex** (String) + - **working_dir** (String) + - **encoding** (String) + - **env** [{String: String}] + - **quiet** (Bool): If `True` no runtime information is printed if the + command fails or has a non-zero exit code. + - **kill** (Bool): If `True` will simply terminate the current build + process. This is invoked via *Build: Cancel* command from the + [Command Palette][]. + - **update_phantoms_only** (Bool) + - **hide_phantoms_only** (Bool) + - **word_wrap** (Bool): Whether to word-wrap the output in the build panel + - **syntax** (String): Syntax file used to colour output. + - **path** (String) + - **shell** (Bool) -`new_window` -: Opens a new window. + ::: seealso + [`exec` Target options](https://www.sublimetext.com/docs/3/build_systems.html#exec_options) + : Detailed documentation on all parameters of the `exec` command. + ::: -`close_window` -: Closes the active window. +### `exit` +: Exits the whole application with all open windows. -`switch_file` -: Switches between two files with the same name and different extensions. +### `expand_selection` +: Extends the selection up to predefined limits. - - **extensions** (String): Extensions (without leading dot) for which - switching will be enabled. + - **to** (Enum): Values: *bol*, *hardbol*, *eol*, *hardeol*, *bof*, *eof*, + *brackets*, *line*, *tag*, *scope*, *indentation*. -`close` -: Closes the active view. +### `expand_tabs` +: XXX -`close_file` -: Closes the active view and, under certain circumsances, the whole - application. - + - **set_translate_tabs** (Bool) -`exit` -: Exits the whole application with all open windows. +### `find_all_under` +: Finds all occurrences of the current selection or the current word. -`reopen_last_file` -: Reopens the last closed file. +### `find_next` +: Finds the next occurrence of the current search term. -`save` -: Saves the active file. +### `find_prev` +: Finds the previous occurrence of the current search term. - - **encoding** (String): The file encoding to save as. +### `find_under_expand_skip` +: Adds a new selection based on the current selection or expands the + selection to the current word while removing the current selection. -`save_all` -: Saves all open files. +### `find_under_expand` +: Adds a new selection based on the current selection or expands the + selection to the current word. -`prompt_save_as` -: Prompts for a new file name and saves the active file. +### `find_under_prev` +: Finds the previous occurrence of the current selection or the current word. -`save_project_as` -: Prompts for a new file name and saves the current project. +### `find_under` +: Finds the next occurrence of the current selection or the current word. -`prompt_select_project` -: Opens a popup with recently accessed projects where you can fuzzy-search. +### `focus_group` +: Gives focus to the top-most file in the specified group. -`prompt_open_project` -: Prompts for a project file to open as a project. + - **group** (Int): The group index to focus. This is determined by the order + of `cells` items from the current layout (see [`Window.set_layout`][]). -`close_project` -: Closes the current project. +### `fold_by_level` +: Scans the whole file and folds everything with an indentation level of + `level` or higher. This does not unfold already folded regions if you first + fold by level 2 and then by 3, for example. Sections with cursors are not + folded. -`prompt_add_folder` -: Prompts for a folder to add to the current project. + - **level** (Int): The level of indentation that should be folded. `0` is + equivalent to running #### unfold_all. -`close_folder_list` -: Removes all folders from the current project. +### `fold_tag_attributes` + Folds all tag attributes in XML files, only leaving the tag's name and the + closing bracket visible. -`refresh_folder_list` -: Reloads all folders in the current project and updates the side bar. +### `fold` +: Folds the current selection and displays ``…`` instead. Unfold arrows are + added to the lines where a region has been folded. -`toggle_side_bar` -: Shows or hides the sidebar. +### `hide_auto_complete` +: Hides the auto complete list. -`toggle_show_open_files` -: Shows ot hides the open files in the sidebar. +### `hide_overlay` +: Hides the active overlay. Show the overlay using the show_overlay command. -`toggle_status_bar` -: Shows or hides the status bar. +### `hide_panel` +: Hides the active panel. -`toggle_full_screen` -: Toggles full screen mode on or off. + - **cancel** (Bool): Notifies the panel to restore the selection to what it + was when the panel was opened. (Only incremental find panel.) -`toggle_distraction_free` -: Toggles distraction free mode on or off. +### `increase_font_size` +: Increases the font size. -`toggle_tabs` -: Shows or hides the tab bar. +### `indent` +: Increments indentation of selection. -`toggle_minimap` -: Shows or hides the minimap. +### `insert_best_completion` +: Inserts the best completion that can be inferred from the current context. + -`left_delete` -: Deletes the character right before the caret. + - **default** (String): String to insert failing a best completion. -`right_delete` -: Deletes the character right after the caret. +### `insert_snippet` +: Inserts a snippet from a string or *.sublime-snippet* file. -`undo` -: Undoes the latest action. + - **contents** (String): Snippet as a string to be inserted. Remember that + backslashes `\` have to be escaped, like in every other JSON string. + - **name** (String): [Relative path][About Paths in Command Arguments] to the + *.sublime-snippet* file to be inserted. -`redo` -: Reapplies the latest undone action. +::: seealso +[Snippets][] +: Documentation on snippets and their variable features. +::: -`redo_or_repeat` -: Performs the latest action again. +[Snippets]: ../guide/extensibility/snippets - +### `insert` +: Inserts a string. -`soft_undo` -: Undoes each action stepping through granular edits. + - **caracters** (String): String to be inserted. -`soft_redo` -: Redoes each action stepping through granular edits. +### `join_lines` +: Joins the current line with the next one. -`cut` -: Removes the selected text and sends it to the system clipboard. Put - differently, it cuts. +### `left_delete` +: Deletes the character right before the caret. -`copy` -: Sends the selected text to to the system clipboard. +### `lower_case` +: Makes the selection lower case. -`paste` -: Inserts the clipboard contents after the caret. +### `move_to_group` +: Moves the current file to the specified group. - - **clipboard** (String): May be *selection*. XXX what other values are - allowed? + - **group** (Int): The group index to focus. See #### focus_group command. -`paste_and_indent` -: Inserts the clipboard contents after the caret and indents contextually. +### `move_to` +: Advances the caret to predefined locations. -`select_lines` -: Adds a line to the current selection. + - **to** (Enum): Values: *bol*, *eol*, *bof*, *eof*, *brackets*. + - **extend** (Bool): Whether to extend the selection. Defaults to `false`. - - **forward** (Bool): Whether to add the next or previous line. Defaults to - `true`. +### `move` +: Advances the caret by predefined units. -`scroll_lines` -: Scrolls lines in the view. + - **by** (Enum): Values: *characters*, *words*, *word_ends*, *subwords*, + *subword_ends*, *lines*, *pages*, *stops*. + - **forward** (Bool): Whether to advance or reverse in the buffer. + - **word_begin** (Bool) + - **empty_line** (Bool) + - **punct_begin** (Bool) + - **separators** (Bool) + - **extend** (Bool): Whether to extend the selection. Defaults to `false`. - **amount** \[Float\]\: Positive values scroll lines down and negative values - scroll lines up. +### `new_build_system` +: Creates a new buffer and inserts a build system template. -`prev_view` -: Switches to the previous view. +### `new_plugin` +: Creates a new buffer and inserts a plugin template (a text command). -`next_view` -: Switches to the next view. +### `new_snippet` +: Creates a new buffer and inserts a snippet template. -`next_view_in_stack` -: Switches to the most recently active view. +### `new_window` +: Opens a new window. -`prev_view_in_stack` -: Switches to the view that was active before the most recently active view. +### `next_bookmark` +: Select the next bookmarked region. - +### `next_field` +: Advances the caret to the text snippet field in the current snippet field + cycle. -`select_all` -: Select the view's content. +### `next_misspelling` +: Advance to the next misspelling -`split_selection_into_lines` -: Splits the selection into multiple selections, one on each line. +### `next_result` +: Advance to the next captured result. -`single_selection` -: Collapses multiple selections into a single selection. +### `next_view_in_stack` +: Switches to the most recently active view. -`clear_fields` -: Breaks out of the active snippet field cycle. +### `next_view` +: Switches to the next view. -`hide_panel` -: Hides the active panel. +### `open_dir` +: Opens the specified directory with the default file manager. - - **cancel** (Bool): Notifies the panel to restore the selection to what it - was when the panel was opened. (Only incremental find panel.) + - **dir** (String): The directory to open. -`hide_overlay` -: Hides the active overlay. Show the overlay using the show_overlay command. +### `open_file_settings` +: Opens the syntax-specific user settings file for the current syntax. -`hide_auto_complete` -: Hides the auto complete list. +### `open_file` +: Opens the specified file. + Will dynamically open resource files + from [sublime-package archives][] as read-only + if the specified *override file* does not exist. -`insert_best_completion` -: Inserts the best completion that can be inferred from the current context. - + - **file** (String): [Absolute or relative path][About Paths in Command Arguments] + to the file to be opened. Relative paths will originate from the recently - - **default** (String): String to insert failing a best completion. + Expands snippet-like variables, such as `$platform` and `$packages`. -`replace_completion_with_next_completion` - + - **contents** (String): This string will be written to the new buffer if + the file does not exist. accessed directory (e.g. the directory of the currently opened file). -`reindent` -: Corrects indentation of the selection with regular expressions set in the - syntax's preferences. The base indentation will be that of the line before - the first selected line. Sometimes does not work as expected. + .. XXX more variables? -`indent` -: Increments indentation of selection. +### `open_recent_file` +: Opens a recently closed file. -`unindent` -: Unindents selection. + - **index** (Int) -`detect_indentation` -: Guesses the indentation from the current file. +### `open_recent_folder` +: Opens a recently closed folder. -`next_field` -: Advances the caret to the text snippet field in the current snippet field - cycle. + - **index** (Int) -`prev_field` -: Moves the caret to the previous snippet field in the current snippet field - cycle. +### `open_recent_project` +: Opens a recently closed project. -`commit_completion` -: Inserts into the buffer the item that's currently selected in the auto - complete list. - + - **index** (Int) -`toggle_overwrite` -: Toggles overwriting on or off. +### `open_url` +: Opens the specified url with the default browser. -`expand_selection` -: Extends the selection up to predefined limits. + - **url** (String) - - **to** (Enum): Values: *bol*, *hardbol*, *eol*, *hardeol*, *bof*, *eof*, - *brackets*, *line*, *tag*, *scope*, *indentation*. +### `paste_and_indent` +: Inserts the clipboard contents after the caret and indents contextually. -`close_tag` -: Surrounds the current inner text with the appropiate tags. +### `paste` +: Inserts the clipboard contents after the caret. -`toggle_record_macro` -: Starts or stops the macro recorder. + - **clipboard** (String): May be *selection*. XXX what other values are + allowed? -`run_macro` -: Runs the macro stored in the macro buffer. +### `permute_lines` +: XXX -`save_macro` -: Prompts for a file path to save the macro in the macro buffer to. + - **operation** (Enum): *reverse*, *unique*, *shuffle* ...? -`show_overlay` -: Shows the requested overlay. Use the #### hide_overlay command to hide it. +### `permute_selection` +: XXX - - **overlay** (Enum): - The type of overlay to show. Possible values: + - **operation** (Enum): *reverse*, *unique*, *shuffle* ...? - - *goto*: Show the [Goto Anything][] overlay. - - *command_palette*: Show the [Command Palette][]. +### `prev_bookmark` +: Select the previous bookmarked region. - - **show_files** (Bool): If using the goto overlay, start by displaying - files rather than an empty widget. - - **text** (String): The initial contents to put in the overlay. +### `prev_field` +: Moves the caret to the previous snippet field in the current snippet field + cycle. +### `prev_misspelling` +: Move to the previous misspelling. -`show_panel` -: Shows a panel. +### `prev_result` +: Move to the previous captured result. - - **panel** (Enum): Values: *incremental_find*, *find*, *replace*, - *find_in_files*, *console* or *output.\*. - - **reverse** (Bool): Whether to search backwards in the buffer. - - **toggle** (Bool): Whether to hide the panel if it's already visible. +### `prev_view_in_stack` +: Switches to the view that was active before the most recently active view. -`find_next` -: Finds the next occurrence of the current search term. + -`find_prev` -: Finds the previous occurrence of the current search term. +### `prev_view` +: Switches to the previous view. -`find_under_expand` -: Adds a new selection based on the current selection or expands the - selection to the current word. +### `prompt_add_folder` +: Prompts for a folder to add to the current project. -`find_under_expand_skip` -: Adds a new selection based on the current selection or expands the - selection to the current word while removing the current selection. +### `prompt_open_project` +: Prompts for a project file to open as a project. -`find_under` -: Finds the next occurrence of the current selection or the current word. +### `prompt_save_as` +: Prompts for a new file name and saves the active file. -`find_under_prev` -: Finds the previous occurrence of the current selection or the current word. +### `prompt_select_project` +: Opens a popup with recently accessed projects where you can fuzzy-search. -`find_all_under` -: Finds all occurrences of the current selection or the current word. +### `redo_or_repeat` +: Performs the latest action again. -`slurp_find_string` -: Copies the current selection or word into the "find" field of the find - panel. + -`slurp_replace_string` -: Copies the current selection or word into the "replace" field of the find - and replace panel. +### `redo` +: Reapplies the latest undone action. -`next_result` -: Advance to the next captured result. +### `refresh_folder_list` +: Reloads all folders in the current project and updates the side bar. -`prev_result` -: Move to the previous captured result. +### `reindent` +: Corrects indentation of the selection with regular expressions set in the + syntax's preferences. The base indentation will be that of the line before + the first selected line. Sometimes does not work as expected. -`toggle_setting` -: Toggles the value of a boolean setting. This value is view-specific. +### `reopen_last_file` +: Reopens the last closed file. - - **setting** (String): The name of the setting to be toggled. +### `reopen` +: Reopens the current file. -`set_setting` -: Set the value of a setting. This value is view-specific. + - **encoding** (String): The file encoding the file should be reopened with. - - **setting** (String): The name of the setting to changed. - - **value** (\*): The value to set to. +### `replace_completion_with_auto_complete` +: XXX -`set_line_ending` -: Changes the line endings of the current file. +### `replace_completion_with_next_completion` + - - **type** (Enum): *windows*, *unix*, *cr* +### `reset_font_size` +: Resets the font size to the default -`next_misspelling` -: Advance to the next misspelling + *Note*: This essentially removes the entry from your User settings, there + might be other places where this has been "changed". -`prev_misspelling` -: Move to the previous misspelling. +### `revert` +: Undoes all unsaved changes to the file. -`swap_line_down` -: Swaps the current line with the line below. +### `right_delete` +: Deletes the character right after the caret. -`swap_line_up` -: Swaps the current line with the line above. +### `run_macro_file` +: Runs a *.sublime-macro* file. -`toggle_comment` -: Comments or uncomments the active lines, if available. + - **file** (String): Relative path to the macro file. - - **block** (Bool): Whether to insert a block comment. +### `run_macro` +: Runs the macro stored in the macro buffer. -`join_lines` -: Joins the current line with the next one. +### `save_all` +: Saves all open files. -`duplicate_line` -: Duplicates the current line. +### `save_macro` +: Prompts for a file path to save the macro in the macro buffer to. -`auto_complete` -: Opens the auto complete list. +### `save_project_as` +: Prompts for a new file name and saves the current project. -`replace_completion_with_auto_complete` -: XXX +### `save` +: Saves the active file. -`show_scope_name` -: Shows the name for the caret's scope in the status bar. + - **encoding** (String): The file encoding to save as. +### `scroll_lines` +: Scrolls lines in the view. -`exec` -: Runs an external process asynchronously. On Windows, GUIs are supressed. + **amount** \[Float\]\: Positive values scroll lines down and negative values + scroll lines up. - `exec` is the default command used by build systems, thus it provides - similar functionality. However, a few options in build systems are taken - care of by Sublime Text internally so they list below only contains - parameters accepted by this command. +### `select_all_bookmarks` +: Selects all bookmarked regions. - - **cmd** [(String)] - - **shell_cmd** (String): Shell command to use. If given overrides - `cmd` and ignores `shell`. - - **file_regex** (String) - - **line_regex** (String) - - **working_dir** (String) - - **encoding** (String) - - **env** [{String: String}] - - **quiet** (Bool): If `True` no runtime information is printed if the - command fails or has a non-zero exit code. - - **kill** (Bool): If `True` will simply terminate the current build - process. This is invoked via *Build: Cancel* command from the - [Command Palette][]. - - **update_phantoms_only** (Bool) - - **hide_phantoms_only** (Bool) - - **word_wrap** (Bool): Whether to word-wrap the output in the build panel - - **syntax** (String): Syntax file used to colour output. - - **path** (String) - - **shell** (Bool) +### `select_all` +: Select the view's content. - ::: seealso - [`exec` Target options](https://www.sublimetext.com/docs/3/build_systems.html#exec_options) - : Detailed documentation on all parameters of the `exec` command. - ::: +### `select_bookmark` +: Selects a bookmarked region in the current file. -`transpose` -: Makes selections or characters swap places. + - **index** (Int) - With selection: The contents of the selected regions are circulated. - Without selection: Swaps adjacent characters and moves the caret forward by - 1. +### `select_by_index` +: Focuses a certain tab in the current group. -`sort_lines` -: Sorts lines. + - **index** (Int): The tab index to focus. - - **case_sensitive** (Bool): Whether the sort should be case sensitive. +### `select_lines` +: Adds a line to the current selection. -`sort_selection` -: Sorts lines in selection. + - **forward** (Bool): Whether to add the next or previous line. Defaults to + `true`. - - **case_sensitive** (Bool): Whether the sort should be case sensitive. +### `select_to_mark` +: Selects the text between the current position of each one of the current + carets and the marked position. Each caret is matched with each mark + in order of occurrence, and is moved to the beginning of its selection. -`permute_lines` -: XXX + If any number of selections overlap, they are joined and, of all the + carets corresponding to each one of the joined selections, only the one + occurring first in the file is preserved. - - **operation** (Enum): *reverse*, *unique*, *shuffle* ...? + If the number of current carets is less or equal to the number of marks, + the remaining marks in order are ignored. Conversely, if currently there + are more carets than marks, the first relevant selections are produced. + Of all extra marks, those contained in the selections are removed, and + the rest of them are left where they are, without triggering a selection + from their position. -`permute_selection` -: XXX +### `set_build_system` +: Changes the current build system. - - **operation** (Enum): *reverse*, *unique*, *shuffle* ...? + - **file** (String): Path to the build system. If empty, Sublime Text tries + to automatically find an appropriate build systems from specified + selectors. + - **index** (Int): Used in the **Tools | Build System** menu but otherwise + probably not useful. -`set_layout` +### `set_layout` : Changes the group layout of the current window. This command uses the same pattern as [`Window.set_layout`][], see there for a list and explanation of parameters. -`focus_group` -: Gives focus to the top-most file in the specified group. +### `set_line_ending` +: Changes the line endings of the current file. - - **group** (Int): The group index to focus. This is determined by the order - of `cells` items from the current layout (see [`Window.set_layout`][]). + - **type** (Enum): *windows*, *unix*, *cr* -`move_to_group` -: Moves the current file to the specified group. +### `set_mark` +: Marks the position of each caret in the current file. If any marks have + already been set in that file, they are removed. - - **group** (Int): The group index to focus. See #### focus_group command. +### `set_setting` +: Set the value of a setting. This value is view-specific. -`select_by_index` -: Focuses a certain tab in the current group. + - **setting** (String): The name of the setting to changed. + - **value** (\*): The value to set to. - - **index** (Int): The tab index to focus. +### `show_about_window` +: I think you know what this does. -`next_bookmark` -: Select the next bookmarked region. +### `show_at_center` +: Scrolls the view to show the selected line in the middle of the view and + adjusts the horizontal scrolling if necessary. -`prev_bookmark` -: Select the previous bookmarked region. +### `show_overlay` +: Shows the requested overlay. Use the #### hide_overlay command to hide it. -`toggle_bookmark` -: Sets or unsets a bookmark for the active region(s). (Bookmarks can be - accessed via the regions API using `"bookmarks"` as the key.) + - **overlay** (Enum): + The type of overlay to show. Possible values: -`select_bookmark` -: Selects a bookmarked region in the current file. + - *goto*: Show the [Goto Anything][] overlay. + - *command_palette*: Show the [Command Palette][]. - - **index** (Int) + - **show_files** (Bool): If using the goto overlay, start by displaying + files rather than an empty widget. + - **text** (String): The initial contents to put in the overlay. -`clear_bookmarks` -: Removes all bookmarks. -`select_all_bookmarks` -: Selects all bookmarked regions. +### `show_panel` +: Shows a panel. -`wrap_lines` -: Wraps lines. By default, it wraps lines at the first ruler's column. + - **panel** (Enum): Values: *incremental_find*, *find*, *replace*, + *find_in_files*, *console* or *output.\*. + - **reverse** (Bool): Whether to search backwards in the buffer. + - **toggle** (Bool): Whether to hide the panel if it's already visible. - - **width** (Int): Specifies the column at which lines should be wrapped. +### `show_scope_name` +: Shows the name for the caret's scope in the status bar. -`upper_case` -: Makes the selection upper case. -`lower_case` -: Makes the selection lower case. +### `single_selection` +: Collapses multiple selections into a single selection. -`title_case` -: Capitalizes the selection's first character and turns the rest into lower - case. +### `slurp_find_string` +: Copies the current selection or word into the "find" field of the find + panel. -`swap_case` -: Swaps the case of each character in the selection. +### `slurp_replace_string` +: Copies the current selection or word into the "replace" field of the find + and replace panel. -`set_mark` -: Marks the position of each caret in the current file. If any marks have - already been set in that file, they are removed. +### `soft_redo` +: Redoes each action stepping through granular edits. -`select_to_mark` -: Selects the text between the current position of each one of the current - carets and the marked position. Each caret is matched with each mark - in order of occurrence, and is moved to the beginning of its selection. +### `soft_undo` +: Undoes each action stepping through granular edits. - If any number of selections overlap, they are joined and, of all the - carets corresponding to each one of the joined selections, only the one - occurring first in the file is preserved. +### `sort_lines` +: Sorts lines. - If the number of current carets is less or equal to the number of marks, - the remaining marks in order are ignored. Conversely, if currently there - are more carets than marks, the first relevant selections are produced. - Of all extra marks, those contained in the selections are removed, and - the rest of them are left where they are, without triggering a selection - from their position. + - **case_sensitive** (Bool): Whether the sort should be case sensitive. -`delete_to_mark` -: Deletes the text that `select_to_mark` would select. +### `sort_selection` +: Sorts lines in selection. -`swap_with_mark` -: Marks all the current carets' positions, removes those carets, and sets - new carets at the previously marked positions, if any. + - **case_sensitive** (Bool): Whether the sort should be case sensitive. -`clear_bookmarks` -: If no **name** argument, or the **name** "bookmarks" is specified, it - removes all bookmarks set in the current file, but not the marks. If - the **name** "mark" is specified as an argument, it removes all marks set - in the current file, but not the bookmarks. +### `split_selection_into_lines` +: Splits the selection into multiple selections, one on each line. - - **name** (String): e.g. `"mark"`, `"bookmarks"`. +### `swap_case` +: Swaps the case of each character in the selection. -`yank` -: XXX +### `swap_line_down` +: Swaps the current line with the line below. -`show_at_center` -: Scrolls the view to show the selected line in the middle of the view and - adjusts the horizontal scrolling if necessary. +### `swap_line_up` +: Swaps the current line with the line above. -`increase_font_size` -: Increases the font size. +### `swap_with_mark` +: Marks all the current carets' positions, removes those carets, and sets + new carets at the previously marked positions, if any. -`decrease_font_size` -: Decreases the font size. +### `switch_file` +: Switches between two files with the same name and different extensions. -`reset_font_size` -: Resets the font size to the default + - **extensions** (String): Extensions (without leading dot) for which + switching will be enabled. - *Note*: This essentially removes the entry from your User settings, there - might be other places where this has been "changed". +### `title_case` +: Capitalizes the selection's first character and turns the rest into lower + case. -`fold` -: Folds the current selection and displays ``…`` instead. Unfold arrows are - added to the lines where a region has been folded. +### `toggle_bookmark` +: Sets or unsets a bookmark for the active region(s). (Bookmarks can be + accessed via the regions API using `"bookmarks"` as the key.) -`unfold` -: Unfolds all folded regions in the selection or the current line if there is - none. +### `toggle_comment` +: Comments or uncomments the active lines, if available. -`fold_by_level` -: Scans the whole file and folds everything with an indentation level of - `level` or higher. This does not unfold already folded regions if you first - fold by level 2 and then by 3, for example. Sections with cursors are not - folded. + - **block** (Bool): Whether to insert a block comment. - - **level** (Int): The level of indentation that should be folded. `0` is - equivalent to running #### unfold_all. +### `toggle_distraction_free` +: Toggles distraction free mode on or off. -`fold_tag_attributes` - Folds all tag attributes in XML files, only leaving the tag's name and the - closing bracket visible. +### `toggle_full_screen` +: Toggles full screen mode on or off. -`unfold_all` -: Unfolds all folded regions. +### `toggle_minimap` +: Shows or hides the minimap. -`context_menu` -: Shows the context menu. +### `toggle_overwrite` +: Toggles overwriting on or off. -`open_recent_file` -: Opens a recently closed file. +### `toggle_record_macro` +: Starts or stops the macro recorder. - - **index** (Int) +### `toggle_save_all_on_build` +: Toggles whether all open files should be saved before starting the build. -`open_recent_folder` -: Opens a recently closed folder. - - **index** (Int) +### `toggle_setting` +: Toggles the value of a boolean setting. This value is view-specific. -`open_recent_project` -: Opens a recently closed project. + - **setting** (String): The name of the setting to be toggled. - - **index** (Int) +### `toggle_show_open_files` +: Shows ot hides the open files in the sidebar. -`clear_recent_files` -: Deletes records of recently accessed files and folders. +### `toggle_side_bar` +: Shows or hides the sidebar. -`clear_recent_projects` -: Deletes records of recently accessed projects. +### `toggle_status_bar` +: Shows or hides the status bar. -`reopen` -: Reopens the current file. +### `toggle_tabs` +: Shows or hides the tab bar. - - **encoding** (String): The file encoding the file should be reopened with. +### `transpose` +: Makes selections or characters swap places. -`clone_file` -: Clones the current view into the same tab group, both sharing the same - buffer. That means you can drag one tab to another group and every update to - one view will be visible in the other one too. + With selection: The contents of the selected regions are circulated. + Without selection: Swaps adjacent characters and moves the caret forward by + 1. -`revert` -: Undoes all unsaved changes to the file. +### `undo` +: Undoes the latest action. -`expand_tabs` +### `unexpand_tabs` : XXX - **set_translate_tabs** (Bool) -`unexpand_tabs` -: XXX +### `unfold_all` +: Unfolds all folded regions. - - **set_translate_tabs** (Bool) +### `unfold` +: Unfolds all folded regions in the selection or the current line if there is + none. -`new_plugin` -: Creates a new buffer and inserts a plugin template (a text command). +### `unindent` +: Unindents selection. -`new_snippet` -: Creates a new buffer and inserts a snippet template. +### `upper_case` +: Makes the selection upper case. -`open_url` -: Opens the specified url with the default browser. +### `wrap_lines` +: Wraps lines. By default, it wraps lines at the first ruler's column. - - **url** (String) + - **width** (Int): Specifies the column at which lines should be wrapped. -`show_about_window` -: I think you know what this does. +### `yank` +: XXX - ## Discovering Commands There are several ways to discover a command's name in order to use it as a key