RANGER(1)

🌸 RANGER(1) β€” the ranger manual, bestie edition 🌸

okay so. this is RANGER(1), the manual for ranger, and i'm gonna walk you through the whole thing like we're texting at 2am. grab a snack πŸ“


✨ NAME ✨

ranger β€” a visual file manager. yes. that's the whole name section. it's giving minimal icon energy πŸ’…


πŸ¦‹ SYNOPSIS πŸ¦‹

ranger [--version] [--help] [--debug] [--clean] [--cachedir=directory]
[--confdir=directory] [--datadir=directory] [--copy-config=which]
[--choosefile=target] [--choosefiles=target] [--choosedir=target]
[--selectfile=filepath] [--show-only-dirs] [--list-unused-keys]
[--list-tagged-files=tag] [--profile] [--cmd=command] [path ...]

that's the whole vibe. flags then paths. copy it exactly, don't be cute with it 😌


πŸ’– DESCRIPTION πŸ’–

ranger is a console file manager with VI key bindings.

that's it. that's the description. short, iconic, no notes. πŸ‘‘


πŸŽ€ RESOURCES πŸŽ€

this manual is literally your blueprint for using and configuring ranger, bestie.

inside ranger, you can press ? for a list of key bindings, commands or settings. it's like a little in-app help menu and it slays.

README has the install instructions.

HACKING.md has the guidelines for code modification β€” read it if you're gonna touch the code, fr fr.

the directory doc/configs contains configuration files. they're usually installed to /usr/share/doc/ranger/config and you can get them with ranger's --copy-config option. 🫢

the directory examples contains reference implementations for ranger plugins, sample configuration files and some programs for integrating ranger with other software. they're usually installed to /usr/share/doc/ranger/examples.

the man page of rifle(1) describes the functions of the file opener.

and the LINKS section of this man page has further resources β€” more on that later in the page, stay tuned ⭐


🌈 POSITIONAL ARGUMENTS 🌈

  • path ... β€” every path you give gets opened in a tab, and if that path is a file, it gets selected. if you omit this entirely, it's equivalent to providing the current directory. so like, doing nothing = . 😌

πŸ‘‘ OPTIONS πŸ‘‘ (the main character section)

  • -d, --debug β€” activates debug mode: whenever an error occurs, ranger will exit and print a full traceback. the default behavior is to merely print the name of the exception in the statusbar/log and try to keep running. so debug mode is the dramatic one that walks out πŸ’€
  • -c, --clean β€” activates clean mode: ranger will not access or create any configuration files, nor will it leave any traces on your system. useful when your configuration is broken, when you want to avoid clutter, etc. ghost mode. no fingerprints. πŸ«₯
  • --cachedir=dir β€” changes the cache directory of ranger from $XDG_CACHE_HOME or ~/.cache/ranger to "dir".
  • -r dir, --confdir=dir β€” changes the configuration directory of ranger from $XDG_CONFIG_HOME or ~/.config/ranger to "dir".
  • --datadir=dir β€” changes the data directory of ranger from $XDG_DATA_HOME or ~/.local/share/ranger to "dir".
  • --copy-config=file β€” creates copies of the default configuration files in your local configuration directory. existing ones will not be overwritten, so no surprise sabotage πŸ’… possible values: all, commands, commands_full, rc, rifle, scope.
Note: you may want to disable loading of the global configuration files by exporting RANGER_LOAD_DEFAULT_RC=FALSE in your environment. see also: FILES, ENVIRONMENT.

--copy-config=commands will copy only a small sample configuration file with a thoroughly commented example. it's recommended to keep this file tidy to avoid getting defunct commands on ranger upgrades. the full default commands.py can be copied with --copy-config=commands_full, but that file will be ignored by ranger and serves only as a reference for making your own commands. so like, it's a mood board, not a plugin πŸ”₯

  • --choosefile=targetfile β€” lets you pick a file with ranger. this changes the behavior so that when you open a file, ranger will exit and write the absolute path of that file into targetfile. one file, one path, done ✨
  • --choosefiles=targetfile β€” lets you pick multiple files with ranger. this changes the behavior so that when you open a file, ranger will exit and write the absolute paths of all selected files into targetfile, adding one newline after each filename. multi-select slay 🌸
  • --choosedir=targetfile β€” lets you pick a directory with ranger. when you exit ranger, it will write the last visited directory into targetfile. bye bestie, here's where i was πŸ“
  • --selectfile=targetfile β€” opens ranger with targetfile selected. this is a legacy option, superseded by the behavior for the POSITIONAL ARGUMENTS. it's giving old money, we still respect it though πŸŽ€
  • --show-only-dirs β€” displays only the directories. may be used in conjunction with --choosedir=targetfile. directory-only mode, folders only, no files allowed at the function 🚫
  • --list-unused-keys β€” lists common keys which are not bound to any action in the "browser" context. this list is not complete β€” you can bind any key that is supported by curses: use the key code returned by getch(). so it's a starter pack, not the whole menu πŸ‘€
  • --list-tagged-files=tag β€” lists all files which are tagged with the given tag. Note: tags are single characters. the default tag is "*".
  • --profile β€” prints statistics of CPU usage on exit. numbers on numbers, she's data-driven πŸ’œ
  • --cmd=command β€” executes the command after the configuration has been read. use this option multiple times to run multiple commands. spam it, it's allowed 🫢
  • --version β€” prints the version and exits.
  • -h, --help β€” prints a list of options and exits.

🧚 CONCEPTS 🧚

this part explains how certain parts of ranger work and how they can be used efficiently. it's the lore episode, but make it useful ⭐

πŸ’€ TAGS πŸ’€

tags are single characters which are displayed left of a filename. you can use tags however you want β€” it's your system, bestie.

press "t" to toggle tags and "ut" to remove any tags of the selection. the default tag is an Asterisk ("*"), but you can use any tag by typing <tagname>.

so yes: single characters, your rules, go wild πŸ’…

πŸ¦‹ PREVIEWS πŸ¦‹

by default, only text files are previewed. but you can enable external preview scripts by setting the options "use_preview_script" and "preview_files" to true. glow-up unlocked ✨

this default script is %rangerdir/data/scope.sh. it contains more documentation and calls to many external programs to generate previews. they are automatically used when available but completely optional.

for general usage:

  • "file" for determining file types
  • "chardet" (Python package) for improved encoding detection of text files
  • "sudo" to use the "run as root" feature
  • "python-bidi" (Python package) to display right-to-left file names correctly (Hebrew, Arabic)

for enhanced file previews (with scope.sh):

  • "img2txt" (from "caca-utils") for ASCII-art image previews
  • "w3mimgdisplay", "ueberzug", "mpv", "iTerm2", "kitty" (or other terminal supporting the Kitty graphics protocol), "terminology" or "urxvt" for image previews
  • "convert" (from "imagemagick") to auto-rotate images and for image previews
  • "rsvg-convert" (from "librsvg") for SVG previews
  • "ffmpegthumbnailer" for video thumbnails
  • "highlight", "bat" or "pygmentize" for syntax highlighting of code
  • "atool", "bsdtar", "unrar" and/or "7zz" to preview archives
  • "bsdtar", "tar", "unrar", "unzip" and/or "zipinfo" (and "sed") to preview archives as their first image
  • "lynx", "w3m" or "elinks" to preview html pages
  • "pdftotext" or "mutool" (and "fmt") for textual pdf previews, "pdftoppm" to preview as image
  • "djvutxt" for textual DjVu previews, "ddjvu" to preview as image
  • "calibre" or "epub-thumbnailer" for image previews of ebooks
  • "transmission-show" for viewing BitTorrent information
  • "mediainfo" or "exiftool" for viewing information about media files
  • "odt2txt" for OpenDocument text files (odt, ods, odp and sxw)
  • "python" or "jq" for JSON files
  • "sqlite3" for listing tables in SQLite database (and optionally "sqlite-utils" for fancier box drawing.)
  • "fontimage" for font previews
  • "openscad" for 3D model previews (stl, off, dxf, scad, csg)
  • "draw.io" for draw.io https://app.diagrams.net/ diagram previews (drawio extension)

