NetBeans 大括号自动关闭
上次我经常以这种形式初始化数组:
int[] test = new int[]{1,2,3};
当我键入“[”时,NetBeans 立即放置右大括号。
问题是 - 哪个宏可以用大括号完成相同的工作?
In the last time I often initialize arrays in this form :
int[] test = new int[]{1,2,3};
When I type '[', NetBeans immediately put the closing brace.
The question is - which is the macro to do the same job with curly braces ?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
从菜单中选择工具> 选项,在工具栏中选择编辑器,进入代码完成选项卡。
您将看到默认情况下已自动选中自动插入右括号。
不久前,有一个人问了一个类比问题。没有任何有用的答案。我想这意味着我们应该在未来的版本中寻找这一点。
Select from menu Tools > Options, select Editor in toolbar, go for Code Completion tab.
You will see that Insert Closing Brackets Automatically is already automatically checked by default.
There was a guy, who asked an analogical question a while ago. There was no helpful answer. I guess that means that we should look for that in future versions.
我也在寻找解决方案,对于 NetBeans 8.5 检查答案,https://stackoverflow.com/a/38338967/7162006,在同一窗口中是选项:Completion Selectors For Java 添加:{,通过在编辑器中按 Enter 键自动完成。 (经典)
I looked for solution too, for NetBeans 8.5 check answer, https://stackoverflow.com/a/38338967/7162006, in same window is option: Completition Selectors For Java add: {, autocomplete by hiting enter in editor. (classically)
这个宏对我有用:
快捷键:Shift + {
宏代码:
"}"插入符号向后
This macro work to me:
Shortcut: Shift + {
Macro code:
"}" caret-backward