Ranger a terminal browser for Vim
(This article has been tested with NVIM v0.2.2, Vim 8.0 with 1-692, and ranger 1.8.1)
$ 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.8.1 && 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 ½ page
K… Page up ½ 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, key bindings, 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
Vim plugins for ranger
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 by rafaqz: several commands for opening ranger explorer, splitting selected files, appending current file path in insert mode
- ranger.vim by francoiscabrol: several commands for opening ranger explorer, splitting selected files, not shortcut for appending current file path in insert mode
- You can open selected file(s) in current buffer and tabs, but also in splits and vsplits.
- It opens multiple files.
- As well as opening files, you can insert file paths or change existing file paths with a vim movement operator.
- It doesn’t have a workspace path option, just current path.
So feel free to use the extension which best fits to your needs.
# 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
You can read more about under the wiki VCS integration of Ranger. Be aware then loading a big repo may slow down opening ranger.