【转】PyCharm 文件译文:Tip of the Day (快捷操作说明 1 )

转自 https://blog.csdn.net/qq_39720249/article/details/90442968

1、Ctrl+空格

(1)1 次点击:Ctrl+空格

1
The Code Completion feature lets you quickly complete different kinds of statements in the code. For example, start typing a class name and press Ctrl+空格 to complete it. When multiple choices are available, they are shown in the lookup list.******************************** 译文 **********************************代码完成特性允许您快速完成代码中的各种语句。例如,开始键入类名,然后按 ctrl+空格 键完成它。当有多个选项可用时,它们将显示在查找列表中。


(2)2 次点击:Ctrl+空格

1
A special variant of the Code Completion feature invoked by pressing Ctrl+空格 twice allows you to complete the name of any class no matter if it was imported in the current file or not. If the class is not imported yet, the import statement is generated automatically.******************************** 译文 **********************************通过按两次 ctrl+空格 键调用的代码完成功能的一个特殊变体允许您完成任何类的名称,无论它是否导入到当前文件中。如果尚未导入类,则会自动生成 import 语句。


(3)ctrl+空格后:

1
When using basic code completion (Ctrl+空格), type any characters that exist anywhere in an identifier. ******************************** 译文 **********************************使用基本代码完成(ctrl+空格)时,键入标识符中任何位置存在的任何字符。


(4)图像文件名

1
Use Basic Completion (Ctrl+空格) within HTML, CSS and other files, for completing image file names. ******************************** 译文 **********************************在 HTML、CSS 和其他文件中使用基本完成(ctrl+空格)来完成图像文件名。


(5)

1
A special variant of the Code Completion feature invoked by pressing Ctrl+空格 twice allows you to complete XML tag names from namespaces not declared in the current file. If the namespace is not declared yet the declaration is generated automatically. ******************************** 译文 **********************************特殊代码的变种的特征被完成用 Ctrl+空格 压两次让你完成从 XML 标记名称不符合当前命名空间中的文件。然而,如果是不符合的声明的命名空间是自动生成的。


(6)

1
Working in the interactive consoles, you don't need to memorise the command line syntax or available functions. Instead, you can use the familiar code completion Ctrl+空格. Moreover, from within the lookup list, you can press Ctrl+Q to view the item's documentation. ******************************** 译文 **********************************在交互控制台中工作,您不需要记住命令行语法或可用的函数。相反,您可以使用熟悉的代码完成 ctrl+空格。此外,在查找列表中,可以按 ctrl+q 查看项目的文档。



2、Alt+F7

1
You can quickly find all places where a particular class, method or variable is used in the whole project by positioning the caret at the symbol's name or at its usage in code and pressing Alt+F7 (Find Usages in the popup menu).******************************** 译文 **********************************通过将插入符号定位到符号名称或符号在代码中的用法,然后按 Alt+F7(在弹出菜单中查找用法),可以快速找到在整个项目中使用特定类、方法或变量的所有位置。



3、Ctrl+Q

1
To quickly see the documentation for the symbol at caret, press Ctrl+Q (View | Quick Documentation). ******************************** 译文 **********************************要快速查看插入符号的文档,请按 ctrl+q(查看快速文档)。



4、Ctrl+B ;Ctrl

1
To navigate to the declaration of a class, method or variable used somewhere in the code, position the caret at the usage and press Ctrl+B. You can also click the mouse on usages with the Ctrl key pressed to jump to declarations.******************************** 译文 **********************************要导航到代码中某个地方使用的类、方法或变量的声明,请将插入符号放在用法处,然后按 ctrl+b 。还可以单击鼠标上的用法,同时按 ctrl 键跳到声明。



5、Ctrl+F12 ;Enter ;F4

1
You can quickly navigate in the currently edited file with Ctrl+F12 (Navigate | File Structure).It shows the list of members of the current class. Select an element you want to navigate to and press the Enter key or the F4 key.To easily locate an item in the list, just start typing its name.******************************** 译文 **********************************您可以使用 ctrl+f12(导航文件结构)在当前编辑的文件中快速导航。它显示当前类的成员列表。选择要导航到的元素,然后按 Enter 键或 F4 键。要在列表中轻松定位项目,只需开始键入其名称。



