🚀 我的技术博客

VSCode配置与高效插件推荐

📅 发布于 2024-01-07 ⏱️ 约12分钟阅读 👁️ 2105次阅读 💬 7条评论
VSCode 编辑器 效率工具

📑 文章目录

一、为什么选择VSCode?

Visual Studio Code(VSCode)是目前最流行的代码编辑器,由微软开发,特点:

二、基础配置优化

{
  // 主题
  "workbench.colorTheme": "One Dark Pro",
  
  // 字体
  "editor.fontFamily": "'Fira Code', 'Consolas', monospace",
  "editor.fontSize": 14,
  "editor.fontLigatures": true,
  
  // 格式化
  "editor.formatOnSave": true,
  "editor.tabSize": 4,
  
  // 自动换行
  "editor.wordWrap": "on",
  
  // 文件图标
  "workbench.iconTheme": "vscode-icons",
  
  // 文件排除
  "files.exclude": {
    "**/.git": true,
    "**/__pycache__": true,
    "**/node_modules": true
  }
}

三、必备插件推荐

3.1 通用开发

插件名功能
Material Theme漂亮的主题
Prettier代码格式化
Bracket Pair Colorizer括号颜色高亮
Code Spell Checker拼写检查

3.2 Python开发

插件名功能
PythonPython语言支持
Pylance类型检查
Black Formatter代码格式化
autoDocstring自动生成文档

3.3 前端开发

插件名功能
ESLintJS代码检查
Live Server本地服务器
Auto Rename Tag自动重命名标签
HTML SnippetsHTML代码片段

四、高效使用技巧

4.1 多光标编辑

# Windows/Linux: Alt+Click
# macOS: Option+Click

# 同时选择所有相同内容
Ctrl+Shift+L (Windows/Linux)
Cmd+Shift+L (macOS)

4.2 代码跳转与查找

# 转到定义
F12

# 查找引用
Shift+F12

# 快速打开文件
Ctrl+P (Windows/Linux)
Cmd+P (macOS)

# 命令面板
Ctrl+Shift+P (Windows/Linux)
Cmd+Shift+P (macOS)

4.3 内置终端

# 打开终端
Ctrl+` (反引号)

# 新建终端
Ctrl+Shift+`

# 切换终端
Ctrl+Tab

五、快捷键速查表

操作Windows/LinuxmacOS
复制行Shift+Alt+DownOption+Shift+Down
移动行Alt+DownOption+Down
注释Ctrl+/Cmd+/
格式化Shift+Alt+FShift+Option+F
展开折叠Ctrl+Shift+[/]Cmd+Option+[/]
🤖

博主

热爱技术的开发者,专注于Python、数据分析与Web开发

← 返回首页