什么是最有用的Intellij IDEA键盘快捷键? [关闭]

本文翻译自:What are the most useful Intellij IDEA keyboard shortcuts? [closed]

I did a bit of googling hoping to find a post on IDEA shortcuts similar to Jeff's post on Visual Studio shortcuts ( Visual Studio .NET 2003 and 2005 Keyboard Shortcuts ), but didn't really spot anything that helped. 我做了一些谷歌搜索希望找到一个关于IDEA快捷方式的帖子,类似于Jeff在Visual Studio快捷方式上的帖子( Visual Studio .NET 2003和2005键盘快捷键 ),但没有发现任何有用的信息。 Hopefully the answers to this question will fill the void. 希望这个问题的答案将填补空白。


#1楼

参考:https://stackoom.com/question/1ewD/什么是最有用的Intellij-IDEA键盘快捷键-关闭


#2楼

Here are the Intellij IDEA keyboard shortcuts I find most useful (listed in roughly the order of usage for me): 以下是我认为最有用的Intellij IDEA键盘快捷键(大致按使用顺序列出):

The shortcut I use the most is Ctrl + B (Go to declaration), to see what a method does, where a variable is declared etc. This is almost always followed by Ctrl + Alt + Left to get back to where I was ( Ctrl + Alt + Right works to “go forward” again). 我最常用的快捷方式是Ctrl + B (转到声明),查看方法的作用,声明变量的位置等等。这几乎总是按Ctrl + Alt + Left然后返回到我所在的位置( Ctrl + Alt + Right可以“再次前进”。

A related navigation shortcut is Ctrl + Alt + B , (Go to implementation). 相关的导航快捷键是Ctrl + Alt + B ,(转到实现)。 Press it when the caret is at the method name of an interface, and you get a pop-up list of all the places where this method is implemented, and you can select which one you want to go to (if there is only one implementation, you go straight there). 当插入符号位于接口的方法名称时按下它,您将获得实现此方法的所有位置的弹出列表,并且您可以选择要转到的位置(如果只有一个实现) ,你直接去那里)。 The same goes for overridden methods. 覆盖方法也是如此。

The opposite of this is Ctrl + U (Go to super-method/super-class). 与此相反的是Ctrl + U (转到super-method / super-class)。 If the caret is at the implementation of a method in an interface (indicated by the little green interface-symbol in the left gutter), this shortcut takes you to the interface itself. 如果插入符号是在接口中实现方法(由左侧装订线中的绿色小接口符号表示),则此快捷方式会将您带到界面本身。

When I want to see all the places where a method or variable is used (which I want to do a lot), I use Ctrl + Alt + F7 (Show usages). 当我想要查看使用方法或变量的所有地方(我想要做很多事情)时,我使用Ctrl + Alt + F7 (显示用法)。 This gives you a pop-up list of all the usages, and you can easily navigate to each one. 这将为您提供所有用法的弹出列表,您可以轻松导航到每个用法。 I prefer this over Alt + F7 (Find usages), which gives you the same information, but in a separate pane below. 我更喜欢这个而不是Alt + F7 (查找用法),它为您提供相同的信息,但在下面的单独窗格中。

To find classes, I use Ctrl + N (Go to class), which lets you search using only the capital letters in the class name (“camel humps”), and * as wildcard. 要查找类,我使用Ctrl + N (转到类),它允许您仅使用类名中的大写字母(“camel humps”)和*作为通配符进行搜索。

Yet another shortcut I use, both when reading and writing code, is Ctrl + P (Parameter info) at the arguments of methods and constructors, to see the types and names of the parameters. 在读取和编写代码时,我使用的另一个快捷方式是在方法和构造函数的参数处使用Ctrl + P (参数信息),以查看参数的类型和名称。

When it comes to writing code, I use Ctrl + space (Basic code completion) a lot to auto-complete method names, variable names etc (or simply to see which methods are available for a certain object, by trying to auto-complete directly at the dot following the name of the object). 在编写代码时,我使用Ctrl + space (基本代码完成)来自动完成方法名称,变量名称等(或者只是通过尝试直接自动完成来查看某个对象可用的方法)在对象名称后面的点处)。

