1376 字
7 分钟
开发者工具箱:提升效率的必备工具

为什么工具如此重要?#

工欲善其事,必先利其器。

好的工具可以:

  • 提高开发效率 10 倍
  • 减少错误发生
  • 让工作更有乐趣

本文介绍开发者必备的工具和技巧。

代码编辑器#

VS Code#

必备插件#

代码质量

{
"recommendations": [
"esbenp.prettier-vscode",
"dbaeumer.vscode-eslint",
"streetsidesoftware.code-spell-checker"
]
}

语言支持

{
"recommendations": [
"golang.go",
"ms-python.python",
"redhat.java",
"vue.volar",
"bradlc.vscode-tailwindcss"
]
}

开发体验

{
"recommendations": [
"eamodio.gitlens",
"ms-vscode.hexeditor",
"formulahendry.auto-rename-tag",
"christian-kohler.path-intellisense"
]
}

高级配置#

settings.json
{
"editor.formatOnSave": true,
"editor.tabSize": 2,
"editor.wordWrap": "on",
"files.autoSave": "afterDelay",
"files.autoSaveDelay": 1000,
"terminal.integrated.fontSize": 14,
"workbench.colorTheme": "One Dark Pro",
"workbench.iconTheme": "material-icon-theme"
}

有用快捷键#

// 命令面板
Ctrl/Cmd + Shift + P
// 快速打开文件
Ctrl/Cmd + P
// 多光标
Ctrl/Cmd + D
// 跳转定义
F12
// 重命名符号
F2
// 格式化文档
Shift + Alt + F

其他编辑器#

Neovim:极客的选择,配置灵活 IntelliJ IDEA:Java 开发神器 WebStorm:前端开发神器

终端工具#

Zsh + Oh My Zsh#

Terminal window
# 安装 Zsh
sudo apt install zsh
# 安装 Oh My Zsh
sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"
# 必装插件
# ~/.zshrc
plugins=(git zsh-autosuggestions zsh-syntax-highlighting)

Starship Prompt#

Terminal window
# 安装 Starship
curl -fsSL https://starship.rs/install.sh | bash
# 配置 ~/.zshrc
eval "$(starship init zsh)"
# 配置 ~/.config/starship.toml
[character]
success_symbol = "➜"
error_symbol = "✗"
[git_branch]
symbol = "🌱 "
[nodejs]
symbol = "⬢ "

Tmux#

Terminal window
# 安装
sudo apt install tmux
# 配置 ~/.tmux.conf
set -g base-index 1
set -g pane-base-index 1
set -g status-bg black
set -g status-fg white
set -g status-left '#[fg=green]#S '
set -g status-right '#H %H:%M '

快捷键

Terminal window
# 新建会话
Ctrl + b, c
# 切换会话
Ctrl + b, s
# 分割窗口
Ctrl + b, % # 水平
Ctrl + b, " # 垂直
# 切换窗口
Ctrl + b, n

FZF#

Terminal window
# 安装
git clone --depth 1 https://github.com/junegunn/fzf.git ~/.fzf
~/.fzf/install
# 使用
Ctrl + R # 历史命令搜索
Ctrl + T # 文件搜索
Alt + C # 目录切换

Git 工具#

Lazygit#

Terminal window
# 安装
sudo apt install lazygit
# 使用
lazygit

特性

  • 可视化 Git 操作
  • 交互式添加文件
  • 快速提交和推送

Git Hooks#

Terminal window
# 安装 Husky
npm install husky --save-dev
npx husky install
# 添加 commit hook
npx husky add .husky/pre-commit "npm test"
# 添加 commitlint
npm install @commitlint/cli @commitlint/config-conventional --save-dev

Git Aliases#

~/.gitconfig
[alias]
st = status
co = checkout
br = branch
ci = commit
unstage = reset HEAD --
last = log -1 HEAD
visual = log --graph --oneline --all --decorate

API 工具#

Insomnia#

替代 Postman 的更轻量选择:

  • 干净的界面
  • 更好的性能
  • 支持 GraphQL

HTTPie#

Terminal window
# 安装
pip install httpie
# 使用
http GET https://api.example.com/users
http POST https://api.example.com/users name=John email=john@example.com
http PUT https://api.example.com/users/123 email=new-email@example.com

Curl 技巧#

Terminal window
# 基本请求
curl https://api.example.com/users
# 带认证
curl -H "Authorization: Bearer token" https://api.example.com/users
# POST JSON
curl -X POST -H "Content-Type: application/json" \
-d '{"name":"John"}' \
https://api.example.com/users
# 上传文件
curl -F "file=@document.pdf" https://api.example.com/upload
# 保存响应
curl -o output.json https://api.example.com/data

调试工具#

Chrome DevTools#

快捷键

F12 打开开发者工具
Ctrl/Cmd + Shift + C 元素选择器
Ctrl/Cmd + Shift + J 控制台
Ctrl/Cmd + Shift + I 开发者工具

面板

  • Elements:元素和样式
  • Console:控制台和日志
  • Sources:调试和断点
  • Network:网络请求
  • Performance:性能分析
  • Memory:内存分析
  • Application:应用数据

VS Code 调试器#

