mirror of
https://github.com/lotabout/skim.git
synced 2026-09-10 07:16:23 -04:00
This PR has grown beyond its initial scope due to me over-optimizing everything, but it leads to:
Paving the way for future actually interactive previews
Consistently better performance than fzf in our bench thanks to thread and concurrency optimizations as well as the use of kanal for the items channels
Given the scope, I'm marking this as breaking because:
setting wrap in the preview window layout disables the pty since we don't want to manipulate the raw buffer to word-wrap it manually
kanal channels work slightly differently and might break library usage, even though switching to them did not require any modifications of the examples so it's unlikely that users will see anything break
* fix: force cwd for preview
* fix: correctly set cwd & kill pty child in the right order
* fix: use std threads & reopen new pty for each preview
* feat: use tui-term for displaying
* feat: scroll in pty
* fix: make nested skim previews work
* fix: clippy mistake
* feat: reactive preview triggering
* chore: generate completions & manpage
* chore: optimizations & thread cleanup
* chore: use kanal for faster channels
* fix: tests
* fix: only send items if the matcher hasn't been killed in the meantime (#947)
* tests: add coverage
* tests: fix bin path with coverage
* tests: upload tests to codecov
* chore: make pty opt-in through preview-window
* chore: generate completions & manpage
---------
Co-authored-by: Skim bot <skim-bot@skim-rs.github.io>
132 lines
7 KiB
Plaintext
132 lines
7 KiB
Plaintext
module completions {
|
|
|
|
def "nu-complete sk tiebreak" [] {
|
|
[ "score" "-score" "begin" "-begin" "end" "-end" "length" "-length" "index" "-index" ]
|
|
}
|
|
|
|
def "nu-complete sk algorithm" [] {
|
|
[ "skim_v1" "skim_v2" "clangd" "frizbee" ]
|
|
}
|
|
|
|
def "nu-complete sk case" [] {
|
|
[ "respect" "ignore" "smart" ]
|
|
}
|
|
|
|
def "nu-complete sk layout" [] {
|
|
[ "default" "reverse" "reverse-list" ]
|
|
}
|
|
|
|
def "nu-complete sk info" [] {
|
|
[ "default" "inline" "hidden" ]
|
|
}
|
|
|
|
def "nu-complete sk border" [] {
|
|
[ "plain" "rounded" "double" "thick" "light-double-dashed" "heavy-double-dashed" "light-triple-dashed" "heavy-triple-dashed" "light-quadruple-dashed" "heavy-quadruple-dashed" "quadrant-inside" "quadrant-outside" ]
|
|
}
|
|
|
|
def "nu-complete sk shell" [] {
|
|
[ "bash" "elvish" "fish" "nushell" "power-shell" "zsh" ]
|
|
}
|
|
|
|
def "nu-complete sk flags" [] {
|
|
[ "no-preview-pty" ]
|
|
}
|
|
|
|
# Fuzzy Finder in rust!
|
|
export extern sk [
|
|
--tac # Show results in reverse order
|
|
--min-query-length: string # Minimum query length to start showing results
|
|
--no-sort # Do not sort the results
|
|
--tiebreak(-t): string@"nu-complete sk tiebreak" # Comma-separated list of sort criteria to apply when the scores are tied.
|
|
--nth(-n): string # Fields to be matched
|
|
--with-nth: string # Fields to be transformed
|
|
--delimiter(-d): string # Delimiter between fields
|
|
--exact(-e) # Run in exact mode
|
|
--regex # Start in regex mode instead of fuzzy-match
|
|
--algo: string@"nu-complete sk algorithm" # Fuzzy matching algorithm
|
|
--case: string@"nu-complete sk case" # Case sensitivity
|
|
--normalize # Normalize unicode characters
|
|
--split-match: string # Enable split matching and set delimiter
|
|
--bind(-b): string # Comma separated list of bindings
|
|
--multi(-m) # Enable multiple selection
|
|
--no-multi # Disable multiple selection
|
|
--no-mouse # Disable mouse
|
|
--cmd(-c): string # Command to invoke dynamically in interactive mode
|
|
--interactive(-i) # Start skim in interactive mode
|
|
-I: string # Replace replstr with the selected item in commands
|
|
--color: string # Set color theme
|
|
--no-hscroll # Disable horizontal scroll
|
|
--keep-right # Keep the right end of the line visible on overflow
|
|
--skip-to-pattern: string # Show the matched pattern at the line start
|
|
--no-clear-if-empty # Do not clear previous line if the command returns an empty result
|
|
--no-clear-start # Do not clear items on start
|
|
--no-clear # Do not clear screen on exit
|
|
--show-cmd-error # Show error message if command fails
|
|
--cycle # Cycle the results by wrapping around when scrolling
|
|
--disabled # Disable matching entirely
|
|
--layout: string@"nu-complete sk layout" # Set layout
|
|
--reverse # Shorthand for reverse layout
|
|
--height: string # Height of skim's window
|
|
--no-height # Disable height (force full screen)
|
|
--min-height: string # Minimum height of skim's window
|
|
--margin: string # Screen margin
|
|
--prompt(-p): string # Set prompt
|
|
--cmd-prompt: string # Set prompt in command mode
|
|
--selector: string # Set selected item icon
|
|
--multi-selector: string # Set selected item icon
|
|
--ansi # Parse ANSI color codes in input strings
|
|
--tabstop: string # Number of spaces that make up a tab
|
|
--info: string@"nu-complete sk info" # Set matching result count display position
|
|
--no-info # Alias for --info=hidden
|
|
--inline-info # Alias for --info=inline
|
|
--header: string # Set header, displayed next to the info
|
|
--header-lines: string # Number of lines of the input treated as header
|
|
--border: string@"nu-complete sk border" # Draw borders around the UI components
|
|
--wrap # Wrap items in the item list
|
|
--history: string # History file
|
|
--history-size: string # Maximum number of query history entries to keep
|
|
--cmd-history: string # Command history file
|
|
--cmd-history-size: string # Maximum number of query history entries to keep
|
|
--preview: string # Preview command
|
|
--preview-window: string # Preview window layout
|
|
--query(-q): string # Initial query
|
|
--cmd-query: string # Initial query in interactive mode
|
|
--read0 # Read input delimited by ASCII NUL(\0) characters
|
|
--print0 # Print output delimited by ASCII NUL(\0) characters
|
|
--print-query # Print the query as the first line
|
|
--print-cmd # Print the command as the first line (after print-query)
|
|
--print-score # Print the score after each item
|
|
--print-header # Print the header as the first line (after print-score)
|
|
--no-strip-ansi # Print the ANSI codes, making the output exactly match the input even when --ansi is on
|
|
--select-1(-1) # Do not enter the TUI if the query passed in -q matches only one item and return it
|
|
--exit-0(-0) # Do not enter the TUI if the query passed in -q does not match any item
|
|
--sync # Synchronous search for multi-staged filtering
|
|
--pre-select-n: string # Pre-select the first n items in multi-selection mode
|
|
--pre-select-pat: string # Pre-select the matched items in multi-selection mode
|
|
--pre-select-items: string # Pre-select the items separated by newline character
|
|
--pre-select-file: string # Pre-select the items read from this file
|
|
--filter(-f): string # Query for filter mode
|
|
--shell: string@"nu-complete sk shell" # Generate shell completion script
|
|
--shell-bindings # Generate shell key bindings - only for bash, zsh and fish
|
|
--man # Generate man page and output it to stdout
|
|
--listen: string # Run an IPC socket with optional name (defaults to sk)
|
|
--remote: string # Send commands to an IPC socket with optional name (defaults to sk)
|
|
--tmux: string # Run in a tmux popup
|
|
--log-file: string # Pipe log output to a file
|
|
--flags: string@"nu-complete sk flags" # Feature flags
|
|
--extended(-x) # Reserved for later use
|
|
--literal # Reserved for later use
|
|
--hscroll-off: string # Reserved for later use
|
|
--filepath-word # Reserved for later use
|
|
--jump-labels: string # Reserved for later use
|
|
--no-bold # Reserved for later use
|
|
--phony # Reserved for later use
|
|
--expect: string # Deprecated, kept for compatibility purposes. See accept() bind instead
|
|
--help(-h) # Print help (see more with '--help')
|
|
--version(-V) # Print version
|
|
]
|
|
|
|
}
|
|
|
|
export use completions *
|