Ranger Custom Settings

Basic

If you want to custom your ranger,you should do the below changes:

1
2
3
4
5
# In your .zshrc
export RANGER_LOAD_DEFAULT_RC=false

# In the console
ranger --copy-config=all

then,you’ll see the default configretion in .config/ranger folder,also the rc.conf

filename Description
rc.conf The ranger configuration
rifle.conf The default application to open a file
scope.sh Define how to scope a file in ranger
commands.py Custom the commands in ranger

1

  • Tap hjkl can move the cursor
  • Tap HJKL can move the cursor to the history action place
  • Tap [ ] could get into another folder
  • Tap zh or Ctrl+h to turn on/off the hidden files
  • Tap o to sort the files with some rules(we can use oa ob,etc…)
  • Tap / to search the file in the current folder (We can custom + - to jump to the next result)
  • Tap Shift+s to get into a cursor file
  • Tap yp to copy the filepath to the clipboard
  • Tap cw to rename the file
  • Tap yy to copy a file
  • Tap pp to paste a copied file
  • Tap dd to cut a file
  • Tap dD to delete a file
  • Tap w to get the task board(And tap dd can cancel a task)
  • Tap v to select all the files in the current folder

Plugins

You can get the plugins on ranger’s official GitHub page: Ranger Plugins

ranger-devicons2

This plugin can add some cool icons for the different folders or files

1
2
3
git clone https://github.com/ryanoasis/nerd-fonts.git
cd ./nerd-fonts
./install.sh
  • You should change the iterm2(or another console applications) fonts.

  • You should append these lines to the rc.conf file
1
default_linemode devicons2

Finally,you’ll get the dope icons

Author

Resek4

Posted on

2022-10-03

Updated on

2023-02-26

Licensed under

Comments