0

Any keyboard shortcut in Sublime Text 2 to select the string in quotation marks:

<input type="text" value="i want to select these texts ..." />
alert("i want to select these texts ...");
4

2 回答 2

2

Under the Selection menu is an option Expand Selection to Scope, which should be what you're looking for, since strings enclosed in quotes are defined as a separate scope in most languages, including the default HTML that comes with ST2.

I tested several languages, including HTML, JavaScript, JSON, Ruby, Perl, and Python, and all except Python selected the quotes along with the text. If you want to change that behavior you'll have to dive into Packages/Python/Python.tmLanguage, figure out the regexes involved, and transfer them to the .tmLanguage file(s) of your language(s) of choice.

于 2013-03-30T17:43:40.770 回答
1

Try the BracketHighlighter plugin. Use the command palette command Select Bracket Content. I believe that is what you are looking for. If it is, you can create a keymap with the following command (got this from logging the command, but you can also see it by looking through the sublime-commands file)

"keys": ["<you choose keys>"],
"command": "bh_key",
"args": {"lines": true, "plugin": {"command": "bh_modules.bracketselect", "type": ["__all__"]}}
于 2013-03-30T18:20:27.357 回答