Skip to content

u/Flubberding

In this archive from Sep 2016 to May 2023

5
posts
47
comments
2
media
134
score

Top posts

Top comments

Me too. I like it customizability and flexibility. It's even better when combined with the ranger-plugin that come z.lua, which I have bound to cj (I used auto-jump before this, which used that binding as well).

I also really like how well it integrates with my keyboard-driven setup. I'm on i3 and I use a lot of programs that have similar keybindings, like Neovim and qutebrowser. i can even use it inside Neovim (including all settings and plugins).

12 points

Of course! Official instructions are here, but I'll type them out a bit more detailed anyways. After installing z.lua itself using the instructions on the Github page, you want to copy the file named "ranger_zlua.py" into ~/.config/ranger/plugins. Make sure to make the file executable if it isn't already. You can do that either manually or by running with this command:

wget https://github.com/skywind3000/z.lua/raw/master/ranger_zlua.pyi && chmod +x ~/.config/ranger/plugins/ranger_zlua.py 

Then add this environment variabe to either your shell's rc file or to your environment file (Which is at /etc/environment):

export RANGER_ZLUA="/path/to/z.lua"

If you don't know where z.lua is installed, you can simply run this command to find out it's directory:

 whereis z.lua

For me (and probably you as well) it should be like this:

 RANGER_ZLUA=/usr/share/z.lua/z.lua

Then you want to add the keybindings to Ranger. Open up the config with your text editor:

$EDITOR ~/.config/ranger/rc.conf 

I've added multiple variations to the end of this file, although I mainly use the basic cj binding. Customize the bindings and z.lua options to your liking. My bindings are:

# z.lua (Autojump-like)
map cj console z%space 
# z.lua - interactive resultselect with fzf
map cf console z%space-I%space
# z.lua - cd to parent dir starting from foo # z -b foo
map Cj console z%space-b%space
# z.lua - cd to child dir of PWD # z -c foo
map cJ console z%space-c%space

That should do it.

Unrelated bonus plugin: I also really like this mounting menu/script for when I plug in a USB stick. It doesn't seem to be very well known, but it should be as I find it to be very handy. To install, follow th instructions on the GB page. You can add a binding like I did like this:

# Udisk Mount Menu
map mm mount
4 points

Subreddits

Keyboard shortcuts

Move and act

jork
Next / previous post or comment
Enteroro
Open the post
f
Open the media viewer
s
Save
h
Hide (the toast has Undo)
Tab
Right after an action: the toast's Undo
x
Collapse the comment
v
Next layout: cards, compact, grid

Go to

/
Search
gthenh
Home
gthena
All
gthens
Subreddits
gthenl
Library
?
This list
Esc
Close a menu or this list

In the viewer

←or→
Previous / next file
↑or↓
Previous / next post
korj
Previous / next post
Space
Play / pause
m
Mute
z
Zoom
s
Save
o
Open the post (on its own page: back to it)
Esc
Close

Keys do nothing while you type in a box.