Visual studio code的python环境配置

特点

  • 可以debug调试python
  • 内置终端,用着很爽
  • 兼并ST和Atom的优点,快而美观.

安装

https://code.visualstudio.com/download

用户配置

preference -> user settings

{
    "workbench.iconTheme": "vscode-icons",
    "python.linting.pylintArgs": [
        "--load-plugins", "pylint_django"
    ],
    "python.formatting.autopep8Path": "autopep8",
    "editor.fontSize": 16,
    "workbench.colorTheme": "One Dark Pro",
    "python.pythonPath": "/home/jonliu/env3/bin/python3.5"
}

安装的插件

Visual studio code的python环境配置_第1张图片
Django开发安装的插件.png

常用快捷键(高级自定义方式)

// 将键绑定放入此文件中以覆盖默认值
[
    {
        "key": "f5",
        "command": "editor.action.formatDocument",
        "when": "editorHasDocumentFormattingProvider && editorTextFocus && !editorReadonly"
    },
    {
        "key": "ctrl+shift+i",
        "command": "-editor.action.formatDocument",
        "when": "editorHasDocumentFormattingProvider && editorTextFocus && !editorReadonly"
    },
    {
        "key": "f1",
        "command": "editor.action.goToDeclaration",
        "when": "editorHasDefinitionProvider && editorTextFocus && !isInEmbeddedEditor"
    },
    {
        "key": "f12",
        "command": "-editor.action.goToDeclaration",
        "when": "editorHasDefinitionProvider && editorTextFocus && !isInEmbeddedEditor"
    },
    {
        "key": "ctrl+shift+d",
        "command": "editor.action.deleteLines",
        "when": "editorTextFocus && !editorReadonly"
    },
    {
        "key": "ctrl+shift+k",
        "command": "-editor.action.deleteLines",
        "when": "editorTextFocus && !editorReadonly"
    },
    {
        "key": "ctrl+shift+w",
        "command": "extension.vim_ctrl+w",
        "when": "editorTextFocus && vim.active && vim.use && !inDebugRepl"
    },
    {
        "key": "ctrl+w",
        "command": "-extension.vim_ctrl+w",
        "when": "editorTextFocus && vim.active && vim.use && !inDebugRepl"
    },
    {
        "key": "ctrl+b",
        "command": "-extension.vim_ctrl+b",
        "when": "editorTextFocus && vim.active && vim.use && !inDebugRepl && vim.mode != 'Insert'"
    },
    {
        "key": "ctrl+f",
        "command": "-extension.vim_ctrl+f",
        "when": "editorTextFocus && vim.active && vim.use && !inDebugRepl"
    },
    {
        "key": "ctrl+a",
        "command": "-extension.vim_ctrl+a",
        "when": "editorTextFocus && vim.active && vim.use && !inDebugRepl"
    }
]
  • autoformat: f5
  • 关闭左侧边栏: ctrl + b
  • previre markdown: ctrl + shift +v
  • 唤出终端: ctrl + `
  • 支持vim的快捷键操作
  • 切分编辑器:ctrl+\
  • vsc的快捷键查找表

主题更换

ctrl + shift + p -> 然后在弹出框中输入theme -> 回车.
此时会列出so many的主题,可以↑和↓来实时预览主题效果.

你可能感兴趣的:(Visual studio code的python环境配置)