For searching in the current file I use Ctrl - F (Find - probably the least surprising shortcut in this list), F3 / Shift + F3 (Find next/previous) to repeat the search, and Ctrl + Shift + F (Find in path) to search in the whole project. 为了在当前文件中搜索,我使用Ctrl - F (查找 - 可能是此列表中最不令人惊讶的快捷方式), F3 / Shift + F3 (查找下一个/上一个)重复搜索,然后按Ctrl + Shift + F (在路径中查找) )搜索整个项目。

Ctrl + W (Select successively increasing code blocks) is handy when selecting chunks of code. 选择代码块时, Ctrl + W (选择连续增加的代码块)非常方便。 Repeatedly pressing it selects more and more of the code. 反复按下它会选择越来越多的代码。 Useful when searching, indenting, commenting out code etc. 在搜索,缩进,注释代码等时很有用。

If there are errors in the file, F2 / Shift + F2 (Next/previous highlighted error) will jump to them. 如果文件中有错误, F2 / Shift + F2 (下一个/上一个突出显示的错误)将跳转到它们。

I use the sequence Alt + C , N (Show Changes View) to see which files in the project I have modified compared to the subversion repository. 我使用序列Alt + CN (显示更改视图)来查看我修改的项目中哪些文件与subversion存储库相比较。 To diff the current file against the version in the subversion repository, I use the sequence Alt + C , S , Y (Compare with the Same Repository Version). 为了将当前文件与subversion存储库中的版本区分开来,我使用序列Alt + CSY (与相同的存储库版本比较)。 In the diff view, I use F7 / Shift + F7 to navigate between the changes. 在差异视图中,我使用F7 / Shift + F7在更改之间导航。

When not in the diff view, I use Ctrl + Shift + Alt + Up / Ctrl + Shift + Alt + Down to jump to the parts of the file that have been changed compared to the checked-out version. 当不在差异视图中时,我使用Ctrl + Shift + Alt + 向上 / Ctrl + Shift + Alt + 向下跳转到与已签出版本相比已更改的文件部分。 At each modification point, you see the corresponding part in the checked-out version in a pop-up window. 在每个修改点,您都会在弹出窗口中看到签出版本中的相应部分。

Finally, I run JUnit tests using Ctrl + Shift + F10 . 最后,我使用Ctrl + Shift + F10运行JUnit测试。

Edit: One really useful shortcut that I've only started using in the last few months is Ctrl + E . 编辑:我在过去几个月才开始使用的一个非常有用的快捷方式是Ctrl + E. It brings up a pop-up with the 15 most recently used files, and you just arrow down to the one you want and hit enter to navigate to it. 它会显示最近使用的15个文件的弹出窗口,您只需向下箭头键到您想要的文件,然后按Enter键导航到它。


#3楼

F7 F8 F9用于调试


#4楼

Any combination of Ctrl + Alt + Shift and N . Ctrl + Alt + ShiftN的任意组合。

Ctrl + Shift + T in idea8 is also excellent. idea8中的Ctrl + Shift + T也非常出色。

There is a complete keymap in the online help too. 在线帮助中也有完整的键盘映射。


#5楼

Some of the time savers: 有些节省时间:

  1. Alt + Enter : show intention actions (like Eclipse quick fix) Alt + Enter :显示意图操作(如Eclipse快速修复)
  2. Ctrl + Alt + V : introduce variable (never type the left hand side of an assignment again) Ctrl + Alt + V :引入变量(再也不要键入赋值的左侧)
  3. Ctrl + Shift + Space : smart completion ( even two levels down since IntelliJ 8 ) Ctrl + Shift + Space :智能完成( 自IntelliJ 8以来甚至下降两级
  4. Ctrl + W : select succesively increasing code blocks. Ctrl + W :选择连续增加的代码块。 Kind of obvious but a real time saver! 有点明显,但实时节省!

The Canoo blog contains some (+8) articles on some more advanced IntelliJ keyboard shortcuts. Canoo博客包含一些关于一些更高级IntelliJ键盘快捷键的文章(+8)

The Key Promoter and Shortcut keys list plugins are really helpful for (constantly) learning new IntelliJ keyboard shortcuts. 密钥启动器快捷键列表插件非常有助于 (不断)学习新的IntelliJ键盘快捷键。


#6楼

Help\\Productivity Guide 帮助\\生产力指南

It tells you what are the shortcuts you use/don't use and displays usage statistics. 它告诉您使用/不使用的快捷方式,并显示使用情况统计信息。 It will guide you to the unknown features. 它将引导您进入未知功能。

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值