Skip to main content

Overview

Ranger is a console file manager with VI key bindings. It provides a minimalistic and efficient interface for browsing directories and managing files from the terminal.

Installation

Arch Linux

yay -S ranger

Ubuntu/Debian

sudo apt install ranger

Features

VI keybindings

Navigate using h, j, k, l like in Vim

File previews

Preview files directly in the terminal

Quick navigation

Fast directory jumping and searching

Minimal interface

Clean, distraction-free file management

Shell integration

Ranger is configured with a special alias that allows it to change the shell’s directory when you exit:
.zshrc
# Ranger, if installed
if command -v ranger &> /dev/null; then
  alias ra="ranger --choosedir=$HOME/.rangerdir; LASTDIR=`cat $HOME/.rangerdir`; cd "$LASTDIR"
fi

How the integration works

1

Launch with alias

Use ra instead of ranger to enable directory tracking
2

Navigate directories

Browse and navigate to your target directory in Ranger
3

Exit Ranger

Press q to quit Ranger
4

Shell follows

Your shell automatically changes to the last directory you were in

Usage

Basic commands

ranger          # Launch normally
ra              # Launch with directory change integration
KeyAction
hGo to parent directory
jMove down
kMove up
lEnter directory or open file
ggGo to top
GGo to bottom
/Search
qQuit

File operations

KeyAction
yyCopy file
ddCut file
ppPaste file
dDDelete file
cwRename file
spaceSelect file

Configuration

Ranger can be customized through configuration files in ~/.config/ranger/:
  • rc.conf - Settings and keybindings
  • rifle.conf - File associations
  • scope.sh - Preview script customization
Generate default configuration files with: ranger --copy-config=all

Preview enhancements

For better file previews, install these optional dependencies:
# Image previews
yay -S w3m

# Code highlighting
yay -S highlight

# PDF previews
yay -S poppler

Integration with other tools

Ranger works seamlessly with the development environment:
  • Launches from Tmux sessions
  • Can open files in Neovim
  • Respects shell environment variables
  • Integrates with FZF for fuzzy finding
Use 1 to toggle Miller columns view, 2 for dual-pane, and 3 for preview pane visibility.
  • Neovim - Default editor for opening files
  • FZF - Fuzzy finder for quick file access
  • Zoxide - Smart directory jumping

Build docs developers (and LLMs) love