Convert Figma logo to code with AI

jarun logonnn

n³ The unorthodox terminal file manager

18,863
752
18,863
4

Top Related Projects

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.

15,354

A VIM-inspired filemanager for the console

7,602

Terminal file manager

4,076

📁 A simple file manager written in bash.

This is a repository of themes for GNU ls (configured via GNU dircolors) that support Ethan Schoonover’s Solarized color scheme.

Command line interface to the freedesktop.org trashcan.

Quick Overview

nnn (n³) is a full-featured terminal file manager. It's designed to be fast, lightweight, and efficient, with a focus on keyboard-centric navigation and operations. nnn aims to be the Swiss Army knife for file management tasks in the terminal.

Pros

  • Extremely fast and lightweight, with minimal resource usage
  • Highly customizable with extensive plugin support
  • Cross-platform compatibility (Linux, macOS, BSD, Haiku, Cygwin, WSL)
  • Feature-rich, including file previews, disk usage analyzer, and batch renaming

Cons

  • Steep learning curve for users new to terminal-based file managers
  • Limited mouse support, which may be challenging for some users
  • Some advanced features require additional dependencies or plugins
  • Default key bindings may conflict with some terminal emulators or shells

Getting Started

To install nnn on a Unix-like system:

# On Ubuntu or Debian
sudo apt-get install nnn

# On macOS using Homebrew
brew install nnn

# On Arch Linux
sudo pacman -S nnn

To run nnn:

nnn

Basic usage:

  • Use arrow keys or hjkl to navigate
  • Press Enter to open a file or enter a directory
  • Press q to quit
  • Press ? for help and to view all keybindings

For more advanced usage and customization, refer to the project's documentation on GitHub.

Competitor Comparisons

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

  • Dual-pane file manager with Vi-like keybindings
  • Highly customizable with extensive configuration options
  • Supports color schemes and themes

Cons of vifm

  • Steeper learning curve for users unfamiliar with Vi-like interfaces
  • Slower startup time compared to nnn
  • Less focus on minimalism and lightweight design

Code Comparison

vifm configuration example:

" Sample vifmrc
set vicmd=vim
colorscheme Default
set trash
set history=100
set nofollowlinks
set sortnumbers
set undolevels=100
filetype * xdg-open

nnn configuration example:

# Sample nnn config
export NNN_OPTS="cEFrx"
export NNN_COLORS="2136"
export NNN_TRASH=1
export NNN_PLUG='f:finder;o:fzopen;p:mocplay;d:diffs;t:nmount;v:imgview'

Both projects are terminal-based file managers, but they have different approaches. vifm focuses on providing a Vi-like experience with extensive customization options, while nnn emphasizes simplicity, speed, and minimal resource usage. vifm offers a dual-pane interface, making it easier to manage files across directories, whereas nnn provides a single-pane view with a more streamlined navigation experience. The configuration examples show that vifm uses a Vi-like syntax for its configuration, while nnn relies on environment variables for customization.

15,354

A VIM-inspired filemanager for the console

Pros of ranger

  • More feature-rich with extensive customization options
  • Built-in file previews and image support
  • Vim-like keybindings and commands for efficient navigation

Cons of ranger

  • Slower startup time and higher resource usage
  • Steeper learning curve due to more complex configuration
  • Python-based, which may not be ideal for all environments

Code comparison

ranger:

def draw(self):
    self.win.erase()
    line = 0
    for direntry in self.content[self.scroll_begin:self.scroll_end]:
        self.win.addnstr(line, 0, direntry.basename, self.wid)
        line += 1
    self.win.refresh()

nnn:

static void redraw(void)
{
    clearoldentry(oldselectscr, oldselection);
    refresh();
    displayselection();
}

Summary

ranger offers a more feature-rich experience with extensive customization options, built-in file previews, and Vim-like keybindings. However, it has a slower startup time, higher resource usage, and a steeper learning curve compared to nnn.

nnn, on the other hand, is lightweight, fast, and easy to use, but lacks some of the advanced features and customization options found in ranger. It's written in C, making it more portable and efficient in resource-constrained environments.

The choice between ranger and nnn depends on the user's needs, system resources, and preference for features versus simplicity and speed.

7,602

Terminal file manager

Pros of lf

  • Written in Go, which can offer better performance and easier cross-platform compilation
  • More customizable with extensive configuration options
  • Supports remote file systems like SFTP out of the box

