vscode中python常用插件

  • Python
  • autopep8 格式化代码
    View > Command Palette… 输入 Preferences: Open User Settings (JSON)):
    打开的文件中加入以下配置,即可实现保存自动格式化代码
      , 
      "[python]": {
          "editor.defaultFormatter": "ms-python.autopep8",
          "editor.formatOnSave": true
      }
  • Python Debugger
  • Pylance

快捷键

  • 跳回中次代码位置: contol + -(减号):回到光标上一个停留的位置
  • 展开或者收缩代码段:option+command+[ 或者 ]
  • 按名字搜索文件,可快速打开指定的文件: command+P
  • 从光标处选择到行首/尾:shift+command+左/右键