Jacky's blog
首页
  • 学习笔记

    • web
    • android
    • iOS
    • vue
  • 分类
  • 标签
  • 归档
收藏
  • tool
  • algo
  • python
  • java
  • server
  • growth
  • frida
  • blog
  • SP
  • more
GitHub (opens new window)

Jack Yang

编程; 随笔
首页
  • 学习笔记

    • web
    • android
    • iOS
    • vue
  • 分类
  • 标签
  • 归档
收藏
  • tool
  • algo
  • python
  • java
  • server
  • growth
  • frida
  • blog
  • SP
  • more
GitHub (opens new window)
  • shell

    • shell 入门指南
    • linux 入门指南
    • Shell 常用命令速查手册
    • Shell 代码片段集合
    • awk
    • fzf
      • Shell Integration
      • support
        • fzf-git
      • tricks
        • 在shell中浏览任何目录下的文件内容
        • git 高效切换分支
      • link
    • fd
    • ftp
    • sftp
    • ifconfig
    • ssh
    • sed
    • xargs
  • tool

  • 网络

  • compute_base

  • blog

  • growth

  • java

  • C&C++

  • ai

  • secure

  • cms

  • english

  • 生活

  • 金融学

  • more

  • other
  • shell
Jacky
2026-04-11
目录

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 fzf
  • CTRL + 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 功能

  1. 在 raycast 中创建 snippet cat $(find {clipboard} -type f 2>/dev/null | fzf --preview="cat {} | head -50"), 取名 <snippet_name>
  2. 复制需要浏览的目录,然后打开 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

注: 另一个更加高效的可以使用 fzf-git 支持。 具体可以参照fzf-git

# link

  • fzf-github (opens new window) github 官网
  • fzf-io (opens new window) useful
#shell
上次更新: 2026/05/21, 21:58:29
awk
fd

← awk fd→

最近更新
01
Android 端口转发(Forward & Reverse) 的实操与避坑全指南
04-29
02
VisiData 终极生存指南(vd)
04-27
03
macOS 定时任务实现:Git 仓库状态自动同步方案
04-26
更多文章>
Theme by Vdoing | Copyright © 2019-2026 Jacky | MIT License
  • 跟随系统
  • 浅色模式
  • 深色模式
  • 阅读模式