百科.dev
全部条目在线工具AI 编程趋势榜开源项目技术资讯提交条目
登录
< 返回工具列表
S

skim

> 编程语言
开源

Rust 中的模糊查找器!

6.9K stars0 点赞0 次浏览
访问官网GitHub

工具介绍

Rust 中的模糊查找器!

Life is short, skim!

We spend so much of our time navigating through files, lines, and commands. That's where Skim comes in! It's a powerful fuzzy finder designed to make your workflow faster and more efficient. Skim provides a single executable called sk. Think of it as a smarter alternative to tools like grep - once you try it, you'll wonder how you ever lived without it!

Table of contents

  • Installation
    • Package Managers
    • Manually
  • Usage
    • As Vim plugin
    • As filter
    • As Interactive Interface
    • Shell Bindings
    • Key Bindings
    • Search Syntax
    • exit code
  • Tools compatible with skim
    • fzf-lua neovim plugin
    • nu_plugin_skim
  • Customization
    • Keymap
    • Sort Criteria
    • Color Scheme
    • Misc
  • Advanced Topics
    • Interactive mode
      • How does it work?
    • Executing external programs
    • Algorithms
    • Preview Window
      • How does it work?
    • Fields support
    • Use as a library
    • Benchmarks
  • FAQ
    • How to ignore files?
    • Some files are not shown in Vim plugin
  • Differences from fzf
  • How to contribute
    • Windows compatibility testing
  • Troubleshooting
    • No line feed issues with nix, FreeBSD, termux

Installation

The skim project contains several components:

  1. sk executable - the core program
  2. Vim/Nvim plugin - to call sk inside Vim/Nvim. Check skim.vim for Vim support.

Package Managers

OS Package Manager Command
macOS Homebrew brew install sk
macOS MacPorts sudo port install skim
Alpine apk apk add skim
Arch pacman pacman -S skim
Fedora COPR see below
Gentoo Portage emerge --ask app-misc/skim
Guix guix guix install skim
Void XBPS xbps-install -S skim
Windows winget winget install skim
Windows Scoop scoop install skim
Debian/Ubuntu apt see below
Fedora/RHEL dnf see below

Debian/Ubuntu

A custom APT repository is available and updated automatically during each release:

  1. Import the signing key

With wget:

bash
sudo mkdir -p /etc/apt/keyrings
sudo wget -O /etc/apt/keyrings/skim.asc https://skim-rs.github.io/skim/apt/skim-archive-keyring.asc

Or with cURL:

bash
sudo mkdir -p /etc/apt/keyrings
curl -fsSL https://skim-rs.github.io/skim/apt/skim-archive-keyring.asc | sudo tee /etc/apt/keyrings/skim.asc > /dev/null
  1. Add the repository
bash
echo 'deb [signed-by=/etc/apt/keyrings/skim.asc] https://skim-rs.github.io/skim/apt ./' | sudo tee /etc/apt/sources.list.d/skim.list
sudo apt-get update
  1. Install
bash
sudo apt-get install skim

Alternatively, .deb packages are attached directly to every release. Download the one matching your architecture and run sudo dpkg -i skim_*_amd64.deb

Fedora/RHEL

Up-to-date Fedora/RHEL packages are provided via an unofficial community-maintained COPR repository.

bash
sudo dnf copr enable sisyphus1813/skim
sudo dnf install skim

Alternatively, .rpm packages are attached directly to every release. Download it and run sudo rpm -i skim-*.x86_64.rpm

Manually

Any of the following applies:

  • Using the install script:
    bash
    # Always check the content of the script before running it !
    $ curl --proto '=https' --tlsv1.2 -LsSf https://github.com/skim-rs/skim/releases/latest/download/skim-installer.sh | sh
  • Using Binary: Simply download the sk executable directly.
  • Install from crates.io: cargo install skim
  • Build Manually:
    bash
    $ git clone --depth 1 [email protected]:skim-rs/skim.git ~/.skim
    $ cd ~/.skim
    $ cargo build --release
    $ # Add the resulting `target/release/sk` executable to your PATH

You will then have access to:

  • The man page, which you can either write to the correct path or run man --local-file <(sk --man)
  • The shell completions (and optional keybinds), using source <(sk --shell \<shell> \[--shell-bindings]), see below for details

Usage

Skim can be used either as a general filter (similar to grep) or as an interactive interface for running commands.

As Vim plugin (on neovim, checkout fzf-lua with the skim profile)

Via vim-plug (recommended):

Install skim, then :

vim
Plug 'skim-rs/skim'

As filter

Here are some examples to get you started:

bash
# directly invoke skim
sk

# Or pipe some input to it (press TAB key to select multiple items when -m is enabled)
vim $(find . -name "*.rs" | sk -m)

This last command lets you select files with the ".rs" extension and opens your selections in Vim - a great time-saver for developers!

As Interactive Interface

