好的工具不是让你工作更多,而是让你少加班
作为 Python 运维自动化的倡导者,我一直相信:任何重复超过三次的事情,都应该被自动化。下面就是这套理念在个人开发环境中的具体实践。
终端生态重塑
# 换掉 bash,用 zsh + oh-my-zsh
sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"
# 安装插件:自动建议 + 语法高亮
git clone https://github.com/zsh-users/zsh-autosuggestions ~/.zsh/zsh-autosuggestions
git clone https://github.com/zsh-users/zsh-syntax-highlighting ~/.zsh/zsh-syntax-highlighting
在 Linux 服务器加固清单一文中我提到过,统一开发环境和生产环境的 shell 可以大幅减少跨平台坑。
编辑器配置
// VSCode settings.json 精简版
{
"editor.formatOnSave": true,
"editor.codeActionsOnSave": {
"source.organizeImports": "explicit"
},
"terminal.integrated.profiles.linux": {
"bash": { "path": "/bin/bash", "args": ["-l"] }
}
}
Git 效率提升
# 一键创建功能分支
alias gfb="git checkout -b feature/$(date +%Y%m%d)-$(echo $1 | tr ' ' -)"
# 自动清理过期分支
git remote prune origin && git branch -d $(git branch -r | grep 'origin' | cut -d/ -f2- | sed 's/-.*//')
关键要点总结
- Zsh + 插件:补全速度提升 5 倍
- 格式化自动保存:省下每次 Ctrl+S 的时间
- Git alias:一个字母代替命令




