ranger / ranger

A VIM-inspired filemanager for the console
https://ranger.fm
GNU General Public License v3.0
15.57k stars 893 forks source link

[Feature Request] Loop file searching #2731

Closed DUOLabs333 closed 1 year ago

DUOLabs333 commented 1 year ago

Runtime Environment

Current Behavior

If I reach the end of a directory listing, or go to the beginning, it doesn't loop over.

Expected Behavior

The directory listing should loop

Context

I don't have the home or end key, so I can't jump to the end, so I want to be able to loop to get to the end or beginning of a listing.

Possible Solutions

If end of the listing is reached, go back up.

Steps to reproduce

Traceback

markus-bauer commented 1 year ago

There's a setting:

set wrap_scroll True

Or map:

map <DOWN>     move down=1 cycle=True
...

And you don't need a Home/End key.

map <HOME>     move to=0
map <END>      move to=-1
copymap <HOME>     gg
copymap <END>      G
DUOLabs333 commented 1 year ago

Oh wow. I didn't know I could do that. Thanks.

DUOLabs333 commented 1 year ago

Though for some reason, it's seeing my Delete key as zh, but I guess that's another issue.

toonn commented 1 year ago

I think that happens because the default config binds map <C-h> set show_hidden! (same binding as for zh), and your Delete key sends C-h in your terminal.

DUOLabs333 commented 1 year ago

Apparently, my Delete (Backspace) key is sending Ctrl+Shift+?

toonn commented 1 year ago

Both ^? and ^H are common control sequences sent by the backspace key. That's why the default config copies the map for "backspace" to <C-h>.

DUOLabs333 commented 1 year ago

Ah, is there a "noop" option in ranger I can bind ^? to?

toonn commented 1 year ago

You'd have to remove all the bindings for <backspace>, <backspace2>, <C-h> and <C-?> from rc.conf.

EDIT: Though I guess eval pass is pretty close to a No-Op.