Convert Figma logo to code with AI

gokcehan logolf

Terminal file manager

7,602
322
7,602
133

Top Related Projects

52,000

simple terminal UI for git commands

15,354

A VIM-inspired filemanager for the console

2,699

Vifm is a file manager with curses interface, which provides Vim-like environment for managing objects within file systems, extended with some useful ideas from mutt.

4,076

šŸ“ A simple file manager written in bash.

18,863

nĀ³ The unorthodox terminal file manager

18,987

Terminal JSON viewer & processor

Quick Overview

lf is a terminal file manager written in Go. It provides a minimalist and efficient way to navigate and manage files on the command line. It supports various features such as tab management, bookmarks, and custom key bindings, making it a powerful tool for power users.

Pros

  • Lightweight and Fast: lf is written in Go, which makes it lightweight and fast, providing a responsive and efficient file management experience.
  • Customizable: lf offers a wide range of customization options, allowing users to tailor the interface and behavior to their preferences.
  • Cross-platform: lf is available on multiple platforms, including Linux, macOS, and Windows, making it a versatile tool.
  • Efficient Navigation: lf provides a streamlined and intuitive navigation experience, with features like tab management and bookmarks.

Cons

  • Limited GUI: As a terminal-based file manager, lf may not provide the same level of visual appeal and user-friendliness as some graphical file managers.
  • Learning Curve: The customization options and keyboard-centric interface of lf may have a steeper learning curve for users who are more familiar with traditional file managers.
  • Lack of Enterprise-level Features: While lf is a powerful tool for power users, it may lack some advanced features found in enterprise-level file management solutions.
  • Dependency on Terminal Emulator: lf is a terminal-based application, so its functionality and performance may be dependent on the user's terminal emulator.

Getting Started

To get started with lf, follow these steps:

  1. Install lf on your system. You can find the installation instructions for your platform on the project's GitHub repository.

  2. Once installed, you can launch lf from the terminal by running the following command:

    lf
    
  3. You can navigate the file system using the following key bindings:

    • j/k: Move down/up
    • h/l: Move left/right
    • g/G: Go to the first/last file
    • enter: Open the selected file or directory
    • d: Delete the selected file or directory
    • y: Copy the selected file or directory
    • p: Paste the copied file or directory
  4. To customize lf, you can create a configuration file at ~/.config/lf/lfrc and add your preferred settings. For example, you can change the default file preview command by adding the following line to the configuration file:

    set previewer ~/.config/lf/preview
    

    This will use a custom preview script located at ~/.config/lf/preview.

That's it! You're now ready to use lf as your terminal-based file manager. Refer to the project's documentation for more advanced usage and configuration options.

Competitor Comparisons

52,000

simple terminal UI for git commands

Pros of lazygit

  • More comprehensive Git functionality, including branch management, stashing, and rebasing
  • Interactive UI with mouse support for easier navigation
  • Built-in diff viewer and commit history visualization

Cons of lazygit

  • Larger codebase and more complex installation process
  • Focused solely on Git operations, lacking general file management features
  • Steeper learning curve for users new to Git

Code comparison

lf (file manager):

func (e *Explorer) handleKey(ev *tcell.EventKey) {
    switch ev.Key() {
    case tcell.KeyEnter:
        e.open()
    case tcell.KeyBackspace, tcell.KeyBackspace2:
        e.up()
    case tcell.KeyTab:
        e.toggleMark()
    }
}

lazygit (Git UI):

func (gui *Gui) handleCommitConfirmMenu(g *gocui.Gui, v *gocui.View) error {
    if gui.State.CommitIndex == 0 {
        return gui.createCommitAndPush()
    } else {
        return gui.handleCommitSelection()
    }
}

Summary

lf is a lightweight file manager with a focus on simplicity and efficiency, while lazygit is a feature-rich Git interface with a more complex UI. lf offers broader file management capabilities, whereas lazygit specializes in Git operations with advanced visualization and interaction. The choice between the two depends on whether the user prioritizes general file management or comprehensive Git functionality.

15,354

A VIM-inspired filemanager for the console

Pros of ranger

  • Written in Python, making it easier for many users to customize and extend
  • More feature-rich with built-in file previews and extensive configuration options
  • Longer development history and larger community support

Cons of ranger

  • Slower performance, especially on large directories or with complex operations
  • Requires Python runtime, which may not be available on all systems
  • Larger resource footprint compared to lightweight alternatives

Code comparison

ranger:

def get_selection(self):
    return [f for f in self.thistab.get_selection() if f.is_file]

def execute_file(self, files, **kw):
    mode = kw.get('mode', 0)
    if mode == 0:
        self.execute_command(files)
    elif mode == 1:
        self.open_with(files)

lf:

func (f *Fm) open() {
    if len(f.nav.marks) != 0 {
        f.openSelection()
    } else {
        f.openFile(f.nav.currFile())
    }
}

func (f *Fm) openFile(path string) error {
    return xdg.Open(path)
}

The code snippets show different approaches to file handling and execution, with ranger using Python's object-oriented style and lf utilizing Go's more straightforward function-based approach.

2,699

Vifm is a file manager with curses interface, which provides Vim-like environment for managing objects within file systems, extended with some useful ideas from mutt.

Pros of vifm

  • More feature-rich and customizable with extensive configuration options
  • Supports multiple panels and tabs for enhanced file management
  • Has a built-in text viewer and basic text editor

Cons of vifm

  • Steeper learning curve due to its complexity and numerous features
  • Slower startup time compared to lf, especially with extensive configurations
  • Requires more system resources

Code Comparison

vifm configuration example:

set vicmd=vim
set trash
set history=100
set nofollowlinks
set sortnumbers
set undolevels=100
colorscheme Default