Cons of lf

  • Smaller community and fewer contributors compared to nnn
  • Less feature-rich in terms of built-in functionality
  • May have a steeper learning curve for new users due to its configuration-heavy approach

Code Comparison

lf (Go):

func (f *Fm) readdir(path string) {
    f.files = nil
    f.dirs = nil
    f.names = nil
    entries, err := ioutil.ReadDir(path)
    if err != nil {
        f.errors = append(f.errors, err)
    }
}

nnn (C):

static int
populate(char *path, char *fltr, char *subdir)
{
    DIR *dirp;
    struct dirent *dp;
    char *namep, *pnb;
    size_t off = 0;
    int r = 0;
}

Both projects aim to provide efficient file management in the terminal, but they take different approaches. lf focuses on customization and configuration, while nnn emphasizes simplicity and a wide range of built-in features. The choice between them often comes down to personal preference and specific use cases.

4,076

📁 A simple file manager written in bash.

Pros of fff

  • Extremely lightweight and fast, with minimal dependencies
  • Simple and easy to use, with a focus on basic file management tasks
  • Written entirely in Bash, making it highly portable across Unix-like systems

Cons of fff

  • Limited feature set compared to nnn's more comprehensive functionality
  • Less active development and smaller community support
  • Lacks some advanced features like plugins or extensive customization options

Code Comparison

fff:

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

[[ $1 == --help ]] && {
    printf '%s\n' "usage: ${0##*/} [DIR]"
    exit
}

nnn:

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include <ncurses.h>

Summary

fff is a minimalist file manager focused on simplicity and speed, while nnn offers a more feature-rich experience with advanced functionality. fff is written in Bash, making it highly portable, whereas nnn is written in C for better performance. nnn has a larger community and more active development, but fff may be preferred by users seeking a lightweight and straightforward file management solution.

This is a repository of themes for GNU ls (configured via GNU dircolors) that support Ethan Schoonover’s Solarized color scheme.

Pros of dircolors-solarized

  • Focuses specifically on color schemes for directory listings
  • Provides multiple color themes based on the popular Solarized palette
  • Easy to integrate with existing shell configurations

Cons of dircolors-solarized

  • Limited functionality compared to nnn's full-featured file manager
  • Requires manual configuration and integration with the shell
  • Less actively maintained with fewer recent updates

Code Comparison

dircolors-solarized:

DIR 34 # directory
LINK 35 # symbolic link
FIFO 30;44 # pipe
SOCK 35;44 # socket

nnn:

static const char *colors[] = {
    "#00ff00", /* DIR */
    "#00ffff", /* EXEC */
    "#ff0000", /* REG */
    "#ffa500", /* SYMLINK */
};

While dircolors-solarized focuses on defining colors for different file types in shell environments, nnn implements a broader range of functionality, including its own color scheme definition within the file manager's codebase.

Command line interface to the freedesktop.org trashcan.

Pros of trash-cli

  • Focused specifically on safe file deletion and trash management
  • Provides a simple CLI interface for moving files to trash
  • Supports multiple trash directories and follows FreeDesktop.org trash specification

Cons of trash-cli

  • Limited functionality compared to nnn's full-featured file manager capabilities
  • Lacks visual interface and navigation features
  • May require additional tools for comprehensive file management tasks

Code Comparison

trash-cli example:

trash-put file.txt
trash-list
trash-restore

nnn example:

nnn
# Navigate using arrow keys
# Press 'd' to delete (move to trash)
# Press 'r' to restore from trash

Summary

trash-cli is a specialized tool for trash management, offering a straightforward CLI for safely deleting and restoring files. nnn, on the other hand, is a full-featured file manager with built-in trash functionality among many other features. While trash-cli excels in its focused approach, nnn provides a more comprehensive solution for file management tasks. The choice between the two depends on whether you need a dedicated trash management tool or a versatile file manager with integrated trash capabilities.

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

nnn
nnn - Supercharge your productivity!

Latest release Availability CircleCI Status GitHub CI Status Privacy Awareness License

[Features] [Quickstart] [Plugins] [Wiki]

nnn (n³) is a full-featured terminal file manager. It's tiny, nearly 0-config and incredibly fast.

It is designed to be unobtrusive with smart workflows to match the trains of thought.