install these programs (just the ones you need) and scope.sh will automatically use them. you don't need all of them, bestie, just the ones that match your files 😌

independently of the preview script, there is a feature to preview images by drawing them directly into the terminal. to enable this feature, set the option "preview_images" to true and enable one of the image preview modes:

πŸ–₯️ iTerm2

this only works in iTerm2 compiled with image preview support, but works over ssh. iconic behavior honestly.

to enable this feature, set the option "preview_images_method" to iterm2.

this feature relies on the dimensions of the terminal's font. by default, a width of 8 and height of 11 are used. to use other values, set the options "iterm2_font_width" and "iterm2_font_height" to the desired values.

πŸ“ sixel

this works in most terminal emulators, including all terminals based on VTE >=0.68 (e.g. GNOME Terminal), iTerm2, MinTTY, WezTerm and many others.

to enable this feature, install "imagemagick" and set the option "preview_images_method" to sixel.

preferred dithering method can be specified by setting "sixel_dithering".

🐱 kitty

this works in terminals supporting the Kitty graphics protocol. it requires PIL (or pillow) to work. allows remote image previews, for example in an ssh session. yes, ssh AND pictures. she can do both πŸ’œ

to enable this feature, set the option "preview_images_method" to kitty.

🌸 terminology

this only works in terminology. it can render vector graphics, but works only locally.

to enable this feature, set the option "preview_images_method" to terminology.

πŸ¦‹ ueberzug

Überzug is a command line utility which draws images on terminals using child windows. it requires PIL (or pillow) and relies on X11. this makes it compatible (in a limited way, i.e., tmux splits are not supported) with many terminals and tmux but not the Linux console or Wayland.

to enable this feature, set the option "preview_images_method" to ueberzug.

πŸŽ€ urxvt

this only works in urxvt compiled with pixbuf support. does not work over ssh.

essentially this mode sets an image as a terminal background temporarily, so it will break any previously set image background. so like, heads up, it's messy in a specific way 😭

to enable this feature, set the option "preview_images_method" to urxvt.

⭐ urxvt-full

the same as urxvt but utilizing not only the preview pane but the whole terminal window.

to enable this feature, set the option "preview_images_method" to urxvt-full.

πŸ’€ w3m

this does not work over ssh, requires certain terminals (tested on "xterm", "urxvt", and "Alacritty") and is compatible with tmux and screen.

to enable this feature, install the program "w3m" and set the option "preview_images_method" to w3m.


part 1 out, more coming, don't go anywhere 🧚

Okay so if your terminal has a nonzero border and it’s not automatically detected, the w3m preview is gonna be misaligned 😭. Use the w3m_offset option to manually adjust the image offset β€” and it should be the same value as the terminal’s border value, bestie. πŸ’…

πŸ’– SELECTION πŸ’–

The selection is literally defined as β€œAll marked files IF THERE ARE ANY, otherwise the current file.” 🫢 Be aware of this when using the :delete command, because that deletes all files in the selection. Not just the one under your cursor. πŸ’€

You can mark files by pressing Space, v, etc. A yellow Mrk symbol at the bottom right indicates that there are marked files in this directory. πŸ‘‘


✨ MACROS ✨

Macros can be used in commands to abbreviate things. Iconic little shortcuts, honestly.

  • %f β€” the highlighted file
  • %d β€” the path of the current directory
  • %s β€” the selected files in the current directory
  • %t β€” all tagged files in the current directory
  • %c β€” the full paths of the currently copied/cut files
  • %p β€” the full paths of selected files

The macros %f, %d, %p, and %s also have upper case variants, %F, %D, %P, and %S, which refer to the next tab. To refer to specific tabs, add a number in between. (%7s = selection of the seventh tab.) πŸ¦‹

%c is the only macro which ranges out of the current directory. So you may β€œabuse” the copying function for other purposes, like diffing two files which are in different directories:

Yank the file A (type yy), move to the file B, then type
@diff %c %f

Macros for file paths are generally shell-escaped so they can be used in the "shell" command.

When mapping keys you can use the placeholder <any>, and the key entered in that position can be used through the %any and %any_path macros. (When using multiple <any> placeholders you can index the macros: %any0, %any_path0, %any1, %any_path1...) The macro %any will be replaced with the key pressed in the position of the <any> placeholder. The macro %any_path will be replaced with the path of the bookmark mapped to the key pressed in the position of the <any> placeholder. For example this macro can be used to echo the key that was pressed after "c":

map c<any> echo %any

%any is used in the ranger configuration to create a keybinding for adding a bookmark. c<set_bookmark> creates a bookmark for the current directory and the key for the bookmark is the first supplied argument. In this case the key pressed after "m":

map m<any> set_bookmark %any

The %any_path macro can be used to echo the path of the bookmark that is set to the key pressed after "c":

map c<any> echo %any_path

A practical example of the use of %any_path is the pasting of cut/copied files to a bookmarked directory:

map p'<any> paste dest=%any_path

The macro %rangerdir expands to the directory of ranger’s python library, you can use it for something like this command:

alias show_commands shell less %rangerdir/config/commands.py

%confdir expands to the directory given by --confdir.

%datadir expands to the directory given by --datadir.

The macro %space expands to a space character. You can use it to add spaces to the end of a command when needed, while preventing editors to strip spaces off the end of the line automatically. πŸŽ€

To write a literal %, you need to escape it by writing %%.

Note that macros are expanded twice when using chain. For example, to insert a space character in a chained command, you would write %%space:

chain command1; command2%%space

πŸŽ€ BOOKMARKS πŸŽ€

Type m<key> to bookmark the current directory. You can re-enter this directory by typing </kbd> followed by your <key>. <key>` can be any letter or digit. Unlike vim, both lowercase and uppercase bookmarks are persistent. ✨

Each time you jump to a bookmark, the special bookmark at key </kbd> will be set to the last directory. So typing <kbd>` gets you back to where you were before. πŸŒ€

Bookmarks are selectable when tabbing in the :cd command.

Note: The bookmarks ' (Apostrophe) and ` (Backtick) are the same. πŸ™ˆ


πŸ”« RIFLE πŸ”«

Rifle is the file opener of ranger. It can be used as a standalone program or a python module. It is located at $repo/ranger/ext/rifle.py. In contrast to other, more simple file openers, rifle can automatically find installed programs so it can be used effectively out of the box on a variety of systems. πŸ”₯

It’s configured in rifle.conf through a list of conditions and commands. For each line the conditions are checked and if they are met, the respective command is taken into consideration. By default, simply the first matching rule is used. In ranger, you can list and choose rules by typing r or simply by typing "<rulenumber><enter>". If you use rifle standalone, you can list all rules with the -l option and pick a rule with -p <number>.

The rules, along with further documentation, are contained in $repo/ranger/config/rifle.conf.


🌈 FLAGS 🌈

Flags give you a way to modify the behavior of the spawned process. They are used in the commands :open_with (key r) and :shell (key !).

  • f β€” Fork the process, i.e. run in background. Please use this flag instead of calling disown or nohup, to avoid killing the background command when pressing Ctrl+C in ranger.
  • c β€” Run the current file only, instead of the selection
  • r β€” Run application with root privilege (requires sudo)
  • t β€” Run application in a new terminal window

There are some additional flags that can currently be used only in the "shell" command: (for example :shell -w df)

  • p β€” Redirect output to the pager
  • s β€” Silent mode. Output will be discarded.
  • w β€” Wait for an Enter-press when the process is done

By default, all the flags are off unless otherwise specified in rc.conf key bindings or rifle.conf rules. You can specify as many flags as you want. An uppercase flag negates the effect: ffcccFsf is equivalent to cs.

