LARBS/content/lf.md
2023-01-19 20:11:26 -05:00

2.4 KiB

title date
lf 2022-12-21T17:07:04-05:00

lf is the file manager used in LARBS. It was original inspired by the program ranger, but unlike ranger, lf is written in Go instead of Python, so is significantly snappier and adds better features for interaction between different lf instances.

{{< img src="/pix/lf.png" class=normal caption="Note that lf uses ueberzug to produce previews of images, or here, a .pdf." >}}

Running

Run lf by pressing super + r, or type lf manually in the termianl.

Bindings

  • h, j, k l (vim keys) to move around and enter directories and open files.
  • g, G, ctrl-d, ctrl-u -- movement like in vim.
  • w -- drop into a terminal in the current directory. If you exit or press ctrl-d in the termianl, you will return to lf.
  • ctrl-n -- new directory.
  • V -- new file with nvim.
  • space -- select files:
    • d -- cut files to lf's clipboard.
    • y -- yank files to lf's clipboard.
    • p -- paste/move copied/cut files.
    • C -- copy selected files to a bookmarked directory.
    • M -- move selected files to a bookmarked directory.
    • Y -- copy text names of selected files to the system clipboard.
  • Renaming files:
    • c -- rename the selected file.
    • A -- rename the selected file, starting at end.
    • a -- rename the selected file, starting after the extension.
    • I -- rename the selected file, starting at beginning.
    • i -- rename the selected file, starting before extension.
    • B -- bulk rename: use vidir to mass edit all files in the directory.
  • s -- sort files by a different metric.
  • z -- show extra data or hidden files.

This list is not necessarily exhaustive. See man lf and the lf configuration file for more.

lf's configuration files

  • ~/.confif/lf/lfrc -- The main lf configuration.
  • ~/.config/lf/scope -- The file that determines which commands generates previews for files.

The other files in the ~/.config/lf/ directory are run automatically when needed.


Notes

Notice that alias lf will tell you that technically you are running the wrapper script lfub when you run lf. This has to do with ueberzug, the program that generates image previews.