18

如何在 sublime text 2 中选择匹配的 html 标签中的所有内容。我尝试过“将选择扩展到括号​​”,但它不起作用。例如。

<div class="container">
  <p>
    Text goes here...
  </p>
  <p>
    Text goes here...
  </p>
  <p>
    Text goes here...
  </p>
  more content...
</div>

我想选择 div.container 的所有内容

不过我发现了一个窍门

我试过的只是做“冷折叠”然后选择所有的。但我希望有一条捷径或为它建造。

4

3 回答 3

30
于 2013-03-17T20:22:26.897 回答
5

我在 Mac 上使用带有 Emmet 的 Sublime Text 2 并且 cmd + d 正在为我选择匹配的单词,而不是 HTML 标签之间的文本。

<h3>Only Want to Select This Text</h3>我能够使用 cmd + shift + a实现我正在寻找的内容(在开始和结束标签之间选择文本,例如)

于 2015-07-08T20:23:37.520 回答
4

这对我有用

Preferences-> Key Binding-User

然后将其添加到 [ ]

{ "keys": ["ctrl+shift+a"], "command": "expand_selection", "args": {"to": "tag"} },

于 2016-05-18T03:11:26.120 回答