lsf

command module
v0.2.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 9, 2026 License: MIT Imports: 11 Imported by: 0

README

lsf

A minimal lf-style terminal file manager whose preview pane renders text files the way bat / rubric do: syntax highlighting (via chroma) with a line-number gutter, instead of lf's plain-text preview.

Install

go install goforge.dev/lsf@latest

Usage

lsf [directory]

Three miller columns: parent directory, current directory, preview. The preview shows highlighted text for regular files, a listing for directories, binary for binary files, and the target for symlinks.

Keys

Key Action
q, esc quit
j/k, arrows move down/up
h, left parent directory
l, right, enter enter directory / edit file
gg / G first / last entry
ctrl-d / ctrl-u half page down / up
ctrl-f / ctrl-b page down / up
zh, . toggle hidden files
/ search (then n/N for next/previous match)
e open file in $EDITOR (fallback vi)
v view file with rubric (paged, read-only)
r reload current directory and preview

Configuration

  • LSF_THEME — chroma theme name for previews (default monokai). Any name from chroma's gallery works: dracula, github, nord, solarized-dark, …
  • EDITOR — editor used by e/enter on files.

Design notes

  • Layout, navigation model (cursor + scroll offset with scrolloff, per-dir cursor memory), dirs-first natural sort, and the prompt/status lines follow lf's defaults (1:2:3 column ratios).
  • Preview pipeline follows rubric/bat: NUL-byte binary sniff, lexer by file name then content analysis, chroma tokenize → per-line segments, 4-space tabs, nnn │ gutter in xterm-238 grey.
  • Previews are cached per path and invalidated by mtime/size.
  • Files are read up to 512 KiB and highlighted up to 500 lines.

Documentation

Overview

Command lsf is a minimal lf-style terminal file manager whose preview pane renders text files bat-style: chroma syntax highlighting plus a line-number gutter.

Keys: q quit · hjkl/arrows move · enter/l open · gg/G top/bottom · ctrl-d/u half page · ctrl-f/b page · zh or . toggle hidden · / search · n/N next/prev match · e edit · v view with rubric · r reload.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL