用于匹配大括号的 IntelliJ IDEA 快捷键映射
在 IntelliJ IDEA 中导航到匹配大括号的键盘映射是什么?
public void blah() {|
...
}
如果 |
是我的光标,我想使用此键盘映射跳转到右大括号。
What is the keymap for navigating to the matching brace in IntelliJ IDEA?
public void blah() {|
...
}
If |
is my cursor, I would like to jump to the closing brace with this keymap.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(6)
我只用 IntelliJ 9 验证了这一点,但是:
在 Windows 上:
Ctrl+} 将移至结束位置
括号。
Ctrl+{ 将移动到左括号。
在 Mac 上:
I've only verified this with IntelliJ 9 but:
On Windows:
Ctrl+} will move to the close
bracket.
Ctrl+{ will move to the open bracket.
On Mac:
作为 Ctrl+} 和 Ctrl+{ 的替代方案,您可以默认使用 Ctrl+Alt+Shift+9 和 Ctrl+Alt+Shift+8 分别。我什至还没有试图记住这一点。 ;)
也在设置-> (IDE 设置 ->) 键盘映射 ->编辑器操作中有一个名为“将插入符移动到匹配的大括号”的条目,它没有默认的键映射。我将其映射到 Ctrl+< 因为组合键未映射,并且德语键盘上的按键彼此靠近。
这适用于 IDEA 12。
As an alternative to Ctrl+} and Ctrl+{ you can by default use Ctrl+Alt+Shift+9 and Ctrl+Alt+Shift+8 respectively. I haven't even tried to remember that yet. ;)
Also in Settings -> (IDE Settings ->) Keymap -> Editor Actions there's an entry called "Move Caret to Matched Brace" that doesn't have a default key mapping. I mapped it to Ctrl+< because the key combination was unmapped and the keys are close to each other on a german keyboard.
This applies to IDEA 12.
它在我的 Mac 上使用 IDEA v15 并保留 MacOSX 10.5+ 的默认键盘映射 ^M (control + M)
如果您不确定,请转到首选项并搜索“将插入符移动到匹配大括号”。这是命令的名称,您可以设置自己的快捷方式!
Its ^M (control + M) on my Mac using IDEA v15 and keeping the default keymap for MacOSX 10.5+
If you are not sure go to prefs and search for "Move Caret to Matching Brace". That's the name of the command and you can set your own shortcut!
在某些键盘(包括瑞典语键盘)上,使用 Ctrl-} 或 Ctrl-{ 并不实用。在这种情况下,我发现的最佳方法是双击视图中的括号,这会突出显示括号之间的所有内容,然后使用左箭头或右箭头移动到突出显示区域的适当末端。
On some keyboards, including Swedish ones, it's not practical to use Ctrl-} or Ctrl-{. The best approach I've found under those circumstances is to double-click the bracket in view, which highlights everything between the brackets, then use left-arrow or right-arrow to move to the appropriate end of the highlighted region.
Ctrl+} 和 Ctrl+{ 仅将光标移动到包含 ( 及其对应项的闭括号)您调用快捷方式的地方。
Ctrl+Shift+} 和 Ctrl+Shift+{< /kbd> 将光标移动到与第一个提到的快捷方式相同的大括号,并突出显示起点和结果大括号之间的所有区域。
Ctrl+Shift+M 将光标移动到相反或最近的任何类型的大括号或方括号 ( )、{ }、 >、[]。
最后一项可以在设置中更改。
Ctrl+} and Ctrl+{ only moves the cursor to the closes corresponding brace that embraces ( with its counterpart) the place where you called the shortcut.
Ctrl+Shift+} and Ctrl+Shift+{ moves the cursor to the same brace as the first mentioned shortcut and highlights all the area between start point and the result brace.
Ctrl+Shift+M moves the cursor to the opposite or nearest embracing brace or bracket of any sort ( ), { }, < >, [ ].
The last one can be changed in the settings.
@dhable 也是对的,但你也可以做这个鼠标
@dhable is also right but you can also do this mouse