fzf
fzf is a general-purpose command-line fuzzy finder.
# Shell Integration
http://junegunn.github.io/fzf/shell-integration/ (opens new window)
CTRL + T: complete the command using fzfCTRL + R: 搜索历史命令CTRL-/: see the whole command
Option + C: 搜索目录(直接 cd 进去)。
# support
https://junegunn.github.io/fzf/examples/directory-navigation/ (opens new window)
# fzf-git
fzf-github (opens new window) project provides a bunch of key bindings for completing Git objects. You should definitely check it out. example (opens new window)
# tricks
# 在shell中浏览任何目录下的文件内容
本方案借助 raycast 的 snippets 功能
- 在 raycast 中创建 snippet
cat $(find {clipboard} -type f 2>/dev/null | fzf --preview="cat {} | head -50"), 取名 <snippet_name> - 复制需要浏览的目录,然后打开 raycast。 搜素上述 <snippet_name>。 按Enter触发文件浏览
# git 高效切换分支
# 1
git branch | fzf | cut -c 3- | xargs git checkout
# 2. 输出纯净的分支名,省去 cut 这一步
git branch --format='%(refname:short)' | fzf | xargs git checkout
1
2
3
4
5
2
3
4
5
注: 另一个更加高效的可以使用 fzf-git 支持。 具体可以参照fzf-git
# link
- fzf-github (opens new window) github 官网
- fzf-io (opens new window) useful
上次更新: 2026/05/21, 21:58:29
- 02
- VisiData 终极生存指南(vd)04-27
- 03
- macOS 定时任务实现:Git 仓库状态自动同步方案04-26