• Stars
    star
    605
  • Rank 74,072 (Top 2 %)
  • Language
    Rust
  • License
    Apache License 2.0
  • Created about 4 years ago
  • Updated 3 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

🛰 A high performance code minimap render.

🛰 code-minimap

A high performance code minimap render.

CICD License Version Platform

This tool is for generating text minimaps at 🚀 speed. You can use it to implement IDE-like minimap plugin for a terminal text editor, minimap.vim for example.

Features

Usage

$ code-minimap src/core.rs -H 0.6 -V 0.5
⣿⣿⣿⣿⣿⠿⠛⠓⠒⠒⠂
⣉⣿⣿⣿⣟⣛⣛⣛⠒⠒⠂
⠀⠉⣿⣿⣿⣿⠭⠭⠭⠭⠤⠤⠤⠤⠤
⠀⠉⠛⠻⢿⣿⣿⣿⣿⣶⣶⣶⣒⣒⣒⣒⣒⣒⣀⣀⣀⣀⣀⣀⣀⣀⣀⡀
⠀⣀⣶⣾⣿⣿⣿⣿⣭⣭⣭⣤⣤⣤⣤⣤⠤⠤⠤⠤⠤
⣿⣿⣿⣶⡒⠒⠒⠒
⣿⣿⣶⣶⣶⣶⣶⣶⣤⣤⣤⣤⣤⣤⣤⣤⣄
⣭⣭⣭⣭⠭⠭⠭⠭⠉⠉⠉⠉⠉⠉⠉⠉⠉⠉⠉⠉⠉⠉⠉⠉⠉⠉⠉⠉⠉⠉⠉⠉
⣿⣿⣿⣿⣧⣤⣤⣤⣀⣀⣀⣀⣀⣀⣀⣀⣀⣀⣀⣀⣀⣀⡀
⣛⣿⣿⣿⣟⣛⣒⣒⠂
⣀⣛⣛⣛⣛⣛⣛⣛⣛⣛⣛⣛⣛⣛⣛⣛⣋⣀⣀⣀⣀⣀⣀⣀⣀⣀⣀⣀⣀⣀⣀⣀⣀⣀⣀⡀
⠀⣤⣭⣽⣿⣷⣶⣶⣶⠶⠶⠶⠶⠶⠶⠶⠶⠶⠶⠶⠶⠒⠒⠒⠒⠒
⠀⠶⠿⠿⠿⠿⠿⠿⠿⠿⠿⠿⠿⠿⠿⠿⠿⠛⠓⠒⠒⠒⠒⠒
⣉⣛⣛⣛⣛⣛⣛⣛⣛⣛⣛⣛⡛⠛⠛⠛⠛
⠒⣶⣶⣶⣶⣶⣶⣶⣶⣶⣶⣤⣤⣤⣤⣤⣤⣤⣤⣤⣤⣤⣤⣤⣤⣤⣤⣤⣤⣤⣤⣤⣤⣤⡄
⠀⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⡇
⠄⠛⠛⠛⠛⠛⠛⠛⠛⠛⠛⠛⠛⠛⠛⠛⠛⠛⠛⠛⠛⠛⠛⠛⠛⠛⠛⠛⠛⠛⠛⠛⠛⠛⠃

Run code-minimap --help to view detailed usage.

Installation

On Linux

Arch Linux

code-minimap is available in the Arch User Repository. To install it from AUR:

yay -S code-minimap
Gentoo

code-minimap is available in the the GURU project repository:

emerge --ask code-minimap

On macOS

You can install code-minimap with Homebrew:

brew install code-minimap

or with MacPorts:

sudo port install code-minimap

On Windows

You can install code-minimap with scoop:

scoop bucket add extras
scoop install code-minimap

From binaries

Prebuilt versions of code-minimap for various architectures are available at Github release page.

Note that you can try the musl version (which is statically-linked) if runs into dependency related errors.

From source

code-minimap is also published on crates.io. If you have the latest Rust toolchains installed you can use cargo to install it from source:

cargo install --locked code-minimap

If you want the latest version, clone this repository and run cargo build --release.

Benchmark

