← 返回命令列表

Linux command

sk 命令

文本

复制后可按需替换文件名、目录或参数。

常用示例

Start skim

sk

Find files

sk | xargs [vim]

Search with a preview

sk --preview '[cat {}]'

Enable multi-select

sk -m

Use as interactive command filter

sk -i -c '[rg --color=always {}]'

Pipe command output

[ls -la] | sk

Search with regex

sk --regex

Generate shell completions

sk --shell [bash]

说明

sk (skim) is a fast fuzzy finder written in Rust, serving as an alternative to fzf. It provides an interactive interface for filtering and selecting items from any list, making it ideal for file selection, command history search, and process management. Search syntax supports AND (space-separated terms), OR (pipe-separated with spaces), exact match (prefix with '), and negation (prefix with !). For example, src main finds items containing both terms, while .md$ | .markdown$ matches either extension. The -i flag enables interactive mode where the command specified with -c is re-executed as you type. The --preview option shows a preview of the currently highlighted item, useful for viewing file contents or command help. Skim can be used as a Rust library as well as a standalone binary, enabling integration into other Rust applications.

参数

-m
Enable multi-select mode; press TAB to select multiple items
-i
Interactive mode; re-execute command as query changes
-c _command_
Command to execute; {} is replaced with current query
--ansi
Parse and display ANSI color codes in input
--regex
Use regex patterns instead of fuzzy matching
--preview _command_
Display preview of selected item; {} is replaced with item
--preview-window _opts_
Configure preview pane (position, size, border)
--bind _key:action_
Bind key to action; multiple bindings comma-separated
--color _scheme_
Color scheme: dark, light, 16, bw, none, molokai
--tiebreak _criteria_
Sorting criteria: score, index, begin, end, length
--shell _shell_
Generate completions for bash, zsh, fish, powershell, elvish
-q, --query _string_
Start with initial query string
--height _lines_
Display height in lines or percentage
--reverse
Reverse layout (prompt at top)

FAQ

What is the sk command used for?

sk (skim) is a fast fuzzy finder written in Rust, serving as an alternative to fzf. It provides an interactive interface for filtering and selecting items from any list, making it ideal for file selection, command history search, and process management. Search syntax supports AND (space-separated terms), OR (pipe-separated with spaces), exact match (prefix with '), and negation (prefix with !). For example, src main finds items containing both terms, while .md$ | .markdown$ matches either extension. The -i flag enables interactive mode where the command specified with -c is re-executed as you type. The --preview option shows a preview of the currently highlighted item, useful for viewing file contents or command help. Skim can be used as a Rust library as well as a standalone binary, enabling integration into other Rust applications.

How do I run a basic sk example?

Run `sk` in a terminal, then adjust file names, paths, flags, or remote targets for your system.

What does -m do in sk?

Enable multi-select mode; press TAB to select multiple items