A zsh histb browser using skim. Implemented in rust.

Overview

zsh-histdb-skim

This is a reimplementation of https://github.com/m42e/zsh-histdb-fzf in rust and using skim as a library.

Why

zsh-histdb-fzf works, but it is a bit quirky. It has for sure some flaws, regarding responsiveness and communication with processes. skim offers a fzf like behavior and is available as library in rust. It lacks some highlighting in the header, and has a bit different order/matching algorithm.

This should result in better performance, responsiveness and a more stable behavior.

Why rust?

skim is available in rust. I have never tried rust with a purpose before. I wanted to give it a try and learn something new.

How it works

Well, it accesses the zsh histdb. It lets you search on different levels.

What do you have to do?

Install the plugin, e.g. using zplug.

  zplug 'm42e/zsh-histdb-skim', from:github, use:zsh-histdb-skim.zsh, at:main

It downloads the binary (if available) automatically. You can do manually by calling histdb-skim-download.

The plugin calls bindkey but some other plugins may overwrite. In this case you would have to do it yourself:

bindkey '^R' histdb-skim-widget

Building

cargo build --release
mkdir -p bin
mv target/release/zsh-histdb-skim bin

TODO

  • improve rust code

Apologies 😉

While I stole the idea from myself, this is my first rust project ever. So I would be glad for tips and improvement PRs.

Comments
  • Results are much worse than zsh-histdb-fzf

    Results are much worse than zsh-histdb-fzf

    zsh-histdb-skim finds results that fit much less well first before the results I want. For example, in a search for ls -alh the results are:

    fzf: "14/04/2022 ls data/artifacts/SplitDatasetArtifact -alh" skim: "14/04 cargo fmt --all --features sqlite -- -- check"

    The reason seems to be the .nosort(true) option in main.rs. Removing that option, the results are much better

    opened by phiresky 4
  • Commit Cargo.lock

    Commit Cargo.lock

    Just tried to build this within nix using rustPlatform.buildRustPackage and that failed because the Cargo.lock is missing. I saw that you removed the Cargo.lock, though I don't know why. Here it is recommended to commit the Cargo.lock

    opened by SrTobi 3
  • compatibility with more plugin systems

    compatibility with more plugin systems

    could you rename the main script to zsh-histdb-skim.plugin.zsh? then more plugin systems can detect it.

    thanks

    (even for zplug, it should make the install command shorter)

    opened by phiresky 2
  • Automatic download fails when installing system-wide

    Automatic download fails when installing system-wide

    First I'd like to thank you for this amazing plugin, you saved me some hours writing a proper histdb integration myself :D

    I've installed this plugin system wide to /usr/share/zsh/zsh-histdb-skim/, which unfortunately causes my regular user to try downloading the binary to that directory. I believe it would be far better if your program would store the binary in the proper XDG directory in the user's home. So in bash/zsh syntax this would be ${XDG_DATA_HOME:-$HOME/.local/share}/zsh-histdb-skim/.

    If i'm not mistaken, the binary will also never be updated once it exists, correct? How are you planning on automatically delivering updates?

    opened by oddlama 1
  • add vendored script

    add vendored script

    When packaged by a package manager, it's not ideal to support automatic updating. Ship an additional file that can be used

    • without the support of autoupdate / autofetch
    • with the binary simply expected to exist somewhere in $PATH.
    opened by sielicki 0
  • hardcode arm64 to use darwin-x64 binary

    hardcode arm64 to use darwin-x64 binary

    trying to install this on my m1 mac and found it doesn't work by default but I found I can still run the darwin-x64 binary, so just adding this as a temporary solution until you have an arm64 binary 😆

    opened by 0x01BF52 0
Releases(v0.8.1)
Owner
Matthias Bilger
vim, Coding, Coaching, Movies, Series, Diving, Archery, Cars, DnD, try something new :)
Matthias Bilger
🌲 Open the current remote repository in your browser

gitweb Some of the flags and options are subject to change in the future. Ideas are welcome. Ideas are bulletproof (V). gitweb is a command line inter

Yoann Fleury 26 Dec 17, 2022
Searchbuddy is a browser extension that lets you chat with people that are searching for what you're searching for.

searchbuddy Make friends while searching! Searchbuddy is a browser extension that lets you chat with people that are searching for what you're searchi

