Dev In The Mountain Header
A Developer In The mountains having fun

Last reviewed

lf — did it replace ranger for me?

Yes, for a good while. I wrote this page in 2023 while trying to decide. I found ranger heavy and slow, and lf was awesome to use for a decent amount of time. I've since moved on to yazi, which is what I use now. lf is still a great choice and is still actively developed. See my comparison of Linux file managers for how they all stack up.

What is lf?

lf is a quick "simple" file manager that is loosely based on ranger but written from scratch in Go. This means that while ranger (written in Python) might hang on some long tasks, lf is async from the start. This translates into a smooth and quick running experience compared with many other alternatives.

While lf doesn't have the out of box experience of ranger and seems overly simple, it is easy to add in functionality through the use of common sh code. In ranger this functionality isn't hard either but it is through the use of Python instead of sh script, so it can be a bit harder to get started as you have to transform what you would normally do on the shell line into completely different Python code.

What it's good at

  • Fast and light. A single binary with nothing else to install, fast startup, and a low memory footprint.
  • The UI doesn't lock up. IO operations are asynchronous.
  • Vim-like keys by default, which you can customize.
  • Configured with shell commands. If you can write it on the command line, you can bind it to a key.
  • Runs almost anywhere. Linux, macOS, the BSDs, and Windows.

What it leaves out on purpose

  • Tabs or windows. lf expects your window manager or terminal multiplexer to handle those.
  • A built-in pager or editor. It uses whichever ones you already have.
  • Built-in file operation commands like mkdir and touch. It leaves these to your shell.
  • Previews out of the box. You point it at your own preview script with the previewer option.

This is the main thing to know going in. Yazi does a lot more out of the box, including tabs and image previews, while lf gives you a smaller base to build on.

Getting started

Your config lives in ~/.config/lf/lfrc. As an example of how simple it is to extend, this binds a to a prompt that runs mkdir (it's from lf's example config):

sh
map a :push %mkdir<space>
More places to find me
Mental Health
follow me on Mastodon