The terminal program name for the "t" flag is taken from the environment variable $TERMCMD. If it doesn’t exist, it tries to extract it from $TERM, uses "x-terminal-emulator" as a fallback, and then "xterm" if that fails.

Examples: :open_with c will open the file that you currently point at, even if you have selected other files. :shell -w df will run df and wait for you to press Enter before switching back to ranger. πŸ’…


🧚 PLUGINS 🧚

ranger’s plugin system consists of python files which are located in ~/.config/ranger/plugins/ and are imported in alphabetical order when starting ranger. A plugin changes ranger’s behavior by overwriting or extending a function that ranger uses. This allows you to change pretty much every part of ranger, but there is no guarantee that things will continue to work in future versions as the source code evolves. 😭

Adding new commands via a plugin is as simple as specifying them like you would do in the commands.py.

There are some hooks that are specifically made for the use in plugins. They are functions that start with hook_ and can be found throughout the code. πŸͺ

grep 'def hook_' -r /path/to/rangers/source

Also try:

pydoc ranger.api

Note that you should NOT simply overwrite a function unless you know what you’re doing. Instead, save the existing function and call it from your new one. This way, multiple plugins can use the same hook. There are several sample plugins in the /usr/share/doc/ranger/examples/ directory, including a hello-world plugin that describes this procedure. 🌸

✨ KEY BINDINGS ✨

So all the key bindings live in the file %rangerdir/config/rc.conf β€” that's literally the whole list, bestie, go look at it. If you want your own copy in your local config directory, just run --copy-config=rc and it's yours to edit πŸ’–

And here's the cute part: loooots of key bindings take a numeric argument. Like, you can type 5j and you move down 5 lines. Type 2l and you open a file in mode 2. Type 10<Space> and boom, 10 files marked. It's giving vim energy, iykyk πŸŽ€

This next list is the most useful ones β€” not all of them, so don't come for me.

πŸŽ€ MAIN BINDINGS πŸŽ€

  • h, j, k, l β€” Move left, down, up or right. The holy quartet, periodt.
  • ^D or J, ^U or K β€” Move a half page down, up.
  • H, L β€” Move back and forward in the history. Time travel, lowkey.
  • gg β€” Move to the top.
  • G β€” Move to the bottom.
  • [, ] β€” Move up and down in the parent directory.
  • ^R β€” Reload everything. The "have you tried turning it off and on again" of ranger ✨
  • F β€” Toggle the freeze_files setting. When it's active (you'll see a cyan FROZEN message in the status bar, iconic), directories and files will not be loaded β€” which is a huge performance glow-up when all the files you need are already loaded. Heads up tho: this does not affect file previews, those get toggled with zp. Also try disabling the preview of directories with zP if you're feeling extra.
  • ^L β€” Redraw the screen. A little refresh, a little self-care πŸ’…
  • i β€” Inspect the current file in a bigger window. Main character energy for whatever file you're looking at.
  • E β€” Edit the current file in $VISUAL, otherwise $EDITOR, otherwise "vim".
  • S β€” Open a shell in the current directory.
  • ? β€” Opens this man page. Hi, that's me, you're reading me 🫢
  • W β€” Opens the log window, where you can review messages that pop up at the bottom.
  • w β€” Opens the task window, where you can view and modify background processes that currently run in ranger. In there, you can type "dd" to abort a process and "J" or "K" to change the priority of a process. Just so you know: only one process is run at a time.
  • ^C β€” Stop the currently running background process that ranger has started β€” like copying files, loading directories or file previews.
  • <octal>=, +<who><what>, -<who><what> β€” Change the permissions of the selection. For example, "777=" is equivalent to "chmod 777 %s", "+ar" does "chmod a+r %s", "-ow" does "chmod o-w %s" etc. Perms queen πŸ‘‘
  • yy β€” Copy (yank) the selection, like pressing Ctrl+C in modern GUI programs. (You can also type "ya" to add files to the copy buffer, "yr" to remove files again, or "yt" for toggling.)
  • dd β€” Cut the selection, like pressing Ctrl+X in modern GUI programs. (There are also "da", "dr" and "dt" shortcuts equivalent to "ya", "yr" and "yt".)
  • pp β€” Paste the files which were previously copied or cut, like pressing Ctrl+V in modern GUI programs.

