ranger.plugin.zsh

September 9, 2025 ยท View on GitHub

This repository hosts a tiny plugin for ranger integration into oh-my-zsh.

It provides:

  • a rr function to automatically change the current directory when quitting ranger.
  • a ranger_prompt function to customize your PROMPT, so you could quickly have an idea of the current RANGER_LEVEL.

Installation

You simply have to copy the ranger.plugin.zsh file into a custom/plugins/ranger directory of your oh-my-zsh installation.

For most installation, you could simply do

git clone https://github.com/NiziL/ranger.plugin.zsh ~/.oh-my-zsh/custom/plugins/ranger

Configuration

The plugin relies on few configuration variables:

NameDescriptionDefault
ZSH_THEME_RANGER_ONE_PROMPT_PREFIXRanger prompt prefix if RANGER_LEVEL == 1[
ZSH_THEME_RANGER_ONE_PROMPT_SUFFIXRanger prompt suffix if RANGER_LEVEL == 1]
ZSH_THEME_RANGER_ONE_BODYRanger prompt body if RANGER_LEVEL == 1ranger
ZSH_THEME_RANGER_MANY_PROMPT_PREFIXRanger prompt prefix if RANGER_LEVEL > 1[!
ZSH_THEME_RANGER_MANY_PROMPT_SUFFIXRanger prompt suffix if RANGER_LEVEL > 1!]
ZSH_THEME_RANGER_MANY_BODYRanger prompt body if RANGER_LEVEL > 1ranger