Go to file
2025-06-29 03:54:39 +00:00
.config fix(colors): swapped .ts and .js colors 2025-06-29 03:54:39 +00:00
.local/bin Found bug when decrypting files, solved z.lua not being found, just had to make sure sxhkd saw it in PATH from xinitrc, added glob selection mappings 2022-09-02 16:26:20 +00:00
media docs: add screenshot 2023-04-20 21:28:50 +00:00
README.md docs(readme): update apps' URLs and next step section 2023-08-30 13:13:43 +00:00

lf-config

My lf configurations

lf screenshot

Table of Contents

📰 Description

Lf is a fast simple terminal file manager that is nonetheless extremely extensible.

These are my personal configurations that make it even more powerful and awesome.

Features

  • Advanced Preview Handling:
    • Image previews via ueberzug for:
      • Images (raster and SVGs)
      • Videos
      • PDF/PostScript files
      • Fonts
    • Text files (with syntax highlighting)
    • Web pages (HTMLs)
    • Man pages
    • Binary files
    • JSONs
    • Archives (zips, tar.gz)
    • Etc.
  • Advanced Opening Handling:
    • Opening with configurable default applications or a resource opener
    • "Open with" menu
  • Distinct colors for many filetypes
  • Nice-looking emoji and Nerd Fonts icons
  • Integrations with other apps that add functionality:
    • dragon: Drag files to other GUI apps
    • g.sh: Bookmark files
    • z.lua: Navigation to frecent directories
    • broot: Fuzzy search file names
    • ffd: Fuzzy search file names
    • rgfzf: Fuzzy search file contents
    • vidir: Bulk file renaming
    • trash-cli: Put files in trash instead of removing them
    • shred/rshred: Shred-remove files instead of just removing them

🚀 Setup

⚙ Main configs

Copy the .config/lf/* files to your lf configuration directory.

🖼 Image previews

To get image previews you will also need to:

  • Install ueberzug
  • Start lf through the wrapper lfub script (in .local/bin/lfub).

You may alias it in your shell:

alias lf=lfub

📁 Directory changing

If you want to use lf from your (POSIX) shell to change directories, you will need to start lf through the wrapper lfcd function (in .config/dash/functions/lfcd).

You may source the function in your shell:

.  ~/.config/dash/functions/lfcd

and possibly bind it to a key combination in your shell config.

🔤 Fonts

Install a Nerd Fonts compatible font, a font that supports emojis if you don't have one, and use a terminal that supports both if you don't have one.

For example I mainly use the Alacritty terminal with the Fira Code font

📦 Install dependencies

Of course, install the ones that fit for you

For previews:

  • bat (text)
  • ueberzug (images, videos, pdf, fonts)
  • ffmpegthumbnailer (videos)
  • exiftool (metadata/audio, and file detection for .webm files) (recommended)
  • jq (json and metadata)
  • lynx (html/web pages)
  • pdftoppm from poppler (pdf)
  • odt2txt (odt)
  • convert from imagemagick (fonts)
  • atool (archives)
  • gpg (PGP encrypted files)
  • man (troff manuals)
  • Other: stat, cut, sha256sum

For integrations:

For opening:

  • exiftool (recommended)
  • xdg-open or set $OPENER
  • nvim or set $EDITOR
  • alacritty or set $TERMINAL
  • zathura or set $READER
  • mpv or set $VIDEO_PLAYER
  • mpv or set $AUDIO_PLAYER
  • gimp or set $IMAGE_EDITOR
  • vimiv or set $IMAGE_VIEWER
  • kdenlive or set $VIDEO_EDITOR

📂 File opening

Take a look at the opener file for more details, but basically it tries to open certain file types with the corresponding programs in the environment variables $EDITOR, $TERMINAL, $READER, $VIDEO_PLAYER, $AUDIO_PLAYER, $IMAGE_EDITOR, $IMAGE_VIEWER, $VIDEO_EDITOR.

In case the file type or extension is not recognized, it defaults to the resource opener in the $OPENER environment variable, or xdg-open by default. Make sure that it is configured to handle at least the most common mime types with your applications.

You can take a look at my mime types associations for an example

⌨ Keybindings

Note: I use a Spanish keyboard and my own custom vim-style bindings j,k,l,ñ

Take a look at the lfrc for more details, here are the most important ones:

Keybinding Description
j updir
k up
l down
ñ open
Ñ open with
{ half-up
} half-down
h lf command
Enter shell command
w open subprocess terminal
W open forked terminal
- search filename
f1 fuzzy search filename 1 level down
f2 fuzzy search filename 2 levels down
ff fuzzy search filename with broot
rg fuzzy search text files' contents with rg
rf fuzzy search text files' contents with rg+fzf
rA fuzzy search files' contents with rga
dd cut
D remove
alt d trash
alt D shred
g Space g.sh. Go to bookmark path
z Space z.lua. Go to frecent directory
go Menu select bookmark path
zo Menu select frecent directory
dl Drag files in current directory to other app
ds Drag selected files to other app
dw Drag download files into current directory
dc Drag copy files into current directory
dm Drag move files into current directory

👀 See also

⏭ Next steps

This ueberzug fork only supports X11 AFAIK, eventually I might migrate to a version that supports Wayland like ueberzugpp or to a libsixel solution. See:

📝 Licence

GLPv3 or later