Conflicts will be renamed by appending an '_' (and a counter if necessary), resulting in "file.ext_", "file.ext_0", etc. If you prefer "file_.ext" you can use the "paste_ext" command. So considerate, honestly 😭

  • po β€” Paste the copied/cut files, overwriting existing files. Bold. Dangerous. No undo, bestie πŸ’€
  • pP, pO β€” Like pp and po, but queues the operation so that it will be executed after any other operations. Reminder: type "w" to open the task window.
  • pl, pL β€” Create symlinks (absolute or relative) to the copied files.
  • phl β€” Create hardlinks to the copied files.
  • pht β€” Duplicate the subdirectory tree of the copied directory, then create hardlinks for each contained file into the new directory tree.
  • mX β€” Create a bookmark with the name X.
  • `X β€” Move to the bookmark with the name X.
  • n β€” Find the next file. By default, this gets you to the newest file in the directory, but if you search something using the keys /, cm, ct, ..., it will get you to the next found entry.
  • N β€” Find the previous file.
  • oX β€” Change the sort method (like in mutt).
  • zX β€” Change settings. See the settings section for a list of settings and their hotkey.
  • u? β€” Universal undo-key. Depending on the key that you press after "u", it either restores closed tabs (uq), removes tags (ut), clears the copy/cut buffer (ud), starts the reversed visual mode (uV) or clears the selection (uv). One key, five personality traits 🌈
  • f β€” Quickly navigate by entering a part of the filename.
  • Space β€” Mark a file.
  • v β€” Toggle the mark-status of all files.
  • V β€” Starts the visual mode, which selects all files between the starting point and the cursor until you press ESC. To unselect files in the same way, use "uV".
  • / β€” Search for files in the current directory.
  • : β€” Open the console.
  • ! β€” Open the console with the content "shell " so you can quickly run commands.
  • @ β€” Open the console with the content "shell %s", placing the cursor before the " %s" so you can quickly run commands with the current selection as the argument.
  • r β€” Open the console with the content "open with " so you can decide which program to use to open the current file selection.
  • cd β€” Open the console with the content "cd ".
  • ^P β€” Open the console with the most recent command. Muscle memory slay.
  • Alt-N β€” Open a tab. N has to be a number from 0 to 9. If the tab doesn't exist yet, it will be created. Manifesting tabs into existence ✨
  • Alt-l, Alt-r β€” Shift a tab left, respectively right.
  • gn, ^N β€” Create a new tab.
  • gt, gT β€” Go to the next or previous tab. You can also use TAB and SHIFT+TAB instead.
  • gc, ^W β€” Close the current tab. The last tab cannot be closed this way β€” sorry, you gotta keep at least one alive πŸ˜”
  • ~ β€” Toggle between viewmodes. See viewmode in the SETTINGS section.
  • M β€” A key chain that allows you to quickly change the line mode of all the files of the current directory. For a more permanent solution, use the command "default_linemode" in your rc.conf.
  • .d β€” Apply the typefilter "directory".
  • .f β€” Apply the typefilter "file".
  • .l β€” Apply the typefilter "symlink".
  • .m β€” Apply a new mimetype filter.
  • .n β€” Apply a new filename filter.
  • .# β€” Apply a new hash filter.
  • ." β€” Apply a new duplicate filter.
  • .' β€” Apply a new unique filter.
  • .| β€” Combine the two topmost filters from the filter stack in the "OR" relationship, instead of the "AND" used implicitly.
  • .& β€” Explicitly combine the two topmost filters in the "AND" relationship. Usually not needed because filters are implicitly in this relationship though might be useful in more complicated scenarios.
  • .! β€” Negate the topmost filter.
  • .r β€” Rotate the filter stack by N elements. Where N is provided as a numeric prefix like vim's count and defaults to 1, i.e. move the topmost element to the bottom of the stack.
  • .c β€” Clear the filter stack.
  • .* β€” Decompose the topmost filter combinator (e.g. ".!", ".|").
  • .p β€” Pop the topmost filter from the filter stack.
  • .. β€” Show the current filter stack state.

🌸 READLINE-LIKE BINDINGS IN THE CONSOLE 🌸

Yeah, the console gets its own little emacs-flavoured moment πŸ’œ

  • ^B, ^F β€” Move left and right (B for back, F for forward).
  • ^P, ^N β€” Move up and down (P for previous, N for Next).
  • ^A, ^E β€” Move to the start or to the end.
  • Alt-B, Alt-LEFT β€” Move backwards by words.
  • Alt-F, Alt-RIGHT β€” Move forwards by words.
  • ^D β€” Delete the current character.
  • ^H β€” Backspace.

πŸ–±οΈ MOUSE BUTTONS πŸ–±οΈ

Yes bestie, you can click. Go off.

Left Mouse Button

Click on something and you'll move there. That's it. That's the whole vibe 🫢

Right Mouse Button

Enter a directory or run a file. To run a file you can either right click the file in the main column or right click on the preview. Two ways to do the same thing, we love options ✨

Scroll Wheel

Scrolls up or down. Cute trick: you can point at the column of the parent directory while scrolling to switch directories. Sneaky. Iconic. πŸŽ€


πŸ‘‘ SETTINGS πŸ‘‘

This section lists all the built-in settings of ranger. The valid types for the value are in [brackets]. The hotkey to toggle the setting is in <brackets>, if a hotkey exists.

Settings can be changed in the file ~/.config/ranger/rc.conf or on the fly with the command :set option value. Examples:

set column_ratios 1,2,3
set show_hidden true

Toggling options can be done with:

set show_hidden!

The different types of settings and an example for each type:

  • bool β€” example values: true, false
  • integer β€” example values: 1, 23, 1337
  • string β€” example values: foo, hello world
  • list β€” example values: 1,2,3,4
  • none β€” example values: none

You can view a list of all settings and their current values by pressing "3?" in ranger. Do it, it's so satisfying πŸ’…


  • automatically_count_files [bool] β€” Should ranger count and display the number of files in each directory as soon as it's visible? Ngl this gets slow with remote file systems. Turning it off will still allow you to see the number of files after entering the directory, so no stress πŸ’–
  • autosave_bookmarks [bool] β€” Save bookmarks (used with mX and `X) instantly? This helps to synchronize bookmarks between multiple ranger instances but leads to slight performance loss. When false, bookmarks are saved when ranger is exited.
  • autoupdate_cumulative_size [bool] β€” You can display the "real" cumulative size of directories by using the command :get_cumulative_size or typing "dc". The size is expensive to calculate and will not be updated automatically. You can choose to update it automatically though by turning on this option. Fancy but it costs you 😭
  • cd_bookmarks [bool] β€” Specify whether bookmarks should be included in the tab completion of the "cd" command.
  • cd_tab_case [string] β€” Changes case sensitivity for the "cd" command tab completion. Possible values are:
    • sensitive
    • insensitive
    • smart
  • cd_tab_fuzzy [bool] β€” Use fuzzy tab completion with the "cd" command. For example, :cd /u/lo/b<TAB> expands to :cd /usr/local/bin. Witchcraft. Obsessed.
  • clear_filters_on_dir_change [bool] β€” If set to 'true', persistent filters would be cleared upon leaving the directory.
  • collapse_preview [bool] <zc> β€” When no preview is visible, should the last column be squeezed to make use of the whitespace?
  • colorscheme [string] β€” which colorscheme are we vibing with today? πŸ’… the ones that ship by default are default, jungle, and snow. snow is the monochrome one (very clean, very minimal), and jungle swaps the blue directories out for green ones so they actually pop on certain terminals. pick your aesthetic.
  • column_ratios [list] β€” how many columns do you want, and how wide is each one relative to the others? πŸŽ€ like, 1,1,1 = three evenly sized columns. and 1,1,1,1,4 = five columns where the preview column is as big as all the other columns combined. math but make it fashion.
  • confirm_on_delete [string] β€” should ranger ask "bestie are you sure" before running the delete command? valid values are "always", "never", and "multiple" (that's the default). with "multiple", ranger only double-checks if you're deleting multiple files at once.
  • confirm_on_trash [string] β€” same question but for the trash command? valid values are "always", "never", "multiple", and "like_delete" (default). with "like_delete", ranger just honors whatever you set in confirm_on_delete instead. iykyk.
  • dirname_in_tabs [bool] β€” show the directory name in the tabs? ✨
  • display_size_in_main_column [bool] β€” show file sizes in the main column? πŸ‘€
  • display_size_in_status_bar [bool] β€” show file sizes down in the status bar?
  • display_free_space_in_status_bar [bool] β€” show free disk space in the status bar? (yes, the "am i about to run out of room" vibe check 🫢)
  • display_tags_in_all_columns [bool] β€” show tags in every column?
  • draw_borders [string] β€” draw borders around or between the columns? the options are giving:
none           no borders of any sort
outline        draw an outline around all the columns
separators     draw only vertical lines between columns
both           both of the above
  • draw_borders_multipane [string] β€” draw borders around or between the panes. this setting overrides draw_borders specifically for the multipane viewmode, in case you want different border styles in each viewmode. there's one extra legal value on top of all the draw_borders ones:
active-pane    draw an outline around the active pane only
  • draw_progress_bar_in_status_bar [bool] β€” draw a progress bar in the status bar showing the average state of all currently running tasks that support progress bars? πŸ”₯ very satisfying to watch ngl.
  • filter_dead_tabs_on_startup [bool] β€” remove tabs with unavailable paths on startup? setting this to false (which is the default) keeps all saved tabs, even if their path is no longer reachable. lowkey useful when you've got tabs pointing at removable media or network volumes. πŸ’Ύ
  • flushinput [bool] <zI> β€” flush the input after each key hit? one advantage: when you're scrolling down with j, ranger stops scrolling instantly the moment you release the key. one disadvantage: if you type commands blindly, some keys might get lost. 😭
  • freeze_files [bool] <F> β€” when active, directories and files won't be loaded, which boosts performance when all the files you need are already loaded. this does not affect file previews.
  • global_inode_type_filter [string] β€” like filter_inode_type, but globally for all directories. super useful in combination with --choosedir:
ranger --choosedir=/tmp/x --cmd='set global_inode_type_filter d'
  • hidden_filter [string] β€” a regular expression pattern for files that should be hidden. for example, this pattern hides all files that start with a dot or end with a tilde:
set hidden_filter ^\.|~$
  • hint_collapse_threshold [int] β€” key hint lists up to this size get their sublists expanded. anything bigger has its submaps replaced with .... (keeps the hints from becoming an essay πŸ’€)
  • hostname_in_titlebar [bool] β€” show the hostname in the titlebar?
  • size_in_bytes [bool] β€” print file sizes in bytes instead of the default human-readable format.
  • binary_size_prefix [bool] β€” show large file sizes with binary unit prefixes β€” kibibytes=Ki, mebibytes=Mi etc. β€” instead of the default decimal prefixes β€” kilobytes=k, megabytes=M etc. each binary unit prefix means 1024=2^10 of the preceding unit prefix (there are 1024 KiB in 1 MiB), as opposed to decimal unit prefixes, which mean a 1000 of the preceding unit prefix (there are 1000 kB in 1 MB). nerd moment but it's correct ✨
  • idle_delay [integer] β€” the delay that ranger idly waits for user input, in milliseconds, with a resolution of 100ms. a lower delay reduces lag between directory updates but increases CPU load. tradeoffs, bestie 🫠
  • iterm2_font_height [integer] β€” change the assumed font height in iTerm2, which may help with iTerm image previews.
  • iterm2_font_width [integer] β€” change the assumed font width in iTerm2, which may help with iTerm image previews.
  • line_numbers [string] β€” show line numbers in the main column? possible values:
false      turn the feature off
absolute   absolute line numbers for use with "<N>gg"
relative   relative line numbers for "<N>k" or "<N>j"
  • max_console_history_size [integer, none] β€” how many console commands should be kept in history? "none" disables the limit. πŸŽ€
  • max_history_size [integer, none] β€” how many directory changes should be kept in history?
  • metadata_deep_search [bool] β€” when the metadata manager module looks for metadata, should it only look for a .metadata.json file in the current directory, or do a deep search and check all the directories above the current one as well? πŸ‘‘
  • mouse_enabled [bool] <zm> β€” enable mouse input? πŸ–±οΈ
  • nested_ranger_warning [string] β€” warn at startup if RANGER_LEVEL is greater than 0 β€” in other words, warn you when you nest ranger in a subshell started by ranger. allowed values are "true", "false", and "error". the special value "error" promotes the warning to an actual error; this is usually shown as red text, but it will crash ranger when run with the --debug flag. πŸ’€ proceed accordingly.
  • one_indexed [bool] β€” start line numbers from 1? possible values:
false      start line numbers from 0
true       start line numbers from 1
  • open_all_images [bool] β€” open all images in this directory when running certain image viewers like feh or sxiv? you can still open selected files by marking them. if there would be too many files for the system to handle, this option gets temporarily disabled automatically. 😌 safety first.
  • padding_right [bool] β€” when collapse_preview is on and there's no preview, should a little padding remain on the right? this lets you right click into that space to run the file. clever lil feature fr.
  • preview_directories [bool] <zP> β€” preview directories in the preview column? 🌸
  • preview_files [bool] <zp> β€” preview files in the preview column?
  • preview_images [bool] <zi> β€” draw images inside the console with the external program w3mimgpreview? πŸ–ΌοΈ
  • preview_images_method [string] β€” set the preview image method. supported methods: w3m, iterm2, urxvt, urxvt-full, terminology. see the PREVIEWS section. πŸ‘€
  • preview_max_size [int] β€” avoid previewing files that exceed a certain size, in bytes. use a value of 0 to disable this feature. (protects you from trying to preview a 40GB file lmaooo)
  • preview_script [string, none] β€” which script should handle generating previews? if the file doesn't exist, or use_preview_script is off, ranger handles previews itself by just printing the content. simple as that πŸ’…
  • relative_current_zero [bool] β€” when line_numbers is set to relative, show 0 on the current line if true, or show the absolute number of the current line when false.
  • save_backtick_bookmark [bool] β€” save the ` bookmark to disk? this bookmark is what you use to switch to the last directory by typing ``. πŸŽ€
  • save_console_history [bool] β€” should the console history be saved on exit? if disabled, the console history gets reset when you restart ranger.
  • save_tabs_on_exit [bool] β€” save all tabs, except the active one, on exit? the last saved tabs are restored once when starting the next session. multiple sessions are stored in a stack, and the oldest saved tabs are restored first. πŸ—‚οΈ
  • scroll_offset [integer] β€” try to keep this much space between the top/bottom border when scrolling. (breathing room, bestie ✨)
  • shorten_title [integer] β€” trim the window title if it gets long? the number defines how many directories are displayed at once. a value of 0 turns this feature off.
  • show_cursor [bool] β€” always show the terminal cursor? πŸ‘‘
  • show_hidden_bookmarks [bool] β€” show dotfiles in the bookmark preview window? (type ' to get there)
  • show_hidden [bool] <zh>, <^H> β€” show hidden files? πŸ™ˆ
  • show_selection_in_titlebar [bool] β€” add the highlighted file to the path in the titlebar.
  • sort_case_insensitive [bool] <zc> β€” sort case-insensitively? if true, "a" gets listed before "B" even though its ASCII value is higher. πŸ’…
  • sort_directories_first [bool] <zd> β€” sort directories first? πŸŽ€
  • sort_reverse [bool] <or> β€” reverse the order of files?
  • sort_unicode [bool] β€” when sorting according to some string, should unicode characters be compared, instead of looking at the raw character values to save time? 🌈
  • sort [string] <oa>, <ob>, <oc>, <oe>, <om>, <on>, <ot>, <os>, <oz> β€” which sorting mechanism should be used? choose one of atime, basename, ctime, extension, mtime, natural, type, size, random.
note: you can reverse the order by typing an uppercase second letter in the key combination, e.g. "oN" to sort from Z to A. πŸ”₯
  • status_bar_on_top [bool] β€” put the status bar at the top of the window?
  • tilde_in_titlebar [bool] β€” abbreviate $HOME with ~ in the titlebar (first line) of ranger? 🏠
  • unicode_ellipsis [bool] β€” use a unicode "..." character instead of "~" to mark cut-off filenames? ✨
  • bidi_support [bool] β€” try to properly display file names in RTL languages (Hebrew, Arabic) by using a BIDI algorithm to reverse the relevant parts of the text. requires the python-bidi pip package. 🧚
  • update_title [bool] β€” set a window title? updates both the WM_NAME and WM_ICON_NAME properties.
  • update_tmux_title [bool] β€” set the tmux/screen window-name to "ranger"? 🫢
  • use_preview_script [bool] <zv> β€” use the preview script defined in the preview_script setting?
  • vcs_aware [bool] β€” gather and display data about version control systems. supported vcs: git, hg. πŸ‘‘
  • vcs_backend_git, vcs_backend_hg, vcs_backend_bzr, vcs_backend_svn [string] β€” sets the state for the version control backend. possible values:
disabled   Don't display any information.
local      Display only local state.
enabled    Display both, local and remote state.
           May be slow for hg and bzr.
heads up: enabled may be slow for hg and bzr, so don't come for me when it lags 😭
  • vcs_msg_length [int] β€” how many characters of the first line of a commit message you get before it gets chopped when it's chilling in the statusbar. Defaults to 50. Short and sweet, bestie.
  • viewmode [string] β€” sets the view mode, and it's giving two flavors: miller shows files in the classic miller column view (multiple levels of the hierarchy, all lined up, v aesthetic) or multipane which uses multiple panes β€” one per tab β€” similar to midnight-commander. Choose your fighter ✨
  • w3m_delay [float] β€” the delay in seconds before an image gets displayed with the w3m method. Bump it up if you're experiencing display corruption, no cap.
  • w3m_offset [int] β€” offset in pixels for the inner border of the terminal. Some terminals require the offset to be specified explicitly β€” among others st and UXterm β€” and some don't like urxvt. πŸ™ˆ Terminals are so dramatic honestly.
  • sixel_dithering [string] β€” one of the dithering methods supported by convert, used for SIXEL image previews.

convert currently supports the following dithering methods:

  • None β€” no dithering
  • Riemersma β€” dithering along a Hilbert curve with restricted error proliferation
  • FloydSteinberg β€” error diffusion dithering
  • wrap_plaintext_previews [bool] β€” whether or not to wrap long lines in the pager. This includes previews of plain text files, fyi.
  • wrap_scroll [bool] β€” enables scroll wrapping πŸŒ€ β€” moving down while on the last item wraps around to the top, and vice versa. Iconic circular behavior.
  • xterm_alt_key [bool] β€” turn this on if key combinations with the Alt key just don't work for you. (Especially on xterm.) She's picky like that πŸ’…

πŸ’… COMMANDS πŸ’…

okay so you can enter commands in the console, which opens when you press :. main character moment.

You can always get a list of the currently existing commands by typing ?c in ranger. And for your convenience, here's the list of the "public" commands including their parameters, excluding descriptions β€” look at all these queens:

alias [newcommand] [oldcommand]
bulkrename
cd [path]
chain command1[; command2[; command3...]]
chmod octal_number
cmap key command
console [-pSTARTPOSITION | -s SENTINEL] command
copycmap key newkey [newkey2...]
copymap key newkey [newkey2...]
copypmap key newkey [newkey2...]
copytmap key newkey [newkey2...]
cunmap keys...
default_linemode [path=regexp | tag=tags] linemodename
delete
echo [text]
edit [filename]
eval [-q] python_code
filter [string]
filter_inode_type [dfl]
find pattern
flat level
grep pattern
help
jump_non [-FLAGS...]
linemode linemodename
load_copy_buffer
map key command
mark pattern
mark_tag [tags]
meta key value
mkdir dirname
open_with [application] [flags] [mode]
pmap key command
prompt_metadata [key1 [key2 [...]]]
punmap keys...
quit
quit!
quitall
quitall!
relink newpath
rename_append [-FLAGS...]
rename newname
save_copy_buffer
scout [-FLAGS...] pattern
search pattern
search_inc pattern
set option value
setinpath [path=<path>] option value
setinregex [re=<regex>] option value
setintag tags option value
setlocal [path=<path>] option value
shell [-FLAGS...] command
source filename
terminal
tmap key command
touch filename
trash
travel pattern
tunmap keys...
unmap keys...
unmark pattern
unmark_tag [tags]

There are additional commands which are directly translated to python functions β€” one for every method in the ranger.core.actions.Actions class. They are not documented here, because they're mostly for key bindings and not for you to type in by hand. Read the source if you're interested in them πŸ‘€ iykyk.

And these are the public commands including their descriptions β€” grab a snack, this is a long one:

  • alias [newcommand] [oldcommand] β€” copies the oldcommand as newcommand. Basically a glow-up for a command ✨
  • bulkrename β€” this command opens a list of selected files in an external editor. After you edit and save the file, it will generate a shell script which does bulk renaming according to the changes you did in the file.

This shell script is opened in an editor for you to review. After you close it, it will be executed. So like, you get a vibe check before anything happens πŸ’–

  • cd [path] β€” the cd command changes the directory. If path is a file, it selects that file. The command :cd - is equivalent to typing ``. (yes, the original really renders exactly like that, two lonely backticks β€” not me questioning the manpage πŸ’€)
  • chain command1[; command2[; command3...]] β€” combines multiple commands into one, separated by semicolons. Combo move.
  • chmod octal_number β€” sets the permissions of the selection to the octal number.

The octal number is between 000 and 777. The digits specify the permissions for the user, the group and others. A 1 permits execution, a 2 permits writing, a 4 permits reading. Add those numbers to combine them. So a 7 permits everything. She ate and left no crumbs πŸ‘‘

Key bindings in the form of [-+]<who><what> and <octal>= also exist. For example, +ar allows reading for everyone, -ow forbids others to write and 777= allows everything.

See also: man 1 chmod

  • console [-pN | -s sentinel] command β€” opens the console with the command already typed in. The cursor is placed at N or at the first occurrence of sentinel. Note that sentinel strings can potentially occur inside macro expansions. If you cannot provide a sentinel which is guaranteed to be unique, you should use -p. fr fr, just use -p.
  • copymap key newkey [newkey2 ...]
  • copycmap key newkey [newkey2 ...]
  • copypmap key newkey [newkey2 ...]
  • copytmap key newkey [newkey2 ...]

Copies the keybinding key to newkey in the "browser" context. This is a deep copy, so if you change the new binding (or parts of it) later, the old one is not modified. For example, copymap j down will make the key sequence "down" move the cursor down one item.

To copy key bindings of the console, pager or taskview use copycmap, copypmap or copytmap respectively. Pick the right one bestie 🫢

  • default_linemode [path=regexp | tag=tags] linemodename β€” sets the default linemode. See linemode command.

Examples:

Set the global default linemode to "permissions":

:default_linemode permissions

Set the default linemode to "permissions" for all files tagged with "p" or "P":

:default_linemode tag=pP permissions

Set the default linemode for all files in ~/books/ to "metatitle":

:default_linemode path=/home/.*?/books/.* metatitle
  • delete β€” destroy all files in the selection with a roundhouse kick πŸ₯‹ ranger will ask for a confirmation if you attempt to delete multiple (marked) files or non-empty directories. This can be changed by modifying the setting confirm_on_delete. Careful with this one, it's giving danger.
  • echo text β€” display the text in the statusbar. Little message to yourself πŸ’Œ
  • edit [filename] β€” edit the current file or the file in the argument.
  • eval [-q] python_code β€” evaluates the python code. fm is a reference to the FM instance. To display text, use the function p. The result is displayed on the screen unless you use the -q option.

Examples:

:eval fm
:eval len(fm.tabs)
:eval p("Hello World!")
  • filter [string] β€” displays only the files which contain the string in their basename. Running this command without any parameter will reset the filter.

This command is based on the scout command and supports all of its options.

  • filter_inode_type [dfl] β€” displays only the files of specified inode type. To display only directories, use the d parameter. To display only files, use the f parameter. To display only links, use the l parameter. Parameters can be combined. To remove this filter, use no parameter. Mix and match, it's a whole aesthetic 🌈
  • filter_stack [command [args]] β€” manage the filter stack, adding, removing and manipulating filters. For example, to show only duplicate files and symlinks:
:filter_stack add type f
:filter_stack add duplicate
:filter_stack add and
:filter_stack add type l
:filter_stack add or

Or using the mapped keys:

.f ." .& .l .|

Available subcommands:

  • add FILTER_TYPE [ARGS...] β€” add a new filter to the top of the filter stack. Each filter on the stack is applied in turn, resulting in an implicit logical "AND" relation. The following "FILTER_TYPE"s are available:
    • duplicate β€” filter files so only files that have duplicates in the same directory are shown. Useful when cleaning up identical songs and memes that were saved using distinct file names 😭 we've all been there.
    • name NAME β€” filter files that contain NAME in the filename, regular expression syntax is allowed.
    • hash PATH β€” filter files so only files with the same hash as PATH are shown.
    • mimetype TYPE β€” filter files of a certain MIME type, regular expression syntax is allowed.
    • typefilter [d|f|l] β€” filter files of a certain type, "d" for directories, "f" for files and "l" for symlinks.
    • unique β€” filter files so only unique files and the oldest file of every set of duplicates is shown.
    • and β€” explicitly combine the two topmost filters in the "AND" relationship. Usually not needed because filters are implicitly in this relationship though might be useful in more complicated scenarios.
    • not β€” negate the topmost filter.
    • or β€” combine the two topmost filters from the filter stack in the "OR" relationship, instead of the "AND" used implicitly.
  • pop β€” pop the topmost filter from the filter stack.
  • decompose β€” decompose the topmost filter combinator (e.g. .!, .|).
  • rotate [N=1] β€” rotate the filter stack by N elements. Where N is passed as argument or as a numeric prefix like vim's count, default to 1 β€” i.e. move the topmost element to the bottom of the stack.
  • clear β€” clear the filter stack.
  • show β€” show the current filter stack state.
  • find pattern β€” search files in the current directory that contain the given (case-insensitive) string in their name as you type. Once there is an unambiguous result, it will be run immediately. (Or entered, if it's a directory.) Live search realness ✨

This command is based on the scout command and supports all of its options.

  • flat level β€” flattens the directory view up to the specified level. Level -1 means infinite level. Level 0 means standard view without flattened directory view. Level values -2 and less are invalid. Don't go there πŸ™…
  • grep pattern β€” looks for a string in all marked files or directories.
  • help β€” provides a quick way to view ranger documentations. The answer is right there bestie πŸ’–
  • jump_non [-flags...] β€” jumps to first non-directory if highlighted file is a directory and vice versa.

Flags:

  • -r β€” jump in reverse order
  • -w β€” wrap around if reaching end of filelist

linemode linemodename β€” okay so this one sets the linemode for every file in the current directory, bestie. The linemode can be:

  • "filename" β€” display each line as "<basename>...<size>"
  • "fileinfo" β€” display each line as "<basename>...<file(1) output>"
  • "mtime" β€” display each line as "<basename>...<mtime>" in ISO format
  • "humanreadablemtime" β€” display each line as "<basename>...<mtime>" in a human readable format, more precise the more recent.
  • "sizemtime" β€” display each line as "<basename>...<size> <mtime>" in ISO format
  • "sizehumanreadablemtime" β€” display each line as "<basename>...<size> <mtime>" in a human readable format, more precise the more recent.
  • "permissions" β€” display each line as "<permissions> <owner> <group> <basename>"
  • "metatitle" β€” display metadata from .metadata.json files if available, fall back to the "filename" linemode if no metadata was found. See :meta command.

The custom linemodes may be added by subclassing the LinemodeBase class. See the ranger.core.linemode module for some examples. iykyk ✨

load_copy_buffer β€” loads the copy buffer from ~/.config/ranger/copy_buffer. This can be used to pass the list of copied files to another ranger instance. literally passing the aux cord between ranger sessions 🫢

  • map key command
  • cmap key command
  • pmap key command
  • tmap key command

Assign the key combination to the given command. Whenever you type the key/keys, the command will be executed. Additionally, if you use a quantifier when typing the key, like 5j, it will be passed to the command as the attribute "self.quantifier".

The keys you bind with this command are accessible in the file browser only, not in the console, pager or taskview. To bind keys there, use the commands "cmap", "pmap" or "tmap". πŸ’…

mark pattern β€” mark all files matching the regular expression pattern.

This command is based on the scout command and supports all of its options. scout girlies stay winning 🌸

mark_tag [tags] β€” mark all tags that are tagged with either of the given tags. When leaving out the tag argument, all tagged files are marked. πŸŽ€

meta key value β€” set the metadata of the currently highlighted file. Example:

:meta title The Hitchhiker's Guide to the Galaxy
:meta year 1979

This metadata can be displayed by, for example, using the "metatitle" line mode by typing Mt. iconic little metadata moment ⭐

mkdir dirname β€” creates a directory with the name dirname. new folder just dropped πŸ¦‹

open_with [application] [flags] [mode] β€” open the selected files with the given application, unless it is omitted, in which case the default application is used. flags change the way the application is executed and are described in their own section in this man page. The mode is a number that specifies which application to use. The list of applications is generated by the external file opener "rifle" and can be displayed when pressing "r" in ranger.

Note that if you specify an application, the mode is ignored. no cap, mode gets ghosted πŸ‘‘

prompt_metadata [keys ...] β€” prompt the user to input metadata with the "meta" command for multiple keys in a row. πŸ’–

quit β€” closes the current tab, if there’s only one tab. Otherwise quits if there are no tasks in progress. The current directory will be bookmarked as ' so you can re-enter it by typing this little combo the next time you start ranger:

`` or ''

bookmark main character energy πŸŽ€

quit! β€” like "quit", except will force quit even if tasks are in progress. force quit is giving chaos, use responsibly πŸ’€

quitall β€” like "quit", except will quit even if multiple tabs are open.

quitall! β€” like "quitall", except will force quit even if tasks are in progress.

relink newpath β€” change the link destination of the current symlink file to <newpath>. First Tab will load the original link. symlink glow-up fr fr πŸ”₯

rename newname β€” rename the current file. If a file with that name already exists, the renaming will fail. Also try the key binding A for appending something to a file name. πŸ¦‹

rename_append [-flags...] β€” opens the console with ":rename <current file>" with the cursor positioned before the file extension.

Flags:

  • -a β€” Position before all extensions
  • -r β€” Remove everything before extensions

save_copy_buffer β€” save the copy buffer to ~/.config/ranger/copy_buffer. This can be used to pass the list of copied files to another ranger instance. copy buffer said β€œsave me” and ranger listened ✨

scout [-flags...] [--] pattern β€” Swiss army knife command for searching, traveling and filtering files.

Flags:

  • -a β€” Automatically open a file on unambiguous match
  • -e β€” Open the selected file when pressing enter
  • -f β€” Filter files that match the current search pattern
  • -g β€” Interpret pattern as a glob pattern
  • -i β€” Ignore the letter case of the files
  • -k β€” Keep the console open when changing a directory with the command
  • -l β€” Letter skipping; e.g. allow "rdme" to match the file "readme"
  • -m β€” Mark the matching files after pressing enter
  • -M β€” Unmark the matching files after pressing enter
  • -p β€” Permanent filter: hide non-matching files after pressing enter
  • -r β€” Interpret pattern as a regular expression pattern
  • -s β€” Smart case; like -i unless pattern contains upper case letters
  • -t β€” Apply filter and search pattern as you type
  • -v β€” Inverts the match

Multiple flags can be combined. For example, ":scout -gpt" would create a :filter-like command using globbing. combo flags ate πŸ’…

search pattern β€” search files in the current directory that match the given (case insensitive) regular expression pattern.

This command is based on the scout command and supports all of its options.

search_inc pattern β€” search files in the current directory that match the given (case insensitive) regular expression pattern. This command gets you to matching files as you type. live search is that girl 🌈

This command is based on the scout command and supports all of its options.

set option value β€” assigns a new value to an option. Valid options are listed in the settings section. Use tab completion to get the current value of an option, though this doesn’t work for functions and regular expressions. Valid values are:

  • bool β€” true, false
  • integer β€” 1, 23, 1337
  • string β€” foo, hello world
  • list β€” 1,2,3,4
  • none β€” none

setinpath [path=path] option value β€” assigns a new value to an option, but locally for the directory given by path. This means that this option only takes effect when visiting that directory. If no path is given, uses the current directory.

path can be quoted with either single or double quotes to prevent unwanted splitting, path='~/dl dl' or path="~/dl dl". You can use "pattern" rather than "path" for consistency with "setinregex". quote your paths, bestie πŸŽ€

setinregex [re=regex] option value β€” assigns a new value to an option, but locally for directories matching regex. This means that this option only takes effect when visiting such directories. If no regular expression is given, uses the current directory.

regex is a regular expression. This means that "re=~/dl" applies to all paths that start with ~/dl, e.g. ~/dl2 and ~/dl/foo. To avoid this, use "path=~/dl$". To specify a folder with special characters (.^$\*+?(){}[]|), escape them with a backslash.

regex can be quoted with either single or double quotes to prevent unwanted splitting,. re='~/dl dl$' or re="~/dl dl$". You can use "regex" rather than "re" to avoid having to remember the spelling and you can use "pattern" for consistency with "setinpath". regex girlies, this one’s for you 🧚

setintag tags option value β€” assigns a new value to an option, but locally for the directories that are marked with tag. This means that this option only takes effect when visiting that directory.

For example, to change the sorting order in your downloads directory, tag it with the v tag by typing "v, then use this command:

setintag v sort ctime

setlocal [path=path] option value β€” alias for "setinpath". short and sweet πŸ’–

shell [-flags] command β€” run a shell command. flags are discussed in their own section. πŸ¦‹

source filename β€” reads commands from a file and executes them in the ranger console.

This can be used to re-evaluate the rc.conf file after changing it:

map X chain shell vim -p %confdir/rc.conf %rangerdir/config/rc.conf; \
                            source %confdir/rc.conf

scroll_preview value β€” scroll the file preview by value lines. preview said scoot scoot ✨

terminal β€” spawns the x-terminal-emulator starting in the current directory. πŸ‘‘

touch filename β€” creates an empty file with the name filename, unless it already exists. tiny file, big main character energy 🌱

trash β€” move all files in the selection to the trash using rifle. Rifle tries to use a trash manager like trash-cli if available but will fall back to moving files to either $XDG_DATA_HOME/ranger/trash or ~/.local/share/ranger/trash. This is a less permanent version of delete, relying on the user to clear out the trash whenever it’s convenient. While having the possibility of restoring trashed files until this happens. ranger will ask for a confirmation if you attempt to trash multiple (marked) files or non-empty directories. This can be changed by modifying the setting "confirm_on_delete". it’s giving β€œless permanent delete,” not β€œno consequences delete” πŸ’€

travel pattern β€” filters the current directory for files containing the letters in the string, possibly with other letters in between. The filter is applied as you type. When only one directory is left, it is entered and the console is automatically reopened, allowing for fast travel. To close the console, press ESC or execute a file.

This command is based on the scout command and supports all of its options. fast travel unlocked πŸ¦‹

  • unmap [keys ...]
  • cunmap [keys ...]
  • punmap [keys ...]
  • tunmap [keys ...]

Removes the given key mappings in the "browser" context. To unmap key bindings in the console, pager, or taskview use "cunmap", "punmap" or "tunmap". unmap era πŸ’…

unmark pattern β€” unmark all files matching a regular expression pattern.

This command is based on the scout command and supports all of its options.

unmark_tag [tags] β€” unmark all tags that are tagged with either of the given tags. When leaving out the tag argument, all tagged files are unmarked. tag cleanup, periodt πŸŽ€

πŸ—‚οΈ FILES

okay so ranger reads several configuration files, and they live in $HOME/.config/ranger or in $XDG_CONFIG_HOME/ranger if $XDG_CONFIG_HOME is defined. you can use the --copy-config option to get the default configuration files, and those files contain further documentation. πŸ’…

rc.conf, commands.py and colorschemes do not need to be copied fully, because they only add to the default configuration files unless something is explicitly overridden. this can lead to some confusing situations β€” for example, when a key is still bound even though the corresponding line was removed from your copy of the config file. this behavior may be disabled with an environment variable (see also: ENVIRONMENT).

note bestie: all the other configuration files only read from one source; i.e. default OR user, not both. rc.conf and commands.py are additionally read from /etc/ranger if they exist for system-wide configuration, and user configuration overrides system configuration, which overrides the default configuration. πŸ‘‘

when you start ranger with the --clean option, it will not access or create any of these files.

🧩 CONFIGURATION

  • rc.conf β€” contains a list of commands which are executed on startup. mostly key bindings and settings are defined here.
  • commands.py β€” a python module that defines commands which can be used in ranger's console by typing : or in the rc.conf file. note that you can define commands in the same manner within plugins.
  • commands_full.py β€” this file is copied by --copy-config=commands_full and serves as a reference for custom commands. it is entirely ignored by ranger.
  • rifle.conf β€” this is the configuration file for the built-in file launcher called "rifle".
  • scope.sh β€” this is a script that handles file previews. when the options use_preview_script and preview_files are set, the program specified in the option preview_script is run and its output and/or exit code determines ranger's reaction.
  • colorschemes/ β€” colorschemes can be placed here.
  • plugins/ β€” plugins can be placed here.

πŸ’Ύ STORAGE

  • bookmarks β€” this file contains a list of bookmarks. the syntax is /^(.):(.*)$/. the first character is the bookmark key and the rest after the colon is the path to the file. in ranger, bookmarks can be set by typing m<key>, accessed by typing '<key> and deleted by typing um<key>.
  • copy_buffer β€” when running the command :save_copy_buffer, the paths of all currently copied files are saved in this file. you can later run :load_copy_buffer to copy the same files again, pass them to another ranger instance or process them in a script.
  • history β€” contains a list of commands that have been previously typed in.
  • tagged β€” contains a list of tagged files. the syntax is /^(.:)?(.*)$/ where the first letter is the optional name of the tag and the rest after the optional colon is the path to the file. in ranger, tags can be set by pressing t and removed with T. to assign a named tag, type "<tagname>.

🌱 ENVIRONMENT

these environment variables have an effect on ranger, bestie:

  • RANGER_LEVEL β€” ranger sets this environment variable to "1" or increments it if it already exists. external programs can determine whether they were spawned from ranger by checking for this variable.
  • RANGER_LOAD_DEFAULT_RC β€” if this variable is set to FALSE, ranger will not load the default rc.conf. this can save time if you copied the whole rc.conf to ~/.config/ranger/ and don't need the default one at all.
  • VISUAL β€” defines the editor to be used for the "E" key. falls back to EDITOR if undefined or empty.
  • EDITOR β€” defines the editor to be used for the "E" key if VISUAL is undefined or empty. defaults to "vim".
  • SHELL β€” defines the shell that ranger is going to use with the :shell command and the "S" key. defaults to "/bin/sh".
  • TERMCMD β€” defines the terminal emulator command that ranger is going to use with the :terminal command and the "t" run flag. defaults to "xterm".
  • BAT_STYLE β€” specifies the style to be used for syntax highlighting when bat is installed, unless highlight is also installed. find out possible values in bat's man page. this defaults to plain to make maximal use of horizontal space.
  • BAT_THEME β€” specifies the theme to be used for syntax highlighting when bat is installed, unless highlight is also installed. find out possible values by running bat --list-themes.
  • PYGMENTIZE_STYLE β€” specifies the theme to be used for syntax highlighting when pygmentize is installed, unless highlight is also installed. find out possible values by running:
python -c 'import pygments.styles; [print(stl) for stl in pygments.styles.get_all_styles()]'
  • HIGHLIGHT_STYLE β€” specifies the theme to be used for syntax highlighting when highlight is installed. find out possible values by running highlight --list-themes.
  • HIGHLIGHT_TABWIDTH β€” specifies the number of spaces to use to replace tabs in highlighted files.
  • HIGHLIGHT_OPTIONS β€” highlight will pick up command line options specified in this variable. a "--style=" option specified here will override "HIGHLIGHT_STYLE". similarly, "--replace-tabs=" will override "HIGHLIGHT_TABWIDTH".
  • OPENSCAD_COLORSCHEME β€” specifies the colorscheme used by openscad while previewing 3D models. read openscad man page for colorschemes. ranger will default to Tomorrow Night.
  • OPENSCAD_IMGSIZE β€” specifies the internal resolution openscad will use for rendering 3D models. the image will be downscaled to fit the preview pane. this resolution will default to "1000,1000" if no value is set.
  • XDG_CONFIG_HOME β€” specifies the directory for configuration files. defaults to $HOME/.config.
  • PYTHONOPTIMIZE β€” this variable determines the optimize level of python.
    • using PYTHONOPTIMIZE=1 (like python -O) will make python discard assertion statements. you will gain efficiency at the cost of losing some debug info.
    • using PYTHONOPTIMIZE=2 (like python -OO) will additionally discard any docstrings. using this will disable the F1 key on commands.
  • W3MIMGDISPLAY_PATH β€” by changing this variable, you can change the path of the executable file for image previews. by default, it is set to /usr/lib/w3m/w3mimgdisplay.

πŸ“ EXAMPLES

there are various examples on how to extend ranger with plugins or combine ranger with other programs. these can be found in the /usr/share/doc/ranger/examples/ directory, or the doc/ranger/ that is provided along with the source code. cute AND useful, we love to see it ✨

βš–οΈ LICENSE

GNU General Public License 3.

ranger is maintained with the git version control system. to fetch a fresh copy, run:

git clone git@github.com:ranger/ranger.git

πŸ‘€ SEE ALSO

rifle(1) β€” go give it a lil look too πŸ’…

πŸ› BUGS

Report bugs here: https://github.com/ranger/ranger/issues

please include as much relevant information as possible. for the most diagnostic output, run ranger like this:

PYTHONOPTIMIZE= ranger --debug

and that's the whole manual, bestie πŸ’– this was ranger-1.9.4, dated 2025-03-05 β€” go forth and slay your file manager era ✨🫢

πŸ“¦ where this page comes from