pycharm每日一贴中英文对照(机器翻译)

本文介绍了PyCharm中的一些常用快捷键和功能,包括快速选择元素、速度搜索、编辑器焦点移动、代码重构、扩展选择、高亮用法、本地历史、代码组织、代码完成、文件颜色区分、拼写检查、自定义字典、版本控制操作、交互式控制台、错误处理、外部文件编辑和导航等,旨在提高开发效率。
摘要由CSDN通过智能技术生成

1.To quickly select the currently edited element (class, file, method or field) in any view (Project view, Structure view or other), press Alt+F1.

要在任何视图(项目视图、结构视图或其他视图)中快速选择当前编辑的元素(类、文件、方法或字段),请按Alt+F1。

2.The speed search is available in all the tree views: just start typing and you'll quickly locate the necessary item.

速度搜索在所有的树视图中都是可用的:只要开始键入,您就可以快速找到所需的项。

3.The Esc key in any tool window moves the focus to the editor.
Shift+Esc moves the focus to the editor and also hides the current (or last active) tool window.
The F12 key moves the focus from the editor to the last focused tool window.

任何工具窗口中的Esc键都将焦点移动到编辑器。

Shift+Esc将焦点移动到编辑器,并隐藏当前(或最后一个活动)工具窗口。

F12键将焦点从编辑器移动到最后一个聚焦工具窗口。

4.Ctrl+W (extend selection) in the editor selects the word at the caret and then selects expanding areas of the source code. For example, it may select a method name, then the expression that calls this method, then the whole statement, then the containing block, etc. You can also select the word at the caret and the expanding areas of the source code by double-clicking the target areas in the editor.

在编辑器中Ctrl+W(扩展选择)选择插入符号处的单词,然后选择源代码的扩展区域。例如,它可以选择一个方法名,然后是调用这个方法的表达式,然后是整个语句,然后是包含它的块,等等。您还可以通过双击编辑器中的目标区域来选择插入符号处的单词和源代码的展开区域。

5.The Extract Variable refactoring helps you simplify complicated statements in your code. For example, in the code fragment below, you can select an expression in the code, and press Ctrl+Alt+V (Refactor | Extract | Variable).

Extract变量重构帮助您简化代码中的复杂语句。例如,在下面的代码片段中,您可以在代码中选择一个表达式,并按Ctrl+Alt+V(重构|提取|变量)。

6.Ctrl+D in the editor duplicates the selected block or the current line when no block is selected.

当没有选择任何块时,编辑器中的Ctrl+D会复制所选的块或当前行。

7.The Code | Move Statement Up/Down action is useful for reorganizing the code lines in your file, e.g., for bringing a variable declaration closer to the variable usage.
For example, select a code fragment and press Ctrl+Shift+向上箭头 or Ctrl+Shift+向下箭头.

When there is no selection, the line at the cursor will be moved.

代码|上/下移动语句对于重新组织文件中的代码行非常有用,例如,使变量声明更接近变量用法。

例如,选择一个代码片段,按Ctrl + Shift +向上箭头或Ctrl + Shift +向下箭头。

当没有选择时,光标处的行将被移动。

8.Ctrl+Shift+J shortcut joins two lines into one and removes unnecessary space to match your code style.

Ctrl+Shift+J快捷键将两行合并为一行,并删除不必要的空间以匹配代码样式。

9.If the cursor is between the parentheses of a method call, pressing Ctrl+P brings up a list of valid parameters.

如果光标位于方法调用的圆括号之间,按下Ctrl+P会出现一个有效参数列表。

10.Ctrl+Shift+Backspace (Navigate | Last Edit Location) brings you back to the last place where you made changes in the code.
Pressing Ctrl+Shift+Backspace a few times moves you deeper into your changes history.

Ctrl+Shift+Backspace(导航|的最后编辑位置)将您带回到您在代码中进行更改的最后一个位置。

按下Ctrl+Shift+Backspace几次会使您更深入地了解您的更改历史。

11.Use Ctrl+Shift+F7 (Edit | Find | Highlight Usages in File) to quickly highlight usages of some variable in the current file.
Use F3 and Shift+F3 keys to navigate through highlighted usages.
Press Esc to remove highlighting.

使用Ctrl+Shift+F7(编辑|查找文件中的|高亮用法)快速高亮当前文件中某个变量的用法。

使用F3和Shift+F3键来导航高亮显示的用法。

按Esc删除突出显示。

12.To see your local history of changes in a file, invoke Local History | Show History from the context menu. You can navigate through different file versions, see the differences and roll back to any previous version.
Use the same context menu item to see the history of changes on a directory. You will never lose any code with this feature!

要查看文件中的本地更改历史记录,请从上下文菜单中调用本地历史|显示历史记录。您可以浏览不同的文件版本,查看差异并回滚到任何以前的版本。

使用相同的上下文菜单项查看目录上的更改历史。您将永远不会丢失任何具有此功能的代码!

13.Ctrl+E (View | Recent Files) brings a popup list of the recently visited files.

  • 11
    点赞
  • 25
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值