<rss xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title>Tools - 标签 - 炒碗软饭</title><link>https://chaoruan.xyz/tags/tools/</link><description>Tools - 标签 - 炒碗软饭</description><generator>Hugo -- gohugo.io</generator><language>zh-CN</language><managingEditor>blog@chaoruan.dev (Chao Ruan)</managingEditor><webMaster>blog@chaoruan.dev (Chao Ruan)</webMaster><lastBuildDate>Sun, 29 Mar 2026 17:00:00 +1100</lastBuildDate><atom:link href="https://chaoruan.xyz/tags/tools/" rel="self" type="application/rss+xml"/><item><title>我怎么配置每一台电脑</title><link>https://chaoruan.xyz/posts/dev-kit-philosophy/</link><pubDate>Sun, 29 Mar 2026 17:00:00 +1100</pubDate><author>blog@chaoruan.dev (Chao Ruan)</author><guid>https://chaoruan.xyz/posts/dev-kit-philosophy/</guid><description><![CDATA[<p>我所有的机器都跑同一套配置。MacBook、Windows 游戏 PC、工作用的 Surface，一条命令搞定。平台之间的差异交给 <a href="https://www.chezmoi.io/" target="_blank" rel="noopener noreffer ">chezmoi</a> 的模板处理，我不用再操心。坐到任何一台机器前，手上的肌肉记忆直接能用，这就是目的。</p>
<p>做到这一点的前提是选跨平台的工具。<a href="https://neovim.io/" target="_blank" rel="noopener noreffer ">Neovim</a>、<a href="https://github.com/junegunn/fzf" target="_blank" rel="noopener noreffer ">fzf</a>、<a href="https://github.com/BurntSushi/ripgrep" target="_blank" rel="noopener noreffer ">ripgrep</a>、<a href="https://github.com/sharkdp/bat" target="_blank" rel="noopener noreffer ">bat</a>、<a href="https://github.com/jesseduffield/lazygit" target="_blank" rel="noopener noreffer ">lazygit</a>、<a href="https://github.com/sxyazi/yazi" target="_blank" rel="noopener noreffer ">yazi</a>、<a href="https://starship.rs/" target="_blank" rel="noopener noreffer ">Starship</a>、<a href="https://mise.jdx.dev/" target="_blank" rel="noopener noreffer ">mise</a>，macOS、Linux、Windows 都能跑。没法统一的地方（Zsh 和 PowerShell、Karabiner 和 Kanata），配置也尽量让手感一致。平台专属的东西越少，脑子里要记的就越少。</p>
<h2 id="终端就是工作台">终端就是工作台</h2>
<p>Neovim 写代码，fzf 找文件，lazygit 管版本，<a href="https://github.com/tmux/tmux" target="_blank" rel="noopener noreffer ">tmux</a> 保持会话，yazi 移文件。它们是不同的程序，但共享一些约定，用起来像一个整体。tmux 和 Neovim 之间的窗格切换靠 <a href="https://github.com/christoomey/vim-tmux-navigator" target="_blank" rel="noopener noreffer ">vim-tmux-navigator</a> 统一了。同一套 leader 键在 Neovim 单独用和在 VS Code 里都一样。不管在哪个环境，脑子里只有一套快捷键。</p>
<p>偶尔需要用 <a href="https://code.visualstudio.com/" target="_blank" rel="noopener noreffer ">VS Code</a> 的时候，<a href="https://marketplace.visualstudio.com/items?itemName=asvetliakov.vscode-neovim" target="_blank" rel="noopener noreffer ">VSCode Neovim</a> 插件能保住肌肉记忆。同样的操作方式，同样的 leader 键，同样的 surround 和注释快捷键。VS Code 管它擅长的（LSP 界面、插件、终端），Neovim 管编辑。</p>
<h2 id="视觉统一">视觉统一</h2>
<p>所有工具都用 <a href="https://github.com/catppuccin/catppuccin" target="_blank" rel="noopener noreffer ">Catppuccin Mocha</a>。终端、编辑器、状态栏、输入法、文件管理器、系统监控，全部一个配色。代码用 <a href="https://github.com/tonsky/FiraCode" target="_blank" rel="noopener noreffer ">Fira Code</a>（连字），Obsidian 写文章用 <a href="https://ia.net/topics/a-typographic-christmas" target="_blank" rel="noopener noreffer ">iA Writer Duo S</a>，中文回退用<a href="https://github.com/adobe-fonts/source-han-sans" target="_blank" rel="noopener noreffer ">思源黑体</a>。听起来像是在纠结表面功夫，但切换工具的时候颜色不变，注意力的消耗确实会少一些。</p>
<h2 id="中英文双线">中英文双线</h2>
<p>中文输入不是后加的补丁，是配置的一部分。<a href="https://rime.im/" target="_blank" rel="noopener noreffer ">Rime</a> 在 macOS 和 Windows 上跑同一套方案，底层是 <a href="https://github.com/iDvel/rime-ice" target="_blank" rel="noopener noreffer ">rime-ice</a>。退出插入模式的时候编辑器自动切回英文，靠 <a href="https://github.com/keaising/im-select.nvim" target="_blank" rel="noopener noreffer ">im-select</a> 实现，打中文不会干扰 vim 操作。中英文之间的空格由 <a href="https://github.com/hotoo/pangu.vim" target="_blank" rel="noopener noreffer ">pangu.vim</a> 在保存时自动处理。每天两种语言混着写，工具得把两边都当正经公民对待。</p>
<h2 id="笔记在编辑器里">笔记在编辑器里</h2>
<p><a href="https://obsidian.md/" target="_blank" rel="noopener noreffer ">Obsidian</a> 是我思考的地方。笔记、参考资料、日志、项目规划都在里面。编辑器通过 <a href="https://github.com/obsidian-nvim/obsidian.nvim" target="_blank" rel="noopener noreffer ">obsidian.nvim</a> 直连 vault，搜索笔记、跳转 wiki-link、打开当天日记，都不用离开 Neovim。<code>machine.json</code> 里配了 vault 路径就自动激活，没配就安静待着。</p>
<h2 id="私密的留在本地">私密的留在本地</h2>
<p>每台机器的密钥和路径放在 chezmoi 不管的本地覆盖文件里。一个 <code>machine.json</code> 给所有工具提供运行时上下文（vault 路径、设备身份、输入法），不用每个工具重复配一遍。私密的不进 git，通用的保持可移植。</p>
<h2 id="键盘优先">键盘优先</h2>
<p>Caps Lock 一键两用：单击是 Escape，按住是 Hyper。macOS 上用 <a href="https://karabiner-elements.pqrs.org/" target="_blank" rel="noopener noreffer ">Karabiner-Elements</a>，Windows 上用 <a href="https://github.com/jtroo/kanata" target="_blank" rel="noopener noreffer ">Kanata</a>。shell 里开 vi 模式，文件管理器用 vim 快捷键，VS Code 也走 vim 操作。鼠标还是会用，但手指大部分时间留在主键区。</p>
<h2 id="新机器几分钟搞定">新机器几分钟搞定</h2>
<p>装 chezmoi，跑 init，回答几个问题，平台安装脚本处理剩下的。命令行工具、字体、插件、运行时，全部自动装好。加一个新工具就是往 chezmoi 源里丢一个配置文件，再加一行安装命令。结构够简单，扩展的时候不需要理解全貌。</p>
<h2 id="什么都不会丢">什么都不会丢</h2>
<p>tmux 的会话通过 <a href="https://github.com/tmux-plugins/tmux-resurrect" target="_blank" rel="noopener noreffer ">tmux-resurrect</a> 和 <a href="https://github.com/tmux-plugins/tmux-continuum" target="_blank" rel="noopener noreffer ">tmux-continuum</a> 自动保存和恢复。撤销历史跨重启保持。<a href="https://github.com/ajeetdsouza/zoxide" target="_blank" rel="noopener noreffer ">zoxide</a> 记得去过的目录。终端崩了，tmux 会话还在。机器重启了，一条命令从 git 把其他的东西拉回来。重要的东西不只活在内存里。</p>
<hr>
]]></description></item></channel></rss>