fuzzy-selecting
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
Chinesefzf: Interactive Fuzzy Finder
fzf:交互式模糊查找器
Always invoke fzf skill for interactive fuzzy selection - do not execute bash commands directly.
Use fzf for interactive fuzzy selection and filtering of any command-line list.
进行交互式模糊选择时,请始终调用fzf技能——不要直接执行bash命令。
使用fzf对任意命令行列表进行交互式模糊选择和过滤。
Default Strategy
默认策略
Invoke fzf skill for interactive fuzzy selection from any list with preview capabilities. Use when choosing from search results, files, processes, or any command output.
Common workflow: Discovery skill (fd, ripgrep, jq, yq) → fzf skill → other skills (bat, xargs) for interactive selection and action.
调用fzf技能对带有预览功能的任意列表进行交互式模糊选择。适用于从搜索结果、文件、进程或任何命令输出中进行选择的场景。
常见工作流:发现类技能(fd、ripgrep、jq、yq)→ fzf技能 → 其他技能(bat、xargs),完成交互式选择与操作。
Key Options
关键选项
Display Modes
显示模式
- set height (percent or exact lines)
--height N[%] - tmux popup mode
--tmux [POS][SIZE][,border] - layout direction
--layout default|reverse|reverse-list - add border
--border [rounded|sharp|thin] - UI preset
--style default|full|minimal
- 设置高度(百分比或精确行数)
--height N[%] - tmux弹窗模式
--tmux [POS][SIZE][,border] - 布局方向
--layout default|reverse|reverse-list - 添加边框
--border [rounded|sharp|thin] - UI预设
--style default|full|minimal
Search & Matching
搜索与匹配
- exact matching instead of fuzzy
-e/--exact - input type optimization
--scheme default|path|history - custom field delimiter
--delimiter STR - search specific fields only
--nth N..
- 精确匹配(替代模糊匹配)
-e/--exact - 输入类型优化
--scheme default|path|history - 自定义字段分隔符
--delimiter STR - 仅搜索特定字段
--nth N..
Preview Window
预览窗口
- external command preview
--preview "CMD {}" - preview configuration
--preview-window POSITION[SIZE][,border] - custom preview label
--preview-label TEXT
- 外部命令预览
--preview "CMD {}" - 预览配置
--preview-window POSITION[SIZE][,border] - 自定义预览标签
--preview-label TEXT
Selection Options
选择选项
- multi-select mode (TAB to mark)
-m/--multi - custom key bindings
--bind KEY:ACTION - custom prompt string
--prompt "TEXT" - custom header text
--header "TEXT"
- 多选模式(按TAB标记)
-m/--multi - 自定义按键绑定
--bind KEY:ACTION - 自定义提示字符串
--prompt "TEXT" - 自定义头部文本
--header "TEXT"
Performance Options
性能选项
- reverse input order (top-down)
--tac - display specific fields
--with-nth N.. - parse ANSI color codes
--ansi
- 反转输入顺序(自上而下)
--tac - 显示特定字段
--with-nth N.. - 解析ANSI颜色代码
--ansi
When to Use
使用场景
- File Selection: Interactive file browsing with preview
- Command History: Search and reuse previous commands
- Process Management: Select and manage running processes
- Git Integration: Browse commits, branches, files
- Multi-Select Operations: Batch processing of selected items
- 文件选择:带预览的交互式文件浏览
- 命令历史:搜索并复用之前的命令
- 进程管理:选择并管理运行中的进程
- Git集成:浏览提交记录、分支、文件
- 多选操作:对选中项目进行批处理
Common Workflows
常见工作流
- : Find files, select, view with syntax highlighting
fd | fzf → bat - : Search content, select matches, edit files
ripgrep | fzf → vim - : Extract data, select entries, view details
jq/yq | fzf → bat - : Browse commits, select, view changes
git log | fzf → show - : List processes, select, terminate
ps | fzf → kill - : Multiple selection for batch operations
find | fzf -m → xargs
- :查找文件,选择后使用语法高亮查看
fd | fzf → bat - :搜索内容,选择匹配项后编辑文件
ripgrep | fzf → vim - :提取数据,选择条目后查看详情
jq/yq | fzf → bat - :浏览提交记录,选择后查看变更
git log | fzf → show - :列出进程,选择后终止
ps | fzf → kill - :多选进行批量操作
find | fzf -m → xargs
Core Principles
核心原则
- Interactive Filtering: Real-time fuzzy matching as you type
- Universal Input: Works with any list from STDIN or file system
- Extensible: Customizable through bindings and preview commands
- Performance: Optimized to handle millions of items instantly
- 交互式过滤:输入时实时进行模糊匹配
- 通用输入:兼容来自标准输入(STDIN)或文件系统的任意列表
- 可扩展:通过绑定和预览命令进行自定义
- 高性能:优化后可瞬间处理数百万条项目
Detailed Reference
详细参考
For comprehensive search patterns, key bindings, preview configurations, and integration examples, load fzf guide when needing:
- Custom key bindings and actions
- Advanced preview window configuration
- Multi-select workflows
- Tmux integration
- Shell setup functions
The guide includes:
- Basic usage and display modes
- Search syntax and matching patterns
- Multi-select operations and key bindings
- Preview window configuration
- Integration examples (git, processes, file systems)
- Performance optimization and troubleshooting
- Shell integration setup and custom functions
如需全面了解搜索模式、按键绑定、预览配置和集成示例,可加载fzf指南,适用于以下场景:
- 自定义按键绑定与操作
- 高级预览窗口配置
- 多选工作流
- Tmux集成
- Shell设置函数
该指南包含:
- 基础用法与显示模式
- 搜索语法与匹配模式
- 多选操作与按键绑定
- 预览窗口配置
- 集成示例(Git、进程、文件系统)
- 性能优化与故障排除
- Shell集成设置与自定义函数
Skill Combinations
技能组合
For Discovery Phase
发现阶段
- fd → fzf: Interactive file selection from search results
- ripgrep → fzf: Interactive selection from search matches
- jq/yq → fzf: Interactive selection from extracted data
- git log/branch → fzf: Interactive git history browsing
- fd → fzf:从搜索结果中交互式选择文件
- ripgrep → fzf:从搜索匹配项中交互式选择
- jq/yq → fzf:从提取的数据中交互式选择
- git log/branch → fzf:交互式浏览Git历史
For Analysis Phase
分析阶段
- any_command → fzf → bat: Select items and preview with syntax highlighting
- fd → fzf --preview="bat {}": File browser with syntax preview
- ripgrep → fzf --preview="bat {1} +{2}": Search results with file preview
- any_command → fzf → bat:选择项目并使用语法高亮预览
- fd → fzf --preview="bat {}":带语法预览的文件浏览器
- ripgrep → fzf --preview="bat {1} +{2}":带文件预览的搜索结果
For Refactoring Phase
重构阶段
- any_command → fzf -m: Batch process multiple selected items
- find | fzf -m | xargs: Classic multi-select pattern
- ps | fzf -m | xargs kill: Multi-process management
- any_command → fzf -m:对多个选中项目进行批处理
- find | fzf -m | xargs:经典多选模式
- ps | fzf -m | xargs kill:多进程管理
Integration Examples
集成示例
bash
undefinedbash
undefinedInteractive code search and edit
Interactive code search and edit
rg "pattern" | fzf --preview="bat --color=always --highlight-line {2} {1}" | awk '{print $1}' | xargs vim
rg "pattern" | fzf --preview="bat --color=always --highlight-line {2} {1}" | awk '{print $1}' | xargs vim
Interactive dependency management
Interactive dependency management
jq -r '.dependencies | keys[]' package.json | fzf --multi | xargs npm uninstall
jq -r '.dependencies | keys[]' package.json | fzf --multi | xargs npm uninstall
undefined