sk(1) General Commands Manual sk(1) (NAME) sk - Rust! (SYNOPSIS) sk [--tac] [--min-query-length] [--no-sort] [-t|--tiebreak] [-n|--nth] [--with-nth] [--hide-nth] [-d|--delimiter] [-e|--exact] [--regex] [--algo] [--case] [--typos] [--no-typos] [--normalize] [--split-match] [--last-match] [--scheme] [-b|--bind] [-m|--multi] [--no-multi] [--no-mouse] [-c|--cmd] [-i|--interactive] [-I ] [--color] [--highlight-line] [--no-hscroll] [--keep-right] [--skip-to-pattern] [--no-clear-if-empty] [--no-clear-start] [--no-clear] [--show-cmd-error] [--cycle] [--disabled] [--disable-pattern] [--layout] [--reverse] [--height] [--no-height] [--min-height] [--margin] [-p|--prompt] [--cmd-prompt] [--selector] [--multi-selector] [--ansi] [--tabstop] [--info] [--no-info] [--inline-info] [--header] [--header-lines] [--border] [--border-no-collapse] [--no-border] [--wrap] [--multiline] [--scrollbar] [--no-scrollbar] [--history] [--history-size] [--cmd-history] [--cmd-history-size] [--preview] [--preview-window] [--image] [-q|--query] [--cmd-query] [--read0] [--print0] [--print-query] [--print-cmd] [--print-score] [--print-header] [--print-current] [--output-format] [--no-strip-ansi] [-1|--select-1] [-0|--exit-0] [--sync] [--pre-select-n] [--pre-select-pat] [--pre-select-items] [--pre-select-file] [-f|--filter] [--shell] [--shell-bindings] [--man] [--listen] [--remote] [--popup] [--log-level] [--log-file] [--expect] [-h|--help] [-V|--version] (OPTIONS) -h, --help ( '-h') -V, --version (SEARCH) --tac --no-sort --min-query-length --no-sort --tac : history | sk --tac --no-sort -t, --tiebreak [: score,begin,end] . * **score**: - (-index) - : o score o -score o begin o -begin o end o -end o length o -length o index o -index o pathname o -pathname -n, --nth [: ] (`[BEGIN]..[END]`). `--nth` `--with-nth` . **:** 1 2 -1 -2 3..5 2.. ..-3 .. --with-nth [: ] nth --hide-nth [: ] **nth** . . . **nth** . -d, --delimiter [: [\t\n ]+] (regex) AWK . \x00 \t \n . -e, --exact --regex regex --algo [: arinae] - arinae (ari) - `skim_v2` skim - clangd clangd - fzy fzy () - frizbee blink.cmp neovim : o arinae: Arinae: o clangd: Clangd o fzy: Fzy () o frizbee: Frizbee o skim_v2: skim ( ) --case [: smart] . : Frizbee : o respect: o ignore: o smart: : --typos [] [: disabled] (--typos) (pattern_length / 4) . ( --typos=2) . --typos=0 . fzy frizbee . --no-typos --normalize / --split-match [...] : foo:bar foo : bar . --last-match . (tiebreak) --scheme [: default] : o default: o path: : pathname o history: : (index) -b, --bind [...] [: ] `--bind` `:` . (trigger) `double-click` (`change` `start` `load` `result` `focus` `zero` `one`) . `act-` `act-up:last`. [KEYBINDS] [Default key bindings] . ****: `sk --bind=ctrl-j:accept,load:last,act-up:down` ## + . ****: `sk --bind 'ctrl-a:select-all+accept'` # `execute(...)` `reload(...)` sk . enter less sk : ```bash sk --bind "enter:execute(less {})" ``` : reload . --preview . `sk` . execute-silent . sk . ( `&`). `if-query-empty` `if-query-not-empty` . : `sk --bind 'ctrl-d:if-query-empty(abort)+delete-char'` skim abort delete-char . 'delete-char/eof' . -m, --multi Tab S-Tab --no-multi --no-mouse -c, --cmd sh -c cmd /c -i, --interactive skim sk --cmd . -I [: {}] replstr --color : [BASE][,COLOR:ANSI[:ATTR1:ATTR2:..]] [THEME] --highlight-line --no-hscroll --keep-right --skip-to-pattern . . rg/grep . : sk -i -c "rg {q} --color=always" --skip-to-pattern '[^/]*:' --ansi --no-clear-if-empty . . `grep` `rg` <<>> . --no-clear-start --no-clear . skim tput rmcup . skim . --show-cmd-error --cycle --disabled --disable-pattern (regex).SH " (LAYOUT)" --layout [: default] : o default: o reverse: o reverse-list: --reverse (reverse) --height [: 100%] skim . (term height - value) . --no-height ( ) --min-height [: 10] skim . . --height . --margin [: 0] : - TRBL - TB,RL - T,RL,B - T,R,B,L : 1,10% -p, --prompt [: > ] (prompt) --cmd-prompt [: c> ] (command mode) --selector [: >] --multi-selector [: >] (DISPLAY) --ansi ANSI skim ansi cmd_collector : use skim::prelude::*; let _options = SkimOptionsBuilder::default() .cmd("ls --color") .cmd_collector(Rc::new(RefCell::new(SkimItemReader::new( SkimItemReaderOption::default().ansi(true), ))) as Rc>) .build() .unwrap(); --tabstop [: 8] (spaces) (tab) --info [: default] - hidden - inline[:SEP] - default - left - right - inline-right[:SEP] --no-info --info=hidden --inline-info --info=inline --header
. --layout --with-nth . ANSI --ansi . --header-lines [: 0] N . --with-nth . --border [...] [: none] : o force-off: no_border o none o plain o rounded o double o thick o light-double-dashed o heavy-double-dashed o light-triple-dashed o heavy-triple-dashed o light-quadruple-dashed o heavy-quadruple-dashed o quadrant-inside o quadrant-outside --border-no-collapse --no-border tmux/zellij --wrap --multiline [] read0 \n \\n ( \n ) . --scrollbar [: ] --no-scrollbar --popup [...] tmux zellij : `sk --popup [,SIZE[%]][,SIZE[%]]` : Zellij Tmux `skim` Zellij Tmux .SH " (HISTORY)" --history . CTRL-N CTRL-P next-history previous-history . --history-size [: 1000] --cmd-history . CTRL-N CTRL-P next-history previous-history . --cmd-history-size [: 1000] (PREVIEW) --preview `sh -c` `cmd /c` . `{}` ( ) . ( FIELD INDEX EXPRESSION ). ****: ```bash sk --preview='head -$LINES {}' ls -l | sk --preview="echo user={3} when={-4..-2}; cat {-1}" --header-lines=1 --preview-window [: right:50%] : [up|down|left|right][:SIZE][:hidden][:[no]wrap][:[no]pty][:+SCROLL[-OFFSET]] . :hidden toggle-preview . . (Line wrap) :wrap . :pty PTY . : wrap PTY ( ) . SIZE : - 0 - ( 20) - ( 50%) - +SCROLL[-OFFSET] . SCROLL . -OFFSET . (-INTEGER) (-/INTEGER) . : # sk --preview="head {}" --preview-window=up:30% sk --preview="file {}" --preview-window=down:2 # # git grep (-5) git grep --line-number '' | sk --delimiter: --preview 'nl {1}' --preview-window +{2}-5 # bat (-/2) git grep --line-number '' | sk --delimiter : \ --preview 'bat --style=numbers --color=always --highlight-line {2} {1}' \ --preview-window +{2}-/2 --image [...] . detect backend . halfblocks halfblocks . : backend (pipe) skim find . -type f | sk --image SKIM_DEFAULT_COMMAND="find . -type f" sk --image . : o detect: : backend o halfblocks: halfblocks (SCRIPTING) -q, --query --cmd-query --read0 ASCII NUL(\0) --print0 ASCII NUL(\0) --print-query --print-cmd ( print-query) --print-score --print-header ( print-score) --print-current () ( print-header) --output-format print_ . preview . --no-strip-ansi ANSI --ansi -1, --select-1 (TUI) -q -0, --exit-0 (TUI) -q --sync . skim TUI : sk --multi | sk --sync --pre-select-n [: 0] n --pre-select-pat [: ] : https://docs.rs/regex/1.4.1/regex --pre-select-items [: ] (newline) : 'item1\nitem2' --pre-select-file -f, --filter (filter) --shell (completion) : bash zsh fish . (source) . : source <(sk --shell bash) ( ) sk --shell bash >> ~/.bash_completion ( ) : bash, zsh, fish, powershell, elvish : o bash: Bourne Again SHell o elvish: Elvish o fish: Friendly Interactive SHell o nushell: Nushell (nu) o power-shell: PowerShell o zsh: Zsh --shell-bindings - bash zsh fish shell --man (man page) stdout --listen [...] IPC ( sk ) (Actions) Ron ( Rust) ./src/tui/event.rs . --remote --remote [...] IPC ( sk ) stdin bind . + . --log-level (log level) --log-file .SH " (DEPRECATED)" --expect [: ] . ()accept . (MODES) (Normal mode) sk stdin . (Interactive mode) . `--interactive` ( `-i`) `toggle-interactive` (: ) . `--cmd` . : `sk --cmd 'rg {} --color=always' --interactive` `rg` . (SEARCH) skim << >> (`extended search`) . : `^test rs$ | sh$` test rs sh . AND () 'and' . OR (|) 'or' . (') `'` sk . `--exact` . `'` . (^|$) `^` ( `$`) sk ( ). (!) `!` sk . (KEYBINDS) `--bind` `:[+action2]` . (trigger) . `reload(ls)` `reload:ls` . ( ) * ctrl-[a-z] * ctrl-space * ctrl-alt-[a-z] * alt-[a-zA-Z] * alt-[0-9] * f[1-12] * enter * space * bspace (bs) * alt-up * alt-down * alt-left * alt-right * alt-enter * alt-space * alt-bspace (alt-bs) * alt-/ * tab * btab (shift-tab) * esc * del * up * down * left * right * home * end * pgup * pgdn * shift-up * shift-down * shift-left * shift-right * alt-shift-up * alt-shift-down * alt-shift-left * alt-shift-right * double-click * * change: (query) * start: skim * load: reader matcher reload * result: ( ) * focus: * zero: * one: (Actions as binding triggers) (binding triggers) . . `act-` `act-up:last` . (`noremap`) : . `suppress` : `act-up:suppress+down`. (Actions) * abort: * accept(...): . . * add-char(...): * append-and-select: * backward-char: * backward-delete-char: * backward-delete-char/eof: * backward-kill-word: * backward-word: * beginning-of-line: * bind(...): . `trigger:action[+action]` `--bind` `act-up:last` . * cancel: * clear-screen: * delete-char: * delete-char/eof: * deselect-all: * down(...): N * end-of-line: * execute(...): . COMMAND EXPANSION . * execute-silent(...): . COMMAND EXPANSION . * first: * forward-char: * forward-word: * if-query-empty(...): * if-query-not-empty(...): * if-non-matched(...): * ignore: * kill-line: * kill-word: * last: * next-history: ( `--history` `--cmd-history`) * half-page-down(...): * half-page-up(...): * page-down(...): * page-up(...): * preview-up(...): * preview-down(...): * preview-left(...): * preview-right(...): * preview-page-up(...): * preview-page-down(...): * previous-history: ( `--history` `--cmd-history`) * redraw: * refresh-cmd: * refresh-preview: * restart-matcher: (matcher) * reload(...): * rotate-mode: * scroll-left(...): * scroll-right(...): * select-all: * select-row(...): * select: * suppress: . ( `act-up:suppress`) : . ( `ignore`) . * set-cmd(...): (interactive-mode) . COMMAND EXPANSION . * set-header(...): ( ) * set-preview-cmd(...): . COMMAND EXPANSION . * set-query(...): . COMMAND EXPANSION . * toggle: * toggle-all: * toggle-in: * toggle-interactive: * toggle-out: * toggle-preview: * toggle-preview-wrap: * toggle-sort: * top: ( First) * unbind(...): . ( `act-up`) . * unix-line-discard: ( ) * unix-word-rubout: ( ) * up(...): N * yank: (paste) * alt-b: backward-word * alt-bspace: backward-kill-word * alt-d: kill-word * alt-f: forward-word * alt-h: scroll-left * alt-l: scroll-right * bspace: backward-delete-char * btab: toggle+up * ctrl-a: beginning-of-line * ctrl-b: backward-char * ctrl-c: abort * ctrl-d: abort * ctrl-e: end-of-line * ctrl-f: forward-char * ctrl-g: abort * ctrl-h: backward-delete-char * ctrl-j: down * ctrl-k: up * ctrl-l: clear-screen * ctrl-left: backward-word * ctrl-n: down * ctrl-p: up * ctrl-q: toggle-interactive * ctrl-r: rotate-mode * ctrl-right: forward-word * ctrl-u: unix-line-discard * ctrl-w: unix-word-rubout * ctrl-y: yank * del: delete-char * double-click: accept * down: down * end: end-of-line * enter: accept * esc: abort * home: beginning-of-line * left: backward-char * pgdn: page-down * pgup: page-up * right: forward-char * shift-btab: toggle+up * shift-down: preview-down * shift-home: beginning-of-line * shift-left: backward-word * shift-right: forward-word * shift-tab: toggle+up * shift-up: preview-up * tab: toggle+down * up: up (COMMAND EXPANSION) `preview` `execute` `reload` `set-query`... sk : * {} ( --replstr ) . * {q} ( {cq} ) . * {+} multi-select single-select . * {n} (index) . * {+n} () () {+} . * {FIELD_INDEX_EXPRESSION} . * {+FIELD_INDEX_EXPRESSION} () {+} . skim {..} . `--delimiter|-d` ( ). * `{n}` n- . * `{n..m}` n m ( ) . * `{-n}` n- -1 . (ENVIRONMENT VARIABLES) SKIM_DEFAULT_COMMAND (pipe) skim . `find .` `dir /s /b /A:-D` . SKIM_DEFAULT_OPTIONS . : `--reverse --multi` SKIM_OPTIONS_FILE . `#` () `##` (escape) . : ``` # Preview --preview 'echo {}' --preview-window 'left:30%' # Preview window --reverse --prompt '## ' ``` NO_COLOR (THEME) : * none: * molokai: molokai * light: * 16: base16 * bw: * dark | default: * catppuccin: * catppuccin-latte * catppuccin-macchiato * catppuccin-frappe * catppuccin-mocha : * normal ( ): * matched ( hl): * current ( fg+): * bg+: ( ) * current_match ( hl+): * query: * spinner: / (spinner) * info: ( ) * prompt: (prompt) * cursor ( pointer): / * selected ( marker): * header: * border: * scrollbar: `-fg` `_fg` `-bg` `_bg` `-underline` `_underline` . `normal-fg` ( `fg`) . : * 0-255: ANSI * #rrggbb: (attrs) : * x | regular: * b | bold * u | underline * c | crossed-out * d | dim * i | italic * r | reverse : `--color '16,normal-fg:0+bold,matched-fg:#ffffff+u,cursor-bg:#deadbe'` base 16 ANSI 0 () ffffff ( ) #deadbe ( ) . skim `--listen` ( `--remote`) . `sk --listen optional_address` ( `sk` ). . `sk --remote optional_address` `socat` : `echo 'ToggleIn' | socat -u STDIN ABSTRACT-CONNECT:optional_address`. (Actions) skim Ron . `sk --remote` (pipe) ( KEYBINDS ) : `echo 'up+select-row' | sk --remote optional_address` (EXIT CODES) * 0: * 1: * 130: (ctrl-c esc) * : (VERSION) v5.6.7 sk 5.6.7 sk(1)