Provides a select_all_by_current_scope
command, which (as the name suggests) select everything matching the current scope (that is the scope of your first cursor).
The command accepts an optional argument scope_must_match
containing a regex string, which filters the long scope string to get a single scope name.
This plugin doesn't have any default keybindings. You have to assign them yourself.
Selects everything matching current scope:
[
{
"keys": ["ctrl+alt+shift+a"],
"command": "select_all_by_current_scope"
}
]
Selects everything matching the first piece of current scope, which contains the word embedded
:
[
{
"keys": ["ctrl+alt+shift+a"],
"command": "select_all_by_current_scope",
"args": { "scope_must_match": "embedded" }
}
]
- Download & Install
Sublime Text 3
(https://www.sublimetext.com/3) - Go to the menu
Tools -> Install Package Control
, then, wait few seconds until the installation finishes up - Now,
Go to the menu
Preferences -> Package Control
- Type
Add Channel
on the opened quick panel and press Enter - Then,
input the following address and press Enter
https://raw.githubusercontent.com/evandrocoan/StudioChannel/master/channel.json
- Go to the menu
Tools -> Command Palette... (Ctrl+Shift+P)
- Type
Preferences: Package Control Settings โ User
on the opened quick panel and press Enter - Then,
find the following setting on your
Package Control.sublime-settings
file:"channels": [ "https://packagecontrol.io/channel_v3.json", "https://raw.githubusercontent.com/evandrocoan/StudioChannel/master/channel.json", ],
- And,
change it to the following, i.e.,
put the
https://raw.githubusercontent...
line as first:"channels": [ "https://raw.githubusercontent.com/evandrocoan/StudioChannel/master/channel.json", "https://packagecontrol.io/channel_v3.json", ],
- The
https://raw.githubusercontent...
line must to be added before thehttps://packagecontrol.io...
one, otherwise, you will not install this forked version of the package, but the original available on the Package Control default channelhttps://packagecontrol.io...
- The
- Now,
go to the menu
Preferences -> Package Control
- Type
Install Package
on the opened quick panel and press Enter - Then,
search for
SelectAll
and press Enter
See also:
- ITE - Integrated Toolset Environment
- Package control docs for details.
Say you have a knitr/Sweave file with embedded R code. You might want to select all the R code. For that, I have the following keybinding:
[
{
"keys": ["ctrl+alt+shift+a"],
"command": "select_all_by_current_scope",
"args": { "scope_must_match": "embedded" }
"context": [
{ "key": "selector", "operator": "equal", "operand": "source.r.embedded.knitr" }
]
}
]
How about all the javascript code from an HTML file? Bold text from a Markdown file? That's matched by default:
[
{
"keys": ["ctrl+alt+shift+a"],
"command": "select_all_by_current_scope"
}
]