在 Netbeans 中转至下一行,无需使用向下箭头键或鼠标
想象一下,例如,您正在类中编写一个方法:
public getFoo() {
return $this->foo;
}
因此,在结束输入返回值后,光标会出现在分号后面,并且为了在结束大括号之后继续编写,您必须将手移开使用向下箭头键,或更糟糕的是使用鼠标。
有没有更有效的方法来做到这一点,而无需将右手从其自然位置移开?
这似乎是一个愚蠢的问题,但我必须一直这样做,所以我想知道是否有更好的方法来做到这一点。
Imagine for example that you are writing a method inside a class:
public getFoo() {
return $this->foo;
}
So after you end typing the return value, you have the cursor after the semicolon, and in order to continue writing after the end curly brace, you have to either move the hand away to use the down arrow key, or worse, to use the mouse.
Is there a more efficient way of doing this without having to move the right hand from its natural position?
It may seem a silly question, but I have to do this all the time so I was wondering if there is a better way to do it.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可以在顶部菜单 > 找到每个可用快捷方式的列表,并根据您的需要自定义它们。工具>选项>键映射。
查找“插入点向下”。呃...实际上我会保留默认值并使用分号后面的向下箭头只是为了在大括号后面移动(分号靠近我键盘上的箭头)。
但我可以建议在其他情况下使用以下快捷键:Ctrl + G(转到行...)、Ctrl + 7(如果您想转到其他方法,请使用导航器 + 选择方法);如果您想搜索,请使用 Ctrl + I为了某事。
可以肯定的是,您知道 Netbeans 可以为您生成 getter 和 setter 方法吗? Alt+Insert,从弹出菜单中选择:http://netbeans.dzone。 com/news/generate-constructor-getters-a。
you can find the list of every available shortcut and also customize them for your needs at the top menu > Tools > Options > KeyMap.
Look for "Insertion Point Down". Erm... Actually I would keep the defaults and use the down arrow after the semicolon just to move after the curly braces (semicolon is near arrows at my keyboard).
But I can suggest the following shortcuts for other situations: Ctrl + G (Go to line...), Ctrl + 7 (Navigator + Select Method if you want to go to some other method) and Ctrl + I if you want to search for something.
Just to be sure, do you know that Netbeans can generate your getter and setter methods for you? Alt+Insert, select from pop-up menu: http://netbeans.dzone.com/news/generate-constructor-getters-a.