Joseph Gerber 14 May 23, 2022
Keyboard firmware implemented in Rust

flutterby-rs Keyboard firmware implemented in Rust. It doesn't do anything useful yet! Building for atmega32u4 devices (ergodox-ez, feather32u4) First

Wez Furlong 26 Dec 31, 2022
The Roguelike Toolkit (RLTK), implemented for Rust.

The Roguelike Toolkit (RLTK), implemented for Rust.

Amethyst Foundation 1.1k Jan 6, 2023
Arduino Uno 9 axis acceleration sensor (BMX055) reader implemented in Rust.

Arduino Uno Accelaration reader in Rust Components Arduino Uno (Probably possible with other AVR microcontrollers) BMX055 (Japanese website) Datasheet

Katsu Uchiyama 3 Dec 15, 2022
This is a Pomodoro Clock implemented as a Zellij plugin.

Pomodoro Clock This is a Pomodoro Clock implemented as a Zellij plugin. It shows a Pomodoro time as well as current date time. Prerequisite You must i

Tw 15 Nov 14, 2022
An ND812 decoder implemented as part of the yaxpeax project

yaxpeax-nd812 an ND812 decoder implemented as part of the yaxpeax project, including traits provided by yaxpeax-arch. the ND812 is a 12-bit microcompu

iximeow 1 Jan 22, 2022
Garden monitoring system using m328p Arduino Uno boards. 100% Rust [no_std] using the avr hardware abstraction layer (avr-hal)

uno-revive-rs References Arduino Garden Controller Roadmap uno-revive-rs: roadmap Components & Controllers 1-2 Uno R3 m328p Soil moisture sensor: m328

Ethan Gallucci 1 May 4, 2022
k-mer counter in Rust using the rust-bio and rayon crates

krust is a k-mer counter written in Rust and run from the command line that will output canonical k-mers and their frequency across the records in a f

null 14 Jan 7, 2023
🦀 Rust-based implementation of a Snowflake Generator which communicates using gRPC

Clawflake Clawflake is a Rust application which implements Twitter Snowflakes and communicates using gRPC. Snowflake ID numbers are 63 bits integers s

n1c00o 5 Oct 31, 2022
A pure Rust PLONK implementation using arkworks as a backend.

PLONK This is a pure Rust implementation of the PLONK zk proving system Usage use ark_plonk::prelude::*; use ark_ec::bls12::Bls12; use rand_core::OsRn

rust-zkp 201 Dec 31, 2022
This crate allows you to safely initialize Dynamically Sized Types (DST) using only safe Rust.

This crate allows you to safely initialize Dynamically Sized Types (DST) using only safe Rust.

Christofer Nolander 11 Dec 22, 2022
A working example of multi targets compilation for Rust using Github Actions.

A working example of multi targets compilation for Rust using Github Actions. Supports Windows, MacOSX, x86_64, ARM and Raspberry PI Linux.

Nicolas Vanhoren 41 Dec 17, 2022
Cookiecutter templates for Serverless applications using AWS SAM and the Rust programming language.

Cookiecutter SAM template for Lambda functions in Rust This is a Cookiecutter template to create a serverless application based on the Serverless Appl

AWS Samples 24 Nov 11, 2022
Universal changelog generator using conventional commit+ with monorepo support. Written in Rust.

chlog Universal changelog generator using conventional commit+ with monorepo support. chlog can generate the changelog from the conventional commits w

Jeff Yang 3 Nov 27, 2022
Sketches I created using Rust + Nannou

Sketches Motivation I have followed generative artists like Ben Kovach and Tyler Hobbs for a while, and their artwork is truly impressive. Check them

Franklin van Nes 4 Jun 11, 2022
Rust library to detect bots using a user-agent string

Rust library to detect bots using a user-agent string

Bryan Morgan 8 Dec 21, 2022
Image optimization using Rust and Vips 🦀

Huffman Image optimization using Rust and Libvips. Requirements You must have the following packages installed before getting started Rust Vips pkg-co

ChronicleHQ 4 Nov 3, 2022
Rust crate for creating filters with DirectX shaders. Includes Scale, Color conversion using DirectX api.

DxFilter Scale and ColorConversion done with DirectX filters. You can also create your own filters with the provided api. Crate contains various tools

null 4 Aug 13, 2022