💻
Cheatsheets
  • Most Useful Command Line Tools: 50 Cool Tools to Improve Your Workflow, Boost Productivity, and More
  • 7_tips_to_reverse_engineer_javascript
  • Configuring a Repl
  • How to create your command-line program (CLI) with NodeJS and Commander.js | by Duc N. | JavaScript
  • replit Node.JS 24/7 Project Hoster
  • cheatsheets
  • Alacritty, Tmux, and Vim
  • amethyst
  • Android
  • Installing Arch Linux
  • Arch Linux
  • aria2
  • bin
  • bspwm
  • Chocolately Notes
  • command_line_pipes
  • CSS Grid
  • curl
  • The curl guide to HTTP requests
  • Docker
  • Easymotion
  • Emmet
  • Favorite figlet fonts
  • FFMPEG
  • figlet
  • File Serve
  • File Transfer
  • fish shell
  • Front End Dev Links
  • How to use Git.io to shorten GitHub URLs and create vanity URLs
  • Git
  • Downloading a Tarball from GitHub
  • Make Infinite Gmail Addresses For One Inbox
  • How To Use GPG on the Command Line
  • guide_to_fish_completions
  • Homebrew
  • How to clean Arch Linux
  • HTML5 Boilerplate
  • Install
  • All the keyboard shortcuts you’ll ever need for Safari on iPad
  • iosevka
  • iPhone
  • ish (iOS)
  • Javascript Notes
  • jq
  • Jupyter Notebooks
  • Lettering
  • lf-wiki
  • lf
  • Command Line
  • Adding a swapfile after a clean installation without swap partition
  • mac_bluetooth_issues
  • Mac Terminal
  • maim
  • markdown-sample
  • Markdown Notes
  • Images in README.md Markdown Files
  • Organizing information with tables
  • md_cheatsheet
  • NiftyWindows Help
  • nix
  • Justin Restivo - A Portable Text Editor: Nix <3 Neovim
  • NPM
  • neovim configuration
  • Pastery
  • Powershell
  • Table of Basic PowerShell Commands | Scripting Blog
  • Powershell Modules
  • Puppeteer
  • Python
  • rclone-colab
  • replit
  • Hi there, I'm Raju Ghorai - a.k.a. [coderj001]
  • Scriptable
  • Servor
  • Replacing Postlight’s Mercury scraping service with your self-hosted copy
  • Shell Scripts
  • skhd
  • Spicetify
  • SSH
  • SurfingKeys
  • tar
  • Terminal Web Browser Docker
  • Text Generators
  • tmux shortcuts & cheatsheet
  • unicode
  • VIM
  • VIM Diff
  • vi Complete Key Binding List
  • 8 Essential Vim Editor Navigation Fundamentals
  • Vim Shortcut Keys
  • Vite
  • VNC
  • web-servers
  • Web Server
  • Windows Command Line
  • Writeguard
  • WSL Cheatsheet
  • youtube-dl
  • zsh Plugins
  • zspotify
Powered by GitBook
On this page
  • lf file manager
  • Custom Commands from .config/lf/lfrc
  • Configuration
  • Working Directory
  • Multiple Terminals or Multiplexers
  • What Next?

Was this helpful?

lf

lf file manager

key
action

y

copy file

d

cut file

p

paste file

c

clears selection

ctrl + u & ctrl + d

half page up & down

ctrl + b & ctrl + f

full page up & down

$

run shell

%

pipes shell

!

shell and waits

&

runs in background

z

prefix commands

s

prefix sort

e

launch editor

i

launch pager

w

launch shell

Custom Commands from .config/lf/lfrc

a - creates new directory

Configuration

You can download the example configuration file and customize according to your needs. If you built from source you can simply copy this file from the repository:

mkdir -p ~/.config/lf
cp $GOPATH/src/github.com/gokcehan/lf/etc/lfrc.example ~/.config/lf/lfrc

Or if you installed a pre-built binary you can download this file from the repository:

mkdir -p ~/.config/lf
curl https://raw.githubusercontent.com/gokcehan/lf/master/etc/lfrc.example -o ~/.config/lf/lfrc

Working Directory

lf starts in the current directory and changes the working directory accordingly when you move around. On the other hand, when you quit lf, the launching shell remains in the starting directory. This is a limitation of shells since it is not possible for a program to change the working directory of the parent process. However, you can define a shell function for this purpose as a workaround if you want to stay on the last visited directory when you quit:

Example scripts are provided in the repository for common shells. If you installed a pre-built binary you can download these example scripts from the repository:

mkdir -p ~/.config/lf
curl https://raw.githubusercontent.com/gokcehan/lf/master/etc/lfcd.sh -o ~/.config/lf/lfcd.sh

Then you need to source this file in your shell configuration file (e.g. ~/.bashrc):

LFCD="$GOPATH/src/github.com/gokcehan/lf/etc/lfcd.sh"  # source
LFCD="/path/to/lfcd.sh"                                #  pre-built binary, make sure to use absolute path
if [ -f "$LFCD" ]; then
    source "$LFCD"
fi

You can also bind a key for this command if you like:

bind '"\C-o":"lfcd\C-m"'

For other shells, see the comments in corresponding files for instructions.

Multiple Terminals or Multiplexers

It is often useful to open a file manager in multiple paths at the same time to copy files between directories. Instead of implementing tabs or panes, lf uses a server/client architecture for this purpose to fit your existing workflow. A server process is automatically launched in the background when you run lf command for the first time. This process saves the names of files to be copied or moved so that you can copy files in one client and paste them in another. This feature requires no configuration and it can be used with either multiple terminals or a multiplexer such as screen or tmux:

What Next?

Previouslf-wikiNextCommand Line

Last updated 2 years ago

Was this helpful?

lfcd
tmux

You can read the for more in-depth information and the rest of the for extras.

documentation
wiki