$ sudo apt-get install ranger
Or per source:
$ git clone git://git.savannah.nongnu.org/ranger.git /tmp/ranger && cd /tmp/ranger && git checkout v1.7.2 && sudo make install ``` ## First start ```sh $ ranger
What you see are
Miller columns, where the middle pane is the current directory, the left pane is the parent
directory, and the right pane displays a preview for the file your are currently browser in the middle column. All in
all it looks like Finder tool for Mac.
Text files are displayed with the less program. PDFs are converted to text for displaying preview and images are shown either with ASCII images or your default image viewer.
And get out of it via
gg... Go to the top of the list
G... Go to the bottom of the list
<C-f>... Page down
<C-b>... Page up
J... Page down 1/2 page
K... Page up 1/2 page
H... Go back through navigation history
L... Go forward through navigation history
o... will open order context and after which filter you want to see the files
zh... toggle show hidden files
Working with Files:
i... display the file
E|I... edit the file
r... open file with the chosen program
cw... rename file
/... search for files (
n|pjump to next/previous match)
dd.. mark file for cut
p... paste file
yy.. copy/yank file
zh... show hidden files
R... reload current directory
<C-n>... creates an new tab
<C-w>... close the current tab
<Tab>... jump to the next tab
<Shift-Tab>... jump to the previous tab
q... will quit ranger
?... open the man, keybindings, commands, or settings
:delete... delete the selected file
:mkdir... create a directory
:touch... create a file
:rename... rename file
:help... show help (and then pressing
kwill print the shortcuts)
$ ranger --copy-config=all
It will create the
files in your
rifle.conf is rangers file executor/opener.
#-------------------------------------------- # Audio without X #------------------------------------------- mime ^audio|ogg$, terminal, has mplayer = mplayer -- "$@" mime ^audio|ogg$, terminal, has mplayer2 = mplayer2 -- "$@" mime ^audio|ogg$, terminal, has mpv = mpv -- "$@" ext midi?, terminal, has wildmidi = wildmidi -- "$@"
commands_full.py defines commands for your
rc.conf as well as terminal commands - if you want to create your own
commands put them into
scope.sh handles previews for ranger so that you can see the results of file
in ranger instead of opening an external command.
Contains basic configuration like displaying hidden files and shortcuts
# Jumping around map J history_go -2 map K history_go 0
My file is pretty empty because I want only that.
Vim command to start the browser mode
function RangerExplorer() exec "silent !ranger --choosefile=/tmp/vim_ranger_current_file " . system('echo "' . expand("%:p:h") . '" | sed -E "s/\ /\\\ /g"') if filereadable('/tmp/vim_ranger_current_file') exec 'edit ' . system('cat /tmp/vim_ranger_current_file | sed -E "s/\ /\\\ /g"') call system('rm /tmp/vim_ranger_current_file') endif redraw! endfun map <Leader>r :call RangerExplorer()<CR>
There are a bunch of plugins out there, which all uses Ranger in different ways:
- vim-ranger will open files in tabs instead of buffers
- ranger.vim several commands for splitting selected files
I prefer ranger.vim because it quickly opens a file browser and open the selected files in a new buffer.
# Be aware of version control systems and display information. set vcs_aware true # State of the three backends git, hg, bzr. The possible states are # disabled, local (only show local info), enabled (show local and remote # information). set vcs_backend_git enabled set vcs_backend_hg disabled set vcs_backend_bzr disabled
But then loading a big repo may slow down opening ranger.