nnn can analyze disk usage, batch rename, launch apps and pick files. The plugin repository has tons of plugins to extend the capabilities further e.g. live previews, (un)mount disks, find & list, file/dir diff, upload files. A patch framework hosts sizable user-submitted patches which are subjective in nature.

Independent (neo)vim plugins - nnn.vim, vim-floaterm nnn wrapper and nnn.nvim (neovim exclusive).

Runs on the Pi, Termux (Android), Linux, macOS, BSD, Haiku, Cygwin, WSL, across DEs or a strictly CLI env.

(there's more)

Features

  • Quality
    • Privacy-aware (no unconfirmed user data collection)
    • POSIX-compliant, follows Linux kernel coding style
    • Highly optimized, static analysis integrated code
  • Frugal
    • Typically needs less than 3.5MB resident memory
    • Works with 8 colors (and xterm 256 colors)
    • Disk-IO sensitive (few disk reads and writes)
    • No FPU usage (all integer maths, even for file size)
    • Minimizes screen refresh with fast line redraws
    • Tiny binary (typically around 100KB)
    • 1-column mode for smaller terminals and form factors
    • Hackable - compile in/out features and dependencies
  • Portable
    • Language-agnostic plugins
    • Static binary available (no need to install)
    • Minimal library deps, easy to compile
    • No config file, minimal config with sensible defaults
    • Plugin to backup configuration
    • Widely available on many packagers
    • Touch enabled, handheld-friendly shortcuts
    • Unicode support
  • Modes
    • Light (default), detail
    • Disk usage analyzer (block/apparent)
    • File picker, (neo)vim plugin
  • Navigation
    • Filter with automatic dir entry on unique match
    • Type-to-nav (turbo navigation/always filter) mode
    • Contexts (aka tabs/workspaces) with custom colors
    • Sessions, bookmarks, mark and visit a dir
    • Remote mounts (needs sshfs, rclone)
    • Familiar shortcuts (arrows, ~, -, @), quick look-up
    • cd on quit (easy shell integration)
    • Proceed to next file on file open and selection
  • Search
    • Instant filtering with search-as-you-type
    • Regex (POSIX/PCRE) and string (default) filters
    • Subtree search plugin to open or edit files
  • Sort
    • Ordered pure numeric names by default (visit /proc)
    • Case-insensitive version (aka natural) sort
    • By name, access/change/mod (default) time, size, extn
    • Reverse sort
    • Directory-specific ordering
  • Mimes
    • Preview hovered files in FIFO-based previewer
    • Open with desktop opener or specify a custom opener
    • File-specific colors (or minimal dirs in context color)
    • Icons and Emojis support (customize and compile-in)
    • Plugin for image, video and audio thumbnails
    • Create, list, extract (to), mount (FUSE based) archives
    • Option to open all text files in $EDITOR
  • Convenience
    • Detailed file stats and mime information
    • Run plugins and custom commands with hotkeys
    • FreeDesktop compliant trash utility integration
    • Cross-dir file/all/range selection
    • Create (with parents), rename, duplicate files and dirs
    • Create new file or directory (tree) on startup
    • Batch renamer for selection or dir
    • List input stream of file paths from stdin or plugin
    • Copy (as), move (as), delete, archive, link selection
    • Dir updates, notification on cp, mv, rm completion
    • Copy file paths to system clipboard on select
    • Launch apps, run commands, spawn a shell, toggle exe
    • Access context paths/files at prompt or spawned shell
    • Lock terminal after configurable idle timeout
    • Capture and show output of a program in help screen
    • Basic support for screen readers and braille displays

Quickstart

  1. Install nnn and the dependencies you need.
  2. The desktop opener is default. Use -e to open text files in the terminal. Optionally open detached.
  3. Configure cd on quit.
  4. Sync subshell $PWD to nnn.
  5. Install plugins.
  6. Use -x to sync selection to clipboard, show notis on cp, mv, rm and set xterm title.
  7. For a CLI-only environment, set NNN_OPENER to nuke. Use option -c.
  8. Bid ls goodbye! alias ls='nnn -de' :sunglasses:
  9. Visit the Live previews and Troubleshooting Wiki pages.

Don't memorize! Arrows, /, q suffice. Tab creates and/or cycles contexts. ? lists shortcuts.

Wiki

Videos

Elsewhere

Developers

Visit the Tracker thread for a list of features in progress and anything up for grabs. Feel free to discuss new ideas or enhancement requests.