pycharm快捷键

CTRL + SHIFT  + 上/下(方向箭)        ===========》  将光标所在行的代码向上或向下移动

CTRL + SHIFT + J               ===========》 将光标所在行代码和下一行代码连接为一行,并移除不必要的空格,匹配你的代码样式

CTRL + Y       =============>   删除光标所在行代码  或 选中的行

SHIFT + Delete    ==========》 删除光标所在行代码 颧选中的行

CTRL + SHIFT + Backspace ( Navigate | Last Edit Location ) brings you 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 + /         注释光标所在的行,或所选择的行

CTRL + P       将光标放在函数的圆括号里,按CTRL + P ,可以显示参数

CTRL + ]        光标跳到行尾

CTRL + [        光标跳到行首

SHIFT + Enter  快速 换行,即光标无需在行尾

CTRL + E    调出 Recent Files 对话框

pycharm   run 运行 改为 ALT + X  ,原来为shift + F10

CTRL + 上箭头/下箭头          向下滚动代码,向上滚动代码 (便于查看代码),代替鼠标操作,更加快捷

When using basic code completion ( CtrL + 空格 ),type any characters  tha exists anywhere in an identifier.

Use Alt + 向上箭头 and  Alt + 向下箭头 kyes to quicky move between methods in the editor

 一、在PyCharm下为你的Python项目配置Python解释器

    1、Settings--》Editor--》Project:当前项目名--》Project Interpreter--》Add Local

  二、在Python下创建Python文件、Python模块

    1、File--》New--》Python File

    2、File--》New--》Python Package

  三、使用PyCharm安装Python第三方模块

    1、Settings--》Editor--》Project:当前项目名--》Project Interpreter--》点击右侧绿色加号

  四、Python基本设置

    1、不使用Tab,Tab=4空格:Editor--》Code Style--》Python--》Tabs and Indents页签

    2、字体、字体颜色:           Editor--》Colors & Fonts--》Font/Language Defaults/Python

    3、关闭自动更新:              Editor--》Appearance & Behavior--》System Settings--》Updates

    4、脚本头设置:                 Editor--》Code Style--》File and Code Templates--》Python Script

    5、显示行号:         Editor--》General--》Appearance--》Show line numbers

    6、右侧竖线是PEP8的代码规范:提示一行不要超过120个字符。

    7、导出、导入你自定义的配置:File--》Export Settings、Import Settings

  五、常用快捷键

     Editor--》Keymap

    1、Crtl + D :复制当前行

    2、Ctrl + Y  :删除当前行

    3、Shift + Enter :快速换行

    4、Ctrl + / :快速注释 (选中多行后可以批量注释)

    5、Tab :缩进当前行 (选中多行后可以批量缩进)

    6、Shift + Tab :取消缩进 (选中多行后可以批量取消缩进)

    7、Ctrl + F :查找

    8、Ctrl + R :替换

    9、Ctrl + ] :跳到行尾

    10、Ctrl + [:跳到行首

  六、PyCharm安装插件

    1、 Editor--》Plugins Editor--》Browse repositories --》Install

  七、Git配置

    1、Editor--》Version Control--》Git

  八、常用操作指南

    1、复制文件路径:左侧文件列表右键选中的文件--》Copy Path

    2、在文件管理器中打开:左侧文件列表右键选中的文件--》Show in Explorer

    3、快速定位:Ctrl + 某些內建模块之后,点击在原文件中展开

      Scroll from Source / Collapse All

    4、查看结构:IDE左侧边栏Structure查看当前项目的结构

    5、Tab批量换Space:Edit--》Convent Indents--》To Spaces/To Tobs

    6、TODO的使用:#TODO要做的事情

    7、把当前Tab页移到窗口右边(下边),方便对比:Tab页签右键--》Move to Right(Down)

    8、查看文件修改前后对比:文件中右键--》Local History

    9、IDE右下角一些有用的信息:当前光标在第几行的第几个字符/当前回车换行/当前编码类型/当前Git分支

    10、IDE右侧边栏--》DataBase

  九、PEP8代码规范

    1、单独一行的注释:# + 1空格 + 注释内容

    2、代码后跟着的注释:2空格 + # + 1空格 + 注释内容

  十、SSH Terminal Default encoding

    1、Editor--》Tools--》SSH Terminal--》Default encoding UTF-8

  十一、编码统一

    Editor--》File Encoding--》IDE Encoding 和 Project Encoding 编码统一 UTF-8

Use Ctrl + Shift + F7 ( Edit | Find | Highlight Usages in File ) to quickly highlight usages of some variable in the current file.

Use F3 and Shitf + F3 keys to navigate through highlighted usages

Press Esc to remove highlighting.

With a single keystroke, you cna apply another code style/coding scheme or keymap right from the editor. Just press Ctrl + ` (View | Quick Switch Scheme ), to specify the scheme you want to change.

To see your local history of changes in a file,invoke  Local History |  Show History from the context menu.

You can navigate through difference file versions, see the differences and roll back to any previous versiion.

Use the same context menu item to see the history of changes on a directory. You will never lose any code with this feature!

 翻译过来就是:要查看一个文件的改变的本地历史,可以调用上下菜单(即右键菜单)的 Local History ---》 Show History 命令。你可以通过不同文件版本来导航,查看版本之间的不同及及回退(回滚)到之前的版本。

在一个目录上使用同样的上下文环境,来查看目录的修改历史。

Use the Ctrl + Shift + v shotchut to choose and insert recent clipboard contents into the text

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 mya select a method name, the the expression that calls this method, then the whole statement, then 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.

The Ctrl + shift + J shortcut joins two lines into one and remove unnecessary spaces to match your code style.

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

原文地址:https://www.cnblogs.com/chris-jia/p/9449016.html