windows IntelliJ IDEA“重构”的键盘快捷键
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/1031398/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Keyboard shortcut for 'refactor' for IntelliJ IDEA
提问by ripper234
In Visual Studio (using IDEA key mapping), Ctrl+ Shift+ Rbrings up the 'Refactor' menu.
在Visual Studio(使用IDEA键映射),Ctrl+ Shift+R带来了“重构”菜单。
How do I do the same in IntelliJ?
我如何在 IntelliJ 中做同样的事情?
On Windows.
在 Windows 上。
回答by Kornél Regius
ctrl+ alt+ shift+ t= refactor this
ctrl+ alt+ shift+ t= 重构这个
in intelliJ IDEA version 11.0.2
在 IntelliJ IDEA 11.0.2 版中
回答by Tarik
If you press on CTRL+ Shift+ Aand type in the action you want to perform, it also shows the shortcuts keys. This way you can learn shortcuts much easier.
如果您按CTRL+ Shift+A并输入要执行的操作,它还会显示快捷键。通过这种方式,您可以更轻松地学习快捷方式。
回答by iftheshoefritz
The range of refactoring options in IntelliJ is fantastic, right click in your editor and hit Rto see the entire menu. You'll soon want to just use the keyboard shortcuts though; some of my favourites are:
IntelliJ 中的重构选项范围很棒,在您的编辑器中右键单击并点击R以查看整个菜单。不过,您很快就会只想使用键盘快捷键;我最喜欢的是:
- Shift+ F6: refactor a method or variable name
- Ctrl+ Shift+ F6: refactor a variable / field type
- Ctrl+ Alt+ M: extract a method
- Ctrl+ Alt+ V: introduce a variable
- Shift+ F6: 重构一个方法或变量名
- Ctrl+ Shift+ F6: 重构一个变量/字段类型
- Ctrl+ Alt+ M: 提取方法
- Ctrl+ Alt+ V: 引入一个变量
回答by butterchicken
You'll find the main refactoring actions are bound to keys, rather than the entire menu being associated with a keyboard shortcut. The cheatsheet shipped with IntelliJ (Help > Default Keymap Reference) was invaluable when I was trying to get my head around everything that was possible. (Available online too!).
您会发现主要的重构操作与键绑定,而不是与键盘快捷键相关联的整个菜单。当我试图了解所有可能的情况时,IntelliJ 附带的备忘单(帮助 > 默认键盘映射参考)非常宝贵。(也可以在线使用!)。
I think you can probably get the refactoring menu in Windows by hitting the Context key(next to the Right Ctrl) and then Rwhilst your cursor is in the editor window. Not sure if a dedicated binding exists - I'm pretty sure you can't set one.
我认为您可以通过在光标位于编辑器窗口中时按上下文键(在右 Ctrl 旁边)然后按R来获得 Windows 中的重构菜单。不确定是否存在专用绑定 - 我很确定你不能设置一个。
回答by joeslice
Alt+ Rwill pull down the menu. For instance, Alt+ R, Lwill allow you to pull up a method.
Alt+R将下拉菜单。例如,Alt+ R,L将让你拉起来的方法。
回答by Srneczek
Hm, just press ctrl+r - it does refractor pretty much anything? I switched keyboard shortcuts layout to Netbeans and tweaked it a little bit but I don't think it changed anything. True challange is "How to press DO REFRACTOR button in the usages window when you want to refractor some method used on several places WITHOUT using mouse".
嗯,只需按 ctrl+r - 它几乎可以折射任何东西吗?我将键盘快捷键布局切换到 Netbeans 并稍微调整了一下,但我认为它没有改变任何东西。真正的挑战是“当您想在不使用鼠标的情况下折射在多个地方使用的某些方法时,如何在使用窗口中按下 DO REFRACTOR 按钮”。