lf configuration example:

set hidden true
set color256 true
set previewer ~/.config/lf/preview
set shell sh
set shellopts '-eu'
set ifs "\n"

Both file managers offer configuration options, but vifm's configuration tends to be more extensive and complex, while lf's is simpler and more straightforward.

4,076

šŸ“ A simple file manager written in bash.

Pros of fff

  • Lightweight and fast, with minimal dependencies
  • Simple and easy to use, especially for beginners
  • Written in pure Bash, making it highly portable

Cons of fff

  • Limited feature set compared to lf
  • Less customizable and extensible
  • Lacks some advanced file management capabilities

Code Comparison

fff:

#!/usr/bin/env bash
# A simple file manager written in bash.

# Initialize variables and set up the environment.
shopt -s nullglob dotglob

lf:

package main

import (
    "log"
    "os"
)

func main() {
    if err := run(); err != nil {
        log.Printf("error: %s", err)
        os.Exit(2)
    }
}

fff is written in Bash, making it more accessible for shell scripting enthusiasts, while lf is written in Go, offering better performance and more advanced features. lf provides a more structured and maintainable codebase, which allows for easier extension and customization.

lf offers a richer set of features, including better file previews, more keybindings, and advanced sorting options. It also supports plugins and custom commands, making it more versatile for power users.

However, fff's simplicity and minimal dependencies make it an excellent choice for users who prefer a lightweight, straightforward file manager that works out of the box on most Unix-like systems.

18,863

nĀ³ The unorthodox terminal file manager

Pros of nnn

  • Lightweight and fast, with minimal dependencies
  • Supports a wide range of file operations and plugins
  • Cross-platform compatibility (Linux, macOS, BSD, Haiku)

Cons of nnn

  • Less customizable interface compared to lf
  • Steeper learning curve for advanced features
  • Limited built-in file preview capabilities

Code Comparison

nnn uses C for its implementation, while lf is written in Go. Here's a brief comparison of their main function signatures:

nnn:

int main(int argc, char *argv[])

lf:

func main()

Key Differences

  • nnn focuses on minimalism and speed, while lf emphasizes customization and extensibility
  • lf provides a more familiar interface for users of traditional file managers
  • nnn offers a larger selection of built-in file operations, while lf relies more on external commands

Use Cases

  • nnn: Ideal for users who prioritize speed and efficiency in file management tasks
  • lf: Better suited for users who want a highly customizable file manager with a familiar interface

Both projects are actively maintained and offer powerful file management capabilities, but they cater to slightly different user preferences and workflows.

18,987

Terminal JSON viewer & processor

Pros of fx

  • Specialized for JSON data manipulation and exploration
  • Interactive terminal UI with syntax highlighting and search functionality
  • Supports JavaScript expressions for data transformation

Cons of fx

  • Limited to JSON data processing, less versatile for general file management
  • Steeper learning curve for users unfamiliar with JavaScript

Code comparison

fx:

fx '.[0].name' data.json
fx 'x => x.filter(item => item.age > 30)' data.json

lf:

lf -command "set hidden"
lf -command "map gh cd ~"

Summary

fx is a powerful tool for working with JSON data, offering an interactive interface and JavaScript-based data manipulation. It excels in scenarios involving JSON processing but is limited to this specific use case.

lf, on the other hand, is a general-purpose file manager with a terminal user interface. It provides broader functionality for navigating and managing files and directories, making it more versatile for everyday use.

The choice between fx and lf depends on the specific needs of the user. fx is ideal for developers working extensively with JSON data, while lf is better suited for users seeking a comprehensive file management solution in a terminal environment.

Convert Figma logo designs to code with AI

Visual Copilot

Introducing Visual Copilot: A new AI model to turn Figma designs to high quality code using your components.

Try Visual Copilot

README

LF

Google Groups | Doc | Wiki | #lf (on Libera.Chat) | #lf:matrix.org (with IRC bridge)

Go Build Go Report Card

lf (as in "list files") is a terminal file manager written in Go with a heavy inspiration from ranger file manager. See faq for more information and tutorial for a gentle introduction with screencasts.

multicol-screenshot singlecol-screenshot

Features

  • Cross-platform (Linux, macOS, BSDs, Windows)
  • Single binary without any runtime dependencies
  • Fast startup and low memory footprint due to native code and static binaries
  • Asynchronous IO operations to avoid UI locking
  • Server/client architecture and remote commands to manage multiple instances
  • Extendable and configurable with shell commands
  • Customizable keybindings (vi and readline defaults)
  • A reasonable set of other features (see the documentation)

Non-Features

  • Tabs or windows (better handled by window manager or terminal multiplexer)
  • Builtin pager/editor (better handled by your pager/editor of choice)
  • Builtin commands for file operations (better handled by the underlying shell tools including but not limited to mkdir, touch, chmod, chown, chgrp, and ln)

Installation

See packages for community maintained packages.

See releases for pre-built binaries.

Building from the source requires Go.

On Unix:

env CGO_ENABLED=0 go install -ldflags="-s -w" github.com/gokcehan/lf@latest

On Windows cmd:

set CGO_ENABLED=0
go install -ldflags="-s -w" github.com/gokcehan/lf@latest

On Windows powershell:

$env:CGO_ENABLED = '0'
go install -ldflags="-s -w" github.com/gokcehan/lf@latest

Usage

After the installation lf command should start the application in the current directory.

Run lf -help to see command line options.

Run lf -doc to see the documentation.

See etc directory to integrate lf to your shell and/or editor. Example configuration files along with example colors and icons files can also be found in this directory.

See integrations to integrate lf to other tools.

See tips for more examples.

Contributing

See contributing for guidelines.