6、Shift+F6 ;Enter

1
You can easily rename your local variables with automatic correction of all places where they are used.To try it, place the caret at the variable you want to rename, and press Shift+F6 (Refactor | Rename). Type the new name in the popup window that appears, or select one of the suggested names, and press Enter. ******************************** 译文 **********************************您可以轻松地重命名局部变量,并自动更正使用它们的所有位置。若要尝试,请将插入符号放在要重命名的变量上,然后按 SHIFT+F6(重构重命名)。在弹出窗口中键入新名称,或选择一个建议的名称,然后按 Enter 。



7、Tab ;Enter

1
When using Code Completion, you can accept the currently highlighted selection in the popup list with Tab key.Unlike accepting with the Enter key, the selected name will overwrite the rest of the name to the right of the caret. This can be especially useful for replacing one method or variable name with another. ******************************** 译文 **********************************当使用代码完成时,您可以使用 tab 键接受弹出列表中当前突出显示的选择。与使用 Enter 键接受不同,所选名称将覆盖插入符号右侧名称的其余部分。这对于用另一个方法或变量名替换一个方法或变量名特别有用。



8、Shift+click

1
Did you know that you can close tabs in the editor and the tool windows of PyCharm without actually using the context menu commands? It is enough to point with your mouse cursor to a tab to be closed, and click the middle mouse button, or just use the Shift+click combination. ******************************** 译文 **********************************你知道你可以在不使用上下文菜单命令的情况下关闭 pycharm 编辑器和工具窗口中的选项卡吗?只需用鼠标光标指向要关闭的选项卡,然后单击鼠标中键,或者只需使用 SHIFT+CLICK 组合即可。



9、Alt+F1

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。



10、搜索

(1)

1
The speed search is available in all the tree views: just start typing and you'll quickly locate the necessary item.******************************** 译文 **********************************快速搜索在所有树视图中都可用:只要开始输入,您就可以快速找到所需的项目。


(2)

1
When in the Go to Class, Go to Symbol, or Go to File popup, you can ease the search by filtering the lookup list with the help of the "camel words" prefixes. ******************************** 译文 **********************************在“转到类”、“转到符号”或“转到文件”弹出窗口中,您可以通过使用“camel words”前缀筛选查找列表来简化搜索。



11、Esc ;Shift+Esc ;F12

1
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 键将焦点从编辑器移动到最后一个焦点工具窗口。



12、Ctrl+W

1
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 (扩展选择)选择插入符号处的单词,然后选择源代码的扩展区域。例如,它可以选择方法名,然后选择调用此方法的表达式,然后选择整个语句,然后选择包含块等。您还可以通过双击编辑器中的目标区域来选择插入符号处的单词和源代码的展开区域。



13、Ctrl+Alt+V

1
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). ******************************** 译文 **********************************提取变量重构有助于简化代码中的复杂语句。例如,在下面的代码片段中,可以选择代码中的表达式,然后按 ctrl+alt+v (重构提取变量)。



14、Ctrl+D

1
Ctrl+D in the editor duplicates the selected block or the current line when no block is selected. ******************************** 译文 **********************************当没有选择块时,编辑器中的 ctrl+d 将复制所选块或当前行。



15、Ctrl+Shift+向上箭头 ;Ctrl+Shift+向下箭头

1
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+向下箭头.Before: After moving the lines up: After moving the lines down: When there is no selection, the line at the cursor will be moved.  ******************************** 译文 **********************************code move statement up/down操作对于重新组织文件中的代码行很有用,例如,使变量声明更接近变量用法。例如,选择代码片段并按ctrl+shift+向上箭头或ctrl+shift+向下箭头。之前: 向上移动列后: 向下移动行后: 如果没有选择,光标处的行将被移动。

(您还可以在归档页搜索文章标题)