skim can invoke other commands dynamically. Normally you would want to integrate it with grep, ack, ag, or rg for searching contents in a project directory:

bash
# works with grep
sk --ansi -i -c 'grep -rI --color=always --line-number {q} .'
# works with ack
sk --ansi -i -c 'ack --color {q}'
# works with ag
sk --ansi -i -c 'ag --color {q}'
# works with rg
sk --ansi -i -c 'rg --color=always --line-number {q}'

Note: In these examples, {q} will be literally expanded to the current input query (wrapped in single quotes). This means these examples will search for the exact query string, not fuzzily. For fuzzy searching, pipe the command output into sk without using interactive mode.

Shell Bindings

Bindings for Fish, Bash and Zsh are available in the shell directory:

  • completion.{shell} contains the completion scripts for sk cli usage
  • key-bindings.{shell} contains key-binds and shell integrations:
    • ctrl-t to select a file through sk
    • ctrl-r to select an history entry through sk
    • alt-c to cd into a directory selected through sk
    • (not available in fish) ** to complete file paths, for example ls **<tab> will show a sk widget to select a folder

To enable these features, source the key-bindings.{shell} file and set up completions according to your shell's documentation or see below.

Shell Completions

You can generate shell completions for your preferred shell using the --shell flag with one of the supported shells: bash, zsh, fish, powershell, or elvish:

Option 1: Source directly in your current shell session

bash
# For bash
source <(sk --shell bash)

# For zsh
source <(sk --shell zsh)

# For fish
sk --shell fish | source

Option 2: Save to a file to be loaded automatically on shell startup

bash
# For bash, add to ~/.bashrc
echo 'source <(sk --shell bash)' >> ~/.bashrc  # Or save to ~/.bash_completion

# For zsh, add to ~/.zshrc
sk --shell zsh > ~/.zfunc/_sk  # Create ~/.zfunc directory and add to fpath in ~/.zshrc

# For fish, add to ~/.config/fish/completions/
sk --shell fish > ~/.config/fish/completions/sk.fish

Key Bindings

Some commonly used key bindings:

Key Action
Enter Accept (select current one and quit)
ESC/Ctrl-G Abort
Ctrl-P/Up Move cursor up
Ctrl-N/Down Move cursor Down
TAB Toggle selection and move down (with -m)
Shift-TAB Toggle selection and move up (with -m)

For a complete list of key bindings, refer to the man page (man sk).

Search Syntax

skim borrows fzf's syntax for matching items:

Token Match type Description
text fuzzy-match items that match text
^music prefix-exact-match items that start with music
.mp3$ suffix-exact-match items that end with .mp3
'wild exact-match (quoted) items that include wild
!fire inverse-exact-match items that do not include fire
!.mp3$ inverse-suffix-exact-match items that do not end with .mp3

skim also supports the combination of tokens.

  • Whitespace has the meaning of AND. With the term src main, skim will search for items that match both src and main.

  • | means OR (note the spaces around |). With the term .md$ | .markdown$, skim will search for items ends with either .md or .markdown.

  • OR has higher precedence. For example, readme .md$ | .markdown$ is interpreted as readme AND (.md$ OR .markdown$).

  • When using the --split-match option, each part around spaces or | will be matched in a split way:

    • If the option's value (defaulting to :) is absent from the query, do a normal match
    • If it is present, match everything before to everything before it in the items, and everything after it (including potential other occurrences of the delimiter) to the part after it in the items. This is particularly useful when piping in input from rg to match on both file name and content.

If you prefer using regular expressions, skim offers a regex mode:

bash
sk --regex

You can switch to regex mode dynamically by pressing Ctrl-R (Rotate Mode).

exit code

Exit Code Meaning
0 Exited normally
1 No Match found
130 Aborted by Ctrl-C/Ctrl-G/ESC/etc...

Tools compatible with skim

These tools are or aim to be compatible with skim:

fzf-lua neovim plugin

A [

Issues· 5 开放

查看全部 Issues在 GitHub 打开
  • #1174

    对 `--preview` 执行不终止的命令,如 fzf 中

    更新于 2026年9月22日
  • #628

    与 FZF 功能的兼容性现状

    更新于 2026年7月21日
  • #459

    为 nushell 添加绑定

    help neededfeature-requestquick-win更新于 2026年7月18日
  • #499

    支持 OSC8 超链接

    feature-requestwaiting-for-upstream:ratatui更新于 2026年6月19日
  • #1011

    skim 的标志/图标

    更新于 2026年3月24日

> 标签

Rustfuzzyfinderrustskim

暂无评论,来聊聊你的看法吧

> 工具信息

发布日期2026年8月1日
最后更新2026年9月23日
分类编程语言
定价开源

> 相关工具

T
TypeScript
JavaScript 的超集,为前端与全栈提供静态类型
P
Python
通用编程语言,广泛用于 Web、数据与 AI
G
Go
Google 推出的简洁高效系统语言