| disable-model-invocation | true |
| name | fzf-patterns |
| description | Provides fzf command patterns and configurations. Use when writing fzf commands, interactive filters, or pipeline compositions. |
fzf Patterns
fzf ๊ธฐ๋ฐ ์ธํฐ๋ํฐ๋ธ ํํฐ๋ง ์คํฌ๋ฆฝํธ/ํ๋ก๊ทธ๋จ ์์ฑ์ ์ง์ํฉ๋๋ค.
ํต์ฌ ์ฒ ํ:
- ํ์ดํ๋ผ์ธ ์กฐํฉ:
source | fzf [options] | action
- ํ๋ฆฌ๋ทฐ๋ก ์ปจํ
์คํธ ์ ๊ณต: ์ ํ ์ ๋ด์ฉ ํ์ธ
- ํค ๋ฐ์ธ๋ฉ์ผ๋ก ์ํฌํ๋ก์ฐ ํ์ฅ: ๋ค์ํ ์ก์
์ฐ๊ฒฐ
- ์ ์ง์ ๋ณต์ก๋: ๋จ์ โ ํ๋ฆฌ๋ทฐ โ ๋ฐ์ธ๋ฉ โ ๋์ ์์ค
Instructions
์ํฌํ๋ก์ฐ 1: ๊ธฐ๋ณธ ๋ช
๋ น์ด ์์ฑ
์ฌ์ฉ์ ์์ฒญ์์ ํ์
:
- ์์ค: ๋ฌด์์ ํํฐ๋ง? (ํ์ผ, ํ๋ก์ธ์ค, git ๋ฑ)
- ์ก์
: ์ ํ ํ ๋ฌด์์? (์ด๊ธฐ, ์ญ์ , ์ฒดํฌ์์ ๋ฑ)
- ์ปจํ
์คํธ: ํ๋ฆฌ๋ทฐ ํ์ ์ฌ๋ถ
๊ธฐ๋ณธ ํจํด:
<source> | fzf --preview '<cmd> {}' | <action>
์ํฌํ๋ก์ฐ 2: ๋ฆฌ์์ค ๋งค์นญ
์์ฒญ์ ๋ฐ๋ผ ์ ์ ํ ๋ฆฌ์์ค ๋ก๋ฉ:
| ํค์๋ | ๋ฆฌ์์ค |
|---|
| ๊ฒ์ ๋ฌธ๋ฒ, ํํฐ, ํจํด | 01-search-syntax.md |
| ์ต์
, ์ค์ , ํ๋๊ทธ | 02-options.md |
| ํค ๋ฐ์ธ๋ฉ, --bind, ์ก์
| 03-bindings.md |
| ํ๋ฆฌ๋ทฐ, preview, bat | 04-preview.md |
| ์ ํตํฉ, CTRL-R/T, ALT-C | 05-shell-integration.md |
| ๋ ์ํผ, ํจ์, git/docker | 06-recipes.md |
| ๊ณ ๊ธ, ๋ฉํฐ๋ผ์ธ, ํ๋ก๊ทธ๋๋ฐ | 07-advanced-patterns.md |
์ํฌํ๋ก์ฐ 3: ํจ์ ์์ฑ
ํจ์ ์์ฒญ ์ ํ
ํ๋ฆฟ ๊ธฐ๋ฐ ์์ฑ:
my_func() {
local selected=$(
SOURCE_CMD |
fzf --height 40% \
--layout reverse \
--preview 'PREVIEW_CMD {}'
)
[[ -n "$selected" ]] && ACTION "$selected"
}
Quick Reference
๊ฒ์ ๋ฌธ๋ฒ
| ํ ํฐ | ์๋ฏธ |
|---|
word | fuzzy ๋งค์นญ |
'word | ์ ํํ ํฌํจ |
^word | ์์ |
word$ | ๋ |
!word | ์ ์ธ |
a | b | OR |
ํ์ ์ต์
--height 40%
--layout reverse
--border
--multi
--preview 'cmd {}'
--bind 'key:action'
--ansi
์์ฃผ ์ฐ๋ ๋ฐ์ธ๋ฉ
--bind 'ctrl-/:toggle-preview'
--bind 'ctrl-a:select-all'
--bind 'enter:become(vim {})'
--bind 'change:reload:cmd {q}'
ํ๋ฆฌ๋ทฐ ์์
--preview 'bat --color=always {}'
--preview 'git log --oneline -20 {}'
--preview 'tree -C {} | head -100'
Examples
ํ์ผ ๊ฒ์ + ์ด๊ธฐ
์์ฒญ: "ํ์ผ ์ฐพ์์ vim์ผ๋ก"
fd --type f | fzf --preview 'bat --color=always {}' | xargs vim
Git ๋ธ๋์น
์์ฒญ: "๋ธ๋์น ์ ํํด์ ์ฒดํฌ์์"
git branch | fzf --preview 'git log --oneline {-1}' \
--bind 'enter:become(git checkout {-1})'
ripgrep ํตํฉ
์์ฒญ: "์ฝ๋ ๊ฒ์ํ๋ฉด์ ํ๋ฆฌ๋ทฐ"
โ resources/06-recipes.md์ rfv ํจ์ ์ฐธ์กฐ
์ ์ค์
์์ฒญ: "CTRL-R ์ปค์คํ
ํ๊ณ ์ถ์ด"
โ resources/05-shell-integration.md์ FZF_CTRL_R_OPTS ์ฐธ์กฐ
Technical Details
REFERENCE.md: ์ ์ฒด ๊ฐ์ ๋ฐ ํธ๋ฌ๋ธ์ํ
resources/01-search-syntax.md: ๊ฒ์ ํ ํฐ ์์ธ
resources/02-options.md: ๋ชจ๋ ์ต์
์นดํ
๊ณ ๋ฆฌ๋ณ ์ ๋ฆฌ
resources/03-bindings.md: --bind ์ก์
์ ์ฒด ๋ชฉ๋ก
resources/04-preview.md: ํ๋ฆฌ๋ทฐ ์ฐฝ ์ค์
resources/05-shell-integration.md: ์ ํตํฉ (ํ๊ฒฝ๋ณ์, ํค๋ฐ์ธ๋ฉ)
resources/06-recipes.md: ์ค์ฉ ํจ์ ๋ชจ์ (git, docker, file ๋ฑ)
resources/07-advanced-patterns.md: ๋ฉํฐ๋ผ์ธ, ํ๋ก๊ทธ๋๋ฐ ํตํฉ