Crate skim

Crate skim 

Source
Expand description

Skim is a fuzzy finder library for Rust.

It provides a fast and customizable way to filter and select items interactively, similar to fzf. Skim can be used as a library or as a command-line tool.

§Examples

use skim::prelude::*;
use std::io::Cursor;

let options = SkimOptionsBuilder::default()
    .height(Some("50%"))
    .multi(true)
    .build()
    .unwrap();

let input = "awk\nbash\ncsh\ndash\nfish\nksh\nzsh";
let item_reader = SkimItemReader::default();
let items = item_reader.of_bufread(Cursor::new(input));

let output = Skim::run_with(&options, Some(items)).unwrap();

Re-exports§

pub use crate::item::RankCriteria;
pub use crate::options::SkimOptions;

Modules§

binds
Key binding configuration and parsing.
completions
Provides helpers to easily generate shell completions
field
Field extraction and parsing utilities.
fuzzy_matcher
Fuzzy matching algorithms and implementations.
helper
Skim helpers
item
Item representation and management.
options
Configuration options for skim.
prelude
Convenience re-exports of commonly used types.
reader
Reader is used for reading items from datasource (e.g. stdin or command output)
spinlock
SpinLock implemented using AtomicBool Just like Mutex except:
tmux
Tmux integration utilities.
tui
Terminal UI components and rendering.

Macros§

exhaustive_match
Macro for exhaustive matching that ensures all enum variants are covered

Structs§

DisplayContext
Context information for displaying an item
MatchResult
Result of matching a query against an item
PreviewContext
Context information for generating item previews
PreviewPosition
Position and scroll information for preview display
Skim
Main entry point for running skim
SkimOutput
Output from running skim, containing the final selection and state

Enums§

CaseMatching
Case sensitivity mode for matching
FuzzyAlgorithm
Fuzzy matching algorithm to use
ItemPreview
Defines how an item should be previewed
MatchRange
Represents the range of a match in an item
Matches
Represents how a query matches an item

Traits§

AsAny
Trait for downcasting to concrete types from trait objects
MatchEngine
A matching engine that can match queries against items
MatchEngineFactory
Factory for creating match engines
Selector
A selector that determines whether an item should be “pre-selected” in multi-selection mode
SkimItem
A SkimItem defines what’s been processed(fetched, matched, previewed and returned) by skim

Type Aliases§

Rank
Rank tuple used for sorting match results
SkimItemReceiver
Receiver for streaming items to skim
SkimItemSender
Sender for streaming items to skim