Coder Social home page Coder Social logo

zsh-histdb-skim's Introduction

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, at:main

It downloads the binary (if available) automatically. You can do manually by calling histdb-skim-download. It will be saved in ${XDG_DATA_HOME}/zsh-histdb-skim, alternatively ${HOME}/.local/share/zsh-histdb-skim. You can specify the directory manually by setting HISTDB_SKIM_PATH.

The download will happen if the executable is not there or the version is outdated (starting from v0.7.0). These checks happen when sourcing the script.

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

Additional information

By default the binary is downloaded

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.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.