.vscode/launch.json
{
"version": "0.2.0",
"configurations": [
{
"type": "node",
"request": "launch",
"name": "Launch Program",
"program": "${workspaceFolder}/index.js"
},
{
"type": "chrome",
"request": "launch",
"name": "Launch Chrome",
"url": "http://localhost:3000",
"webRoot": "${workspaceFolder}"
}
]
}

性能分析#

Lighthouse#

Terminal window
# 安装
npm install -g lighthouse
# 使用
lighthouse https://example.com --view

WebPageTest#

Terminal window
# 在线使用
https://www.webpagetest.org/
# API
curl "https://www.webpagetest.org/runtest.php?url=https://example.com&k=YOUR_API_KEY"

Profiling Tools#

CPU Profiling

Node.js
const profiler = require('v8-profiler');
profiler.startProfiling('cpu-profile');
// 你的代码
doSomething();
profiler.stopProfiling('cpu-profile');

Memory Profiling

// Chrome DevTools
// 1. 打开 Memory 面板
// 2. 选择 "Heap snapshot"
// 3. 拍快照
// 4. 分析内存泄漏

数据库工具#

DBeaver#

支持多种数据库:

  • MySQL / PostgreSQL / SQLite
  • MongoDB / Redis
  • Oracle / SQL Server

psql 技巧#

Terminal window
# 连接
psql -h localhost -U username -d database
# 导出
pg_dump -h localhost -U username database > backup.sql
# 导入
psql -h localhost -U username -d database < backup.sql
# 查看表结构
\d table_name

容器工具#

Docker Compose#

version: '3.8'
services:
app:
build: .
ports:
- "3000:3000"
environment:
- NODE_ENV=development
volumes:
- .:/app
- /app/node_modules

kubectl 技巧#

Terminal window
# 上下文管理
kubectl config use-context context-name
kubectl config get-contexts
# 快速查看
kubectl get pods -w
kubectl describe pod pod-name
kubectl logs -f pod-name
# 进入容器
kubectl exec -it pod-name -- /bin/sh
# 端口转发
kubectl port-forward pod-name 8080:3000

监控工具#

Prometheus + Grafana#

prometheus.yml
global:
scrape_interval: 15s
scrape_configs:
- job_name: 'node'
static_configs:
- targets: ['localhost:9100']

htop / nload#

Terminal window
# 系统监控
htop
# 网络监控
nload

自动化工具#

Make#

# Makefile
.PHONY: install test build
install:
npm install
test:
npm test
build:
npm run build
run:
npm run dev
clean:
rm -rf dist node_modules
Terminal window
# 使用
make install
make test
make build

GitHub Actions#

.github/workflows/ci.yml
name: CI
on:
push:
branches: [ main ]
pull_request:
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: '18'
- run: npm ci
- run: npm test

文档工具#

Markdown 增强#

VS Code 插件

{
"recommendations": [
"yzhang.markdown-all-in-one",
"shd101wyy.markdown-preview-enhanced",
"bierner.markdown-mermaid"
]
}

Mermaid 图表

```mermaid
graph TD
A[开始] --> B{条件}
B -->|真| C[操作1]
B -->|假| D[操作2]
C --> E[结束]
D --> E
swagger.yaml
### Swagger / OpenAPI
```yaml
openapi: 3.0.0
info:
title: My API
version: 1.0.0
paths:
/users:
get:
summary: Get users
responses:
'200':
description: Success

搜索工具#

Ripgrep (rg)#

Terminal window
# 安装
sudo apt install ripgrep
# 使用
rg "function" ./src
# 忽略文件
rg "function" ./src --glob "!*.test.js"
# 上下文
rg "function" ./src -C 3

Fd#

Terminal window
# 安装
sudo apt install fd-find
# 使用
fd pattern
# 扩展名过滤
fd ".js" ./src

远程工具#

SSH Config#

~/.ssh/config
Host server
HostName 192.168.1.100
User username
Port 22
IdentityFile ~/.ssh/id_rsa
Terminal window
# 使用
ssh server

Tmux#

远程开发必备:

  • 会话保持
  • 多窗口
  • 可视化

学习工具#

Anki#

使用间隔重复学习技术:

  • 学习编程概念
  • 记忆快捷键
  • 复习最佳实践

Devhints#

快速参考备忘单:

https://devhints.io/

总结#

好的工具可以大幅提升效率:

编辑器:VS Code + 必备插件

终端:Zsh + Oh My Zsh + Starship

Git:Lazygit + Git Hooks

API:Insomnia + HTTPie

调试:Chrome DevTools + VS Code 调试器

性能:Lighthouse + Profiling Tools

数据库:DBeaver + psql

容器:Docker + kubectl

监控:Prometheus + Grafana

自动化:Make + GitHub Actions

记住:工具是为我们服务的,选择适合你的工具,持续学习和优化你的工具链。


相关文章

开发者工具箱:提升效率的必备工具
https://www.599.red/posts/developer-tools-guide/
作者
机器人辉哥
发布于
2026-02-08
许可协议
CC BY-NC-SA 4.0
封面
示例歌曲
示例艺术家
封面
示例歌曲
示例艺术家
0:00 / 0:00