$ hyperfine -w 10 'code-minimap src/core.rs'
Benchmark #1: code-minimap src/core.rs
  Time (mean ± σ):       0.2 ms ±   0.1 ms    [User: 0.4 ms, System: 0.3 ms]
  Range (min … max):     0.2 ms …   1.1 ms    1560 runs

79 lines, 4K size, 0.2ms.


$ fd -t f -e rs -x cat "{}" >> /tmp/all-in-one.rs
$ hyperfine -w 10 'code-minimap /tmp/all-in-one.rs'
Benchmark #1: code-minimap /tmp/all-in-one.rs
  Time (mean ± σ):     322.7 ms ±   4.5 ms    [User: 298.7 ms, System: 23.8 ms]
  Range (min … max):   318.5 ms … 334.1 ms    10 runs

1,153,225 lines, 37M size, 323ms.


$ base64 /dev/urandom | head -10000000 > huge.txt
$ hyperfine -w 1 'code-minimap huge.txt'
Benchmark #1: code-minimap huge.txt
  Time (mean ± σ):      2.941 s ±  0.034 s    [User: 2.618 s, System: 0.321 s]
  Range (min … max):    2.919 s …  3.028 s    10 runs

10,000,000 lines, 735M size, 2.9s.


Test environment:

Binary version: 0.3.0
OS: Arch Linux x86_64
Kernel: 5.8.10-arch1-1
CPU: Intel i9-9900K (16) @ 5.000GHz

Related Project

minimap.vim: Blazing fast minimap for vim.

License

code-minimap is distributed under the terms of both the MIT License and the Apache License 2.0.

See the LICENSE-APACHE and LICENSE-MIT files for license details.

More Repositories

1

forgit

💤 A utility tool powered by fzf for using git interactively.
Shell
4,375
star
2

minimap.vim

📡 Blazing fast minimap / scrollbar for vim, powered by code-minimap written in Rust.
Vim Script
1,195
star
3

csview

📠 Pretty and fast csv viewer for cli with cjk/emoji support.
Rust
572
star
4

tmux-power

🎨 Tmux powerline theme
Shell
526
star
5

tmux-fzf-url

🚀 Quickly open urls on your terminal screen!
Shell
507
star
6

rlt

A universal load testing framework for Rust, with real-time tui support.
Rust
132
star
7

dotfiles

🏡 My dotfiles
Shell
89
star
8

formarks

🔖 Quickly navigate your work path!
Shell
48
star
9

xaj-hydrological-model

新安江水文模型Java实现
Java
31
star
10

emoji-cli

Ruby
21
star
11

tmux-net-speed

Shell
13
star
12

awesome-stars

A curated list of my GitHub stars!
12
star
13

estunnel

🚛 Tool for downloading data from elasticsearch cluster.
Rust
9
star
14

clitrans

Yet another command-line translator (Chinese 🔄 English).
Rust
9
star
15

protobuf.vim

Better vim syntax highlighting and indent plugin for Protobuf with grpc, grpc-gateway and grpc-swagger support.
Vim Script
7
star
16

advent-of-code-2021

🦀 Rust solutions to AoC 2021
Rust
4
star
17

rustgrep

Rust
2
star
18

elastic-tunnel

Tools for downloading data from elasticsearch
Kotlin
2
star
19

tmux-web-reachable

Shell
2
star
20

epoch-cli

🕓 Epoch converter for CLI
Shell
1
star
21

metabase-druid-driver

Clojure
1
star
22

xaj-hydrological-model-demo

新安江模型示例
Java
1
star
23

idea-settings

1
star
24

geo-locator

A Kotlin & Java library for fast locating region by GPS coordinates.
Kotlin
1
star
25

vim-gitignore

Vim Script
1
star
26

awm.config

Lua
1
star
27

sort

A collection of sort algorithms
C
1
star
28

forepos

Shell
1
star
29

pbcopy

Just a xclip wrapper
Shell
1
star
30

producer-consumer-model

通过多线程实现的生产者/消费者模型
C++
1
star
31

pso-demo

Particle swarm optimization demo
Java
1
star
32

advent-of-code-2020

🦀 Rust solutions to AoC 2020
Rust
1
star
33

pso

Particle swarm optimization Java implementation
Java
1
star