简体   繁体   English

Eclipse使用键盘快捷键跳转到范围/方法的末尾

[英]Eclipse jump to end of scope/method with keyboard shortcut

Is is possible to jump to the end of a scope such as a method, loop, if statement, switch statement...etc with a keyboard shortcut? 是否可以使用键盘快捷键跳转到范围的末尾,例如方法,循环,if语句,switch语句等?

I know this is possible with control shift p , but it only goes to the beginning of the closing curly brace, and not over it. 我知道这可以通过控制 移位 p来实现 ,但它只会到达闭合花括号的开头,而不是它。 For example: 例如:

This is my code. 这是我的代码。

if (x < 10) {
    System.out.println("X is less than ten.");| //my cursor is '|'
}

When I press control+shift+P my cursor jumps here: 当我按下control+shift+P我的光标跳到这里:

if (x < 10) {
    System.out.println("X is less than ten.");
|}   //my cursor is '|'

But I want it to go here. 但我希望它能够到这里来。

if (x < 10) {
    System.out.println("X is less than ten.");
}|   //my cursor is '|'

Is this possible? 这可能吗?

Your keys seemed to be mapped differently than my keys, but look in the Preferences (General --> Keys) to see exactly what commands are available for your version of Eclipse and OS. 您的密钥似乎与我的密钥的映射方式不同,但请查看首选项(常规 - >密钥)以确切了解您的Eclipse和OS版本可用的命令。 I think the closest command to what you're looking for is Run to Line (where you have to point to the line with the closing curly bracket). 我认为最接近你正在寻找的命令是Run to Line(你必须指向具有右括号的行)。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM