A minimalist, high-performance configuration for the lf terminal file manager with enhanced error handling.
- Image Previews: Ultra-fast Sixel rendering using
chafa. - Gnosis-Diff: Built-in TUI diff tool for comparing files (
gd). - PDF Support: Quick preview of PDF documents.
- Syntax Highlighting: Code previews with
bat. - Archive Management: List and extract multiple archive formats (zip, tar, 7z, rar).
- Clipboard Integration: Copy full file paths to system clipboard.
- Safe Trash: Integration with
trash-putto avoid accidental loss. - Quick Creation: Create folders and files with error feedback.
- Robust Error Handling: Clear error messages when dependencies are missing.
| Key | Action |
|---|---|
n |
Create a new directory |
N |
Create a new file |
X |
Extract archive |
Y |
Copy full path to clipboard |
o |
Open with system default |
D |
Move to trash |
gd |
Compare marked file with current file (Gnosis-Diff) |
e |
Edit with $EDITOR |
. |
Toggle hidden files |
f |
Jump to file/folder (fzf) |
# Clone the repo
git clone https://github.com/sarkoidose/lf.git ~/.config/lf
# Ensure preview scripts are executable
chmod +x ~/.config/lf/*.shlf- File managerfzf- Fuzzy finder (forfkeybinding)trash-cli- Safe deletion (forDkeybinding)
chafa- Image to Sixel conversionbat- Syntax highlighting for textpoppler- PDF utilities (includespdftoppm)wl-clipboard- Wayland clipboard (forYkeybinding)
p7zip- 7z support (includes7z)unrar- RAR extraction- Plus built-in:
tar,gzip,bzip2,unzip
gnosis-diff- Advanced file comparison (forgdkeybinding)
Check which dependencies are installed:
for cmd in lf fzf trash-put chafa bat wl-copy pdftoppm 7z unrar; do
command -v "$cmd" >/dev/null && echo "✓ $cmd" || echo "✗ $cmd missing"
doneMissing tools will show errors when used, but won't break lf.
If your gnosis-diff installation is at a different location, set the environment variable:
export GNOSIS_DIFF=/path/to/gnosis_diff.py
lfOr edit the path directly in lfrc:
cmd gdiff ${
GNOSIS_DIFF="$HOME/your/custom/path/gnosis_diff.py"
# ... rest of command
}Missing chafa. Install it and restart lf.
Missing bat. Install it and restart lf.
Missing wl-copy (Wayland). On X11, use xclip or xsel instead.
Missing archive tools (7z, unrar, etc.). Install the required tool for your archive format.
Missing pdftoppm (usually comes with poppler). Install it.
All missing dependencies will show error messages in lf when you try to use them.
Maintained by sarkoidose.