All projects

code_scroller

Auto-scroll code files in your terminal with syntax highlighting. Built with ratatui (for TUI) and syntect (for highlighting).

Auto-scroll code files in your terminal with syntax highlighting. Built with ratatui (for TUI) and syntect (for highlighting).

Features

Install / Build

Prereqs: Rust toolchain (rustup + stable).

Debug build:

cargo build

Release build:

cargo build --release

The binary will be in target/release/ (code_scroller.exe on Windows).

Usage

code_scroller <PATH> [--speed-ms <u64>] [--step <usize>] [--loop=<bool>] [--ext <ext>]... [--max-kb <u64>] [--random-start=<bool>]

Arguments

Key bindings

Examples

# Auto-scroll the current directory with defaults
code_scroller .

# Faster scrolling, two lines per tick
code_scroller ./src --speed-ms 30 --step 2

# Only C#, JSON, and HTML files; allow bigger files
code_scroller . --ext .cs --ext .json --ext .html --max-kb 2048

# Do not loop across files
code_scroller . --loop=false

# Start at a random file
code_scroller . --random-start=true

Publishing release binaries

Below are simple ways to produce distributable binaries for Windows and Linux.

Local builds (per-OS)

Build on the target OS for the simplest, fully-static-free binaries:

cargo build --release
# output: target\\release\\code_scroller.exe
# optional: zip for distribution
Compress-Archive -Path target\\release\\code_scroller.exe -DestinationPath code_scroller-x86_64-pc-windows-msvc.zip
cargo build --release
# output: target/release/code_scroller
# optional: tar.gz for distribution
tar czf code_scroller-x86_64-unknown-linux-gnu.tar.gz -C target/release code_scroller

cross uses Docker images to cross-compile without local linker setup.

Install once:

cargo install cross

Build Linux binary (from any OS with Docker available):

cross build --release --target x86_64-unknown-linux-gnu
# artifact: target/x86_64-unknown-linux-gnu/release/code_scroller

Build Windows GNU binary:

cross build --release --target x86_64-pc-windows-gnu
# artifact: target/x86_64-pc-windows-gnu/release/code_scroller.exe

You can then package the produced binaries (zip/tar.gz) as shown above.

Notes

License

MIT license.