core.main: made --fail-unless-cd deprecated
[ranger.git] / doc / ranger.pod
bloba5b1fed609580a44ee30d8b392d57adfef97c181
1 =head1 NAME
3 ranger - visual file manager
8 =head1 SYNOPSIS
10 B<ranger> [B<--help>] [B<--version>] [B<--debug>] [B<--clean>]
11 [B<--list-unused-keys>] [B<--choosedir>=I<targetfile>]
12 [B<--choosefile>=I<targetfile>] [B<--copy-config>=I<file>] [B<--mode>=I<mode>]
13 [B<--flags>=I<flags>] [I<path/filename>]
18 =head1 DESCRIPTION
20 ranger is a console file manager with VI key bindings.  It provides a
21 minimalistic and nice curses interface with a view on the directory hierarchy.
22 The secondary task of ranger is to figure out which program you want to use to
23 open your files with.
25 This manual mainly contains information on the usage of ranger.  Refer to the
26 F<README> for install instructions and to F<doc/HACKING> for development
27 specific information.  For configuration, see the files in F<ranger/config>.
28 They are usually installed to F</usr/lib/python*/site-packages/ranger/config>
29 and can be obtained with ranger's --copy-config option.
31 Inside ranger, you can press I<1?> for a list of key bindings, I<2?> for a list
32 of commands and I<3?> for a list of settings.
37 =head1 OPTIONS
39 =over 14
41 =item B<-d>, B<--debug>
43 Activate the debug mode: Whenever an error occurs, ranger will exit and print a
44 full traceback.  The default behavior is to merely print the name of the
45 exception in the statusbar/log and try to keep running.
47 =item B<-c>, B<--clean>
49 Activate the clean mode:  ranger will not access or create any configuration
50 files nor will it leave any traces on your system.  This is useful when your
51 configuration is broken, when you want to avoid clutter, etc.
53 =item B<--choosefile>=I<targetfile>
55 Allows you to pick a file with ranger.  This changes the behavior so that when
56 you open a file, ranger will exit and write the absolute path of that file into
57 I<targetfile>.
59 =item B<--choosefiles>=I<targetfile>
61 Allows you to pick multiple files with ranger.  This changes the behavior so
62 that when you open a file, ranger will exit and write the absolute paths of all
63 selected files into I<targetfile>, adding one newline after each filename.
65 =item B<--choosedir>=I<targetfile>
67 Allows you to pick a directory with ranger.  When you exit ranger, it will
68 write the last visited directory into I<targetfile>.
70 =item B<--selectfile>=I<targetfile>
72 Open ranger with I<targetfile> selected.
74 =item B<--copy-config>=I<file>
76 Create copies of the default configuration files in your local configuration
77 directory.  Existing ones will not be overwritten.  Possible values: I<all>,
78 I<rc>, I<commands>, I<scope>.
80 =item B<--list-unused-keys>
82 List common keys which are not bound to any action in the "browser" context.
83 This list is not complete, you can bind any key that is supported by curses:
84 use the key code returned by C<getch()>.
86 =item B<--list-tagged-files>=I<tag>
88 List all files which are tagged with the given tag.  Note: Tags are single
89 characters.  The default tag is "*"
91 =item B<-m> I<n>, B<--mode>=I<n>
93 When a filename is supplied, run it in mode I<n>.  This has no effect unless
94 the execution of this file type is explicitly handled in the configuration.
96 =item B<-f> I<flags>, B<--flags>=I<flags>
98 When a filename is supplied, run it with the given I<flags> to modify
99 behavior.  The execution of this file type is explicitly handled in the
100 configuration.
102 =item B<--cmd>=I<command>
104 Execute the command after the configuration has been read.  Use this option
105 multiple times to run multiple commands.
107 =item B<--version>
109 Print the version and exit.
111 =item B<-h>, B<--help>
113 Print a list of options and exit.
115 =back
120 =head1 CONCEPTS
122 This part explains how certain parts of ranger work and how they can be used
123 efficiently.
125 =head2 TAGS
127 Tags are single characters which are displayed left of a filename.  You can use
128 tags however you want.  Press "t" to toggle tags and "T" to remove any tags of
129 the selection. The default tag is an Asterisk ("*"), but you can use any tag by
130 typing I<"<tagnameE<gt>>.
132 =head2 PREVIEWS
134 By default, only text files are previewed, but you can enable external preview
135 scripts by setting the option C<use_preview_script> and C<preview_files> to True.
137 This default script is F<~/.config/ranger/scope.sh>. It contains more
138 documentation and calls to the programs I<lynx> and I<elinks> for html,
139 I<highlight> for text/code, I<img2txt> for images, I<atool> for archives,
140 I<pdftotext> for PDFs and I<mediainfo> for video and audio files.
142 Install these programs (just the ones you need) and scope.sh will automatically
143 use them.
145 =head2 SELECTION
147 The I<selection> is defined as "All marked files IF THERE ARE ANY, otherwise
148 the current file."  Be aware of this when using the :delete command, which
149 deletes all files in the selection.
151 You can mark files by pressing <Space>, v, etc.  A yellow B<Mrk> symbol at the
152 bottom right indicates that there are marked files in this directory.
154 =head2 MACROS
156 Macros can be used in commands to abbreviate things.
158  %f   the highlighted file
159  %d   the path of the current directory
160  %s   the selected files in the current directory.
161  %t   all tagged files in the current directory
162  %c   the full paths of the currently copied/cut files
164 The macros %f, %d and %s also have upper case variants, %F, %D and %S,
165 which refer to the next tab.  To refer to specific tabs, add a number in
166 between.  (%7s = selection of the seventh tab.)
168 %c is the only macro which ranges out of the current directory. So you may
169 "abuse" the copying function for other purposes, like diffing two files which
170 are in different directories:
172  Yank the file A (type yy), move to the file B, then type
173  @diff %c %f
175 Macros for file paths are generally shell-escaped so they can be used in the
176 C<shell> command.
178 =head2 BOOKMARKS
180 Type B<m<keyE<gt>> to bookmark the current directory. You can re-enter this
181 directory by typing B<`<keyE<gt>>. <key> can be any letter or digit.  Unlike vim,
182 both lowercase and uppercase bookmarks are persistent.
184 Each time you jump to a bookmark, the special bookmark at key ` will be set
185 to the last directory. So typing "``" gets you back to where you were before.
187 Bookmarks are selectable when tabbing in the :cd command.
189 Note: The bookmarks ' (Apostrophe) and ` (Backtick) are the same.
191 =head2 RIFLE
193 Rifle is the file opener of ranger.  It can be used as a standalone program or
194 a python module.  It is located at F<ranger/ext/rifle.py>.  In contrast to
195 other, more simple file openers, rifle can automatically find installed
196 programs so it can be used effectively out of the box on a variety of systems.
198 It's configured in F<rifle.conf> through a list of conditions and commands.
199 For each line the conditions are checked and if they are met, the respective
200 command is taken into consideration.  By default, simply the first matching
201 rule is used.  In ranger, you can list and choose rules by typing "r" or simply
202 by typing "<rulenumber><enter>".  If you use rifle standalone, you can list all
203 rules with the "-l" option and pick a rule with "-p <number>".
205 The rules, along with further documentation, are contained in
206 F<ranger/config/rifle.conf>.
208 =head2 FLAGS
210 Flags give you a way to modify the behavior of the spawned process.  They are
211 used in the commands C<:open_with> (key "r") and C<:shell> (key "!").
213  f   Fork the process.  (Run in background)
214  c   Run the current file only, instead of the selection
215  r   Run application with root privilege (requires sudo)
216  t   Run application in a new terminal window
218 There are some additional flags that can currently be used only in the C<shell>
219 command: (for example C<:shell -w df>)
221  p   Redirect output to the pager
222  s   Silent mode.  Output will be discarded.
223  w   Wait for an Enter-press when the process is done
225 By default, all the flags are off unless specified otherwise in the
226 F<rifle.conf> configuration file.  You can specify as many flags as you want.
227 An uppercase flag negates the effect: "ffcccFsf" is equivalent to "cs".
229 The terminal program name for the "t" flag is taken from the environment
230 variable $TERMCMD.  If it doesn't exist, it tries to extract it from $TERM and
231 uses "xterm" as a fallback if that fails.
233 Examples: C<:open_with c> will open the file that you currently point at, even
234 if you have selected other files.  C<:shell -w df> will run "df" and wait for
235 you to press Enter before switching back to ranger.
237 =head2 PLUGINS
239 ranger's plugin system consists of python files which are located in
240 F<~/.config/ranger/plugins/> and are imported in alphabetical order when
241 starting ranger.  A plugin changes rangers behavior by overwriting or extending
242 a function that ranger uses.  This allows you to change pretty much every part
243 of ranger, but there is no guarantee that things will continue to work in
244 future versions as the source code evolves.
246 There are some hooks that are specifically made for the use in plugins.  They
247 are functions that start with hook_ and can be found throughout the code.
249  grep 'def hook_' -r /path/to/rangers/source
251 Also try:
253  pydoc ranger.api
255 Note that you should NOT simply overwrite a function unless you know what
256 you're doing.  Instead, save the existing function and call it from your new
257 one.  This way, multiple plugins can use the same hook.  There are several
258 sample plugins in the F<examples/> directory, including a hello-world plugin
259 that describes this procedure.
264 =head1 KEY BINDINGS
266 Key bindings are defined in the file F<ranger/config/rc.conf>.  Check this
267 file for a list of all key bindings.  You can copy it to your local
268 configuration directory with the --copy-config=rc option.
270 Many key bindings take an additional numeric argument.  Type I<5j> to move
271 down 5 lines, I<2l> to open a file in mode 2, I<10<SpaceE<gt>> to mark 10 files.
273 This list contains the most useful bindings:
275 =head2 MAIN BINDINGS
277 =over 14
279 =item h, j, k, l
281 Move left, down, up or right
283 =item ^D or J, ^U or K
285 Move a half page down, up
287 =item H, L
289 Move back and forward in the history
291 =item gg
293 Move to the top
295 =item G
297 Move to the bottom
299 =item ^R
301 Reload everything
303 =item ^L
305 Redraw the screen
307 =item S
309 Open a shell in the current directory
311 =item ?
313 Opens this man page
315 =item yy
317 Yank the selection to the "copy" buffer and mark them as to be copied
319 =item dd
321 Cut the selection to the "copy" buffer and mark them as to be moved
323 =item pp
325 Paste the files from the "copy" buffer here (by moving or copying, depending on
326 how they are marked.) By default, this will not overwrite existing files.  To
327 overwrite them, use I<po>.
329 =item mI<X>
331 Create a bookmark with the name I<X>
333 =item `I<X>
335 Move to the bookmark with the name I<X>
337 =item n, N
339 Find the next file.  By default, this gets you to the newest file in the
340 directory, but if you search something using the keys /, cm, ct, ..., it will
341 get you to the next found entry.
343 =item N
345 Find the previous file.
347 =item oI<X>
349 Change the sort method (like in mutt)
351 =item zI<X>
353 Change settings.  See the settings section for a list of settings and their
354 hotkey.
356 =item f
358 Quickly navigate by entering a part of the filename.
360 =item Space
362 Mark a file.
364 =item v
366 Toggle the mark-status of all files, unmark all files.
368 =item V, uv
370 Unmark all files
372 =item /
374 Search for files in the current directory.
376 =item :
378 Open the console.
381 =item Alt-I<N>
383 Open a tab. N has to be a number from 0 to 9. If the tab doesn't exist yet, it
384 will be created.
386 =item gn, ^N
388 Create a new tab.
390 =item gt, gT
392 Go to the next or previous tab. You can also use TAB and SHIFT+TAB instead.
394 =item gc, ^W
396 Close the current tab.  The last tab cannot be closed this way.
398 =back
400 =head2 MIDNIGHT COMMANDER-LIKE BINDINGS
402 =over 14
404 =item <F1>
406 Display Help.
408 =item <F3>
410 Display the file.
412 =item <F4>
414 Edit the file.
416 =item <F5>
418 Copy the file.
420 =item <F6>
422 Cut the file.
424 =item <F7>
426 Open the console with ":mkdir ".
428 =item <F8>
430 Prompt for deletion of the selected files.
432 =item <F10>
434 Exit ranger.
436 =back
438 =head2 READLINE-LIKE BINDINGS IN THE CONSOLE
440 =over 14
442 =item ^B, ^F
444 Move left and right (B for back, F for forward)
446 =item ^P, ^N
448 Move up and down (P for previous, N for Next)
450 =item ^A, ^E
452 Move to the start or to the end
454 =item ^D
456 Delete the current character.
458 =item ^H
460 Backspace.
462 =back
465 =head1 MOUSE BUTTONS
467 =over
469 =item Left Mouse Button
471 Click on something and you'll move there.  To run a file, "enter" it, like a
472 directory, by clicking on the preview.
474 =item Right Mouse Button
476 Enter a directory or run a file.
478 =item Scroll Wheel
480 Scrolls up or down.  You can point at the column of the parent directory while
481 scrolling to switch directories.
483 =back
488 =head1 SETTINGS
490 This section lists all built-in settings of ranger.  The valid types for the
491 value are in [brackets].  The hotkey to toggle the setting is in <brokets>, if
492 a hotkey exists.
494 Settings can be changed in the file F<~/.config/ranger/rc.conf> or on the
495 fly with the command B<:set option value>.  Examples:
497  set column_ratios 1,2,3
498  set show_hidden true
500 The different types of settings and an example for each type:
502  setting type   | example values
503  ---------------+----------------------------
504  bool           | true, false
505  integer        | 1, 23, 1337
506  string         | foo, hello world
507  list           | 1,2,3,4
508  none           | none
510 You can view a list of all settings and their current values by pressing "3?"
511 in ranger.
513 =over
515 =item autosave_bookmarks [bool]
517 Save bookmarks (used with mX and `X) instantly?  This helps to synchronize
518 bookmarks between multiple ranger instances but leads to *slight* performance
519 loss.  When false, bookmarks are saved when ranger is exited.
521 =item autoupdate_cumulative_size [bool]
523 You can display the "real" cumulative size of directories by using the command
524 :get_cumulative_size or typing "dc".  The size is expensive to calculate and
525 will not be updated automatically.  You can choose to update it automatically
526 though by turning on this option.
528 =item collapse_preview [bool] <zc>
530 When no preview is visible, should the last column be squeezed to make use of
531 the whitespace?
533 =item colorscheme [string]
535 Which colorscheme to use?  These colorschemes are available by default:
536 B<default>, B<jungle>, B<snow>.  Snow is a monochrome scheme, jungle replaces
537 blue directories with green ones for better visibility on certain terminals.
539 =item column_ratios [list]
541 How many columns are there, and what are their relative widths?  For example, a
542 value of 1,1,1 would mean 3 evenly sized columns. 1,1,1,1,4 means 5 columns
543 with the preview column being as large as the other columns combined.
545 =item confirm_on_delete [string]
547 Ask for a confirmation when running the "delete" command?  Valid values are
548 "always" (default), "never", "multiple". With "multiple", ranger will ask only
549 if you delete multiple files at once.
551 =item dirname_in_tabs [bool]
553 Display the directory name in tabs?
555 =item display_size_in_main_column [bool]
557 Display the file size in the main column?
559 =item display_size_in_status_bar [bool]
561 Display the file size in the status bar?
563 =item display_tags_in_all_columns [bool]
565 Display tags in all columns?
567 =item draw_borders [bool]
569 Draw borders around columns?
571 =item draw_progress_bar_in_statusbar [bool]
573 Draw a progress bar in the status bar which displays the average state of all
574 currently running tasks which support progress bars?
576 =item flushinput [bool] <zi>
578 Flush the input after each key hit?  One advantage is that when scrolling down
579 with "j", ranger stops scrolling instantly when you release the key.  One
580 disadvantage is that when you type commands blindly, some keys might get lost.
582 =item hidden_filter [string]
584 A regular expression pattern for files which should be hidden.  For example,
585 this pattern will hide all files that start with a dot or end with a tilde.
587  set hidden_filter ^\.|~$
589 =item max_console_history_size [integer, none]
591 How many console commands should be kept in history?  "none" will disable the
592 limit.
594 =item max_history_size [integer, none]
596 How many directory changes should be kept in history?
598 =item mouse_enabled [bool] <zm>
600 Enable mouse input?
602 =item padding_right [bool]
604 When collapse_preview is on and there is no preview, should there remain a
605 little padding on the right?  This allows you to click into that space to run
606 the file.
608 =item preview_directories [bool] <zP>
610 Preview directories in the preview column?
612 =item preview_files [bool] <zp>
614 Preview files in the preview column?
616 =item preview_script [string, none]
618 Which script should handle generating previews?  If the file doesn't exist, or
619 use_preview_script is off, ranger will handle previews itself by just printing
620 the content.
622 =item save_console_history [bool]
624 Should the console history be saved on exit?  If disabled, the console history
625 is reset when you restart ranger.
627 =item scroll_offset [integer]
629 Try to keep this much space between the top/bottom border when scrolling.
631 =item shorten_title [integer, bool]
633 Trim the title of the window if it gets long?  The number defines how many
634 directories are displayed at once, False turns off this feature.
636 =item show_cursor [bool]
638 Always show the terminal cursor?
640 =item show_hidden_bookmarks [bool]
642 Show dotfiles in the bookmark preview window? (Type ')
644 =item show_hidden [bool] <zh>, <^H>
646 Show hidden files?
648 =item sort_case_insensitive [bool] <zc>
650 Sort case-insensitively?  If true, "a" will be listed before "B" even though
651 its ASCII value is higher.
653 =item sort_directories_first [bool] <zd>
655 Sort directories first?
657 =item sort_reverse [bool] <or>
659 Reverse the order of files?
661 =item sort [string] <oa>, <ob>, <oc>, <om>, <on>, <ot>, <os>
663 Which sorting mechanism should be used?  Choose one of B<atime>, B<basename>,
664 B<ctime>, B<mtime>, B<natural>, B<type>, B<size>
666 Note: You can reverse the order by using an uppercase O in the key combination.
668 =item tilde_in_titlebar [bool]
670 Abbreviate $HOME with ~ in the title bar (first line) of ranger?
672 =item unicode_ellipsis [bool]
674 Use a unicode "..." character instead of "~" to mark cut-off filenames?
676 =item update_title [bool]
678 Set a window title?
680 =item update_tmux_title [bool]
682 Set the title to "ranger" in the tmux program?
684 =item use_preview_script [bool] <zv>
686 Use the preview script defined in the setting I<preview_script>?
688 =item xterm_alt_key [bool]
690 Enable this if key combinations with the Alt Key don't work for you.
691 (Especially on xterm)
693 =back
696 =head1 COMMANDS
698 You can enter the commands in the console which is opened by pressing ":".
700 You can always get a list of the currently existing commands by typing "2?" in
701 ranger.  For your convenience, this is a list of the "public" commands including their parameters, excluding descriptions:
703  alias [newcommand] [oldcommand]
704  bulkrename
705  cd [directory]
706  chain command1[; command2[; command3...]]
707  chmod octal_number
708  cmap key command
709  console [-pSTARTPOSITION] command
710  copycmap key newkey [newkey2...]
711  copymap key newkey [newkey2...]
712  copypmap key newkey [newkey2...]
713  copytmap key newkey [newkey2...]
714  cunmap keys...
715  delete [confirmation]
716  edit [filename]
717  eval [-q] python_code
718  filter [string]
719  find pattern
720  grep pattern
721  load_copy_buffer
722  map key command
723  mark pattern
724  mark_tag [tags]
725  mkdir dirname
726  open_with [application] [flags] [mode]
727  pmap key command
728  punmap keys...
729  quit
730  quit!
731  relink newpath
732  rename newname
733  save_copy_buffer
734  search pattern
735  search_inc pattern
736  set option value
737  setlocal [path=<path>] option value
738  shell [-FLAGS] command
739  terminal
740  tmap key command
741  touch filename
742  tunmap keys...
743  unmap keys...
744  unmark pattern
745  unmark_tag [tags]
747 There are additional commands which are directly translated to python
748 functions, one for every method in the ranger.core.actions.Actions class.
749 They are not documented here, since they are mostly for key bindings, not to be
750 typed in by a user.  Read the source if you are interested in them.
752 These are the public commands including their descriptions:
754 =over 2
756 =item alias [I<newcommand>] [I<oldcommand>]
758 Copies the oldcommand as newcommand.
760 =item bulkrename
762 This command opens a list of selected files in an external editor.  After you
763 edit and save the file, it will generate a shell script which does bulk
764 renaming according to the changes you did in the file.
766 This shell script is opened in an editor for you to review.  After you close
767 it, it will be executed.
769 =item cd [I<directory>]
771 The cd command changes the directory.  The command C<:cd -> is equivalent to
772 typing ``.
774 =item chain I<command1>[; I<command2>[; I<command3>...]]
776 Combines multiple commands into one, separated by semicolons.
778 =item chmod I<octal_number>
780 Sets the permissions of the selection to the octal number.
782 The octal number is between 000 and 777. The digits specify the permissions for
783 the user, the group and others.  A 1 permits execution, a 2 permits writing, a
784 4 permits reading.  Add those numbers to combine them. So a 7 permits
785 everything.
787 Key bindings in the form of [-+]<who><what> and =<octal> also exist.  For
788 example, B<+ar> allows reading for everyone, -ow forbids others to write and
789 =777 allows everything.
791 See also: man 1 chmod
793 =item cmap I<key> I<command>
795 Binds keys for the console. Works like the C<map> command.
797 =item console [-pI<N>] I<command>
799 Opens the console with the command already typed in.  The cursor is placed at
800 I<N>.
802 =item copycmap I<key> I<newkey> [I<newkey2> ...]
804 See C<copymap>
806 =item copymap I<key> I<newkey> [I<newkey2> ...]
808 Copies the keybinding I<key> to I<newkey> in the "browser" context.  This is a
809 deep copy, so if you change the new binding (or parts of it) later, the old one
810 is not modified.
812 To copy key bindings of the console, taskview, or pager use "copycmap",
813 "copytmap" or "copypmap".
815 =item copypmap I<key> I<newkey> [I<newkey2> ...]
817 See C<copymap>
819 =item copytmap I<key> I<newkey> [I<newkey2> ...]
821 See C<copymap>
823 =item cunmap [I<keys...>]
825 Removes key mappings of the console. Works like the C<unmap> command.
827 =item delete [I<confirmation>]
829 Destroy all files in the selection with a roundhouse kick.  ranger will ask for
830 a confirmation if you attempt to delete multiple (marked) files or non-empty
831 directories.
833 When asking for confirmation, this command will only proceed if the last given
834 word starts with a `y'.
836 =item edit [I<filename>]
838 Edit the current file or the file in the argument.
840 =item eval [I<-q>] I<python_code>
842 Evaluates the python code.  `fm' is a reference to the FM instance.  To display
843 text, use the function `p'.  The result is displayed on the screen unless you
844 use the "-q" option.
846 Examples:
847  :eval fm
848  :eval len(fm.env.directories)
849  :eval p("Hello World!")
851 =item filter [I<string>]
853 Displays only the files which contain the I<string> in their basename.  Running
854 this command without any parameter will reset the fitler.
856 =item find I<pattern>
858 Search files in the current directory that match the given (case-insensitive)
859 regular expression pattern as you type.  Once there is an unambiguous result,
860 it will be run immediately. (Or entered, if it's a directory.)
862 =item grep I<pattern>
864 Looks for a string in all marked files or directories.
866 =item load_copy_buffer
868 Load the copy buffer from F<~/.config/ranger/copy_buffer>.  This can be used to
869 pass the list of copied files to another ranger instance.
871 =item map I<key> I<command>
873 Assign the key combination to the given command.  Whenever you type the
874 key/keys, the command will be executed.  Additionally, if you use a quantifier
875 when typing the key, like 5j, it will be passed to the command as the attribute
876 "self.quantifier".
878 The keys you bind with this command are accessible in the file browser only,
879 not in the console, task view or pager.  To bind keys there, use the commands
880 "cmap", "tmap" or "pmap".
882 =item mark I<pattern>
884 Mark all files matching the regular expression pattern.
886 =item mark_tag [I<tags>]
888 Mark all tags that are tagged with either of the given tags.  When leaving out
889 the tag argument, all tagged files are marked.
891 =item mkdir I<dirname>
893 Creates a directory with the name I<dirname>.
895 =item open_with [I<application>] [I<flags>] [I<mode>]
897 Open the selected files with the given application, unless it is omitted, in
898 which case the default application is used.  I<flags> are characters out of
899 "sdpcwSDPCW" and I<mode> is any positive integer. Their meanings are discussed
900 in their own sections.
902 =item pmap I<key> I<command>
904 Binds keys for the pager. Works like the C<map> command.
906 =item punmap [I<keys ...>]
908 Removes key mappings of the pager. Works like the C<unmap> command.
910 =item quit
912 Like quit!, but closes only this tab if multiple tabs are open.
914 =item quit!
916 Quit ranger.  The current directory will be bookmarked as ' so you can re-enter
917 it by typing `` or '' the next time you start ranger.
919 =item relink I<newpath>
921 Change the link destination of the current symlink file to <newpath>. First
922 <tab> will load the original link.
924 =item rename I<newname>
926 Rename the current file.  If a file with that name already exists, the renaming
927 will fail.  Also try the key binding A for appending something to a file name.
929 =item save_copy_buffer
931 Save the copy buffer from I<~/.config/ranger/copy_buffer>.  This can be used to
932 pass the list of copied files to another ranger instance.
934 =item search I<pattern>
936 Search files in the current directory that match the given (case insensitive)
937 regular expression pattern.
939 =item search_inc I<pattern>
941 Search files in the current directory that match the given (case insensitive)
942 regular expression pattern.  This command gets you to matching files as you
943 type.
945 =item set I<option> I<value>
947 Assigns a new value to an option.  Valid options are listed in the settings
948 section.  Use tab completion to get the current value of an option, though this
949 doesn't work for functions and regular expressions. Valid values are:
951  setting type   | example values
952  ---------------+----------------------------
953  bool           | true, false
954  integer        | 1, 23, 1337
955  string         | foo, hello world
956  list           | 1,2,3,4
957  none           | none
959 =item setlocal [path=I<path>] I<option> I<value>
961 Assigns a new value to an option, but locally for the directory given by
962 I<path>. This means, that this option only takes effect when visiting that
963 directory. If no path is given, uses the current directory.
965 =item shell [-I<flags>] I<command>
967 Run a shell command.  I<flags> are discussed in their own section.
969 =item terminal
971 Spawns the I<x-terminal-emulator> starting in the current directory.
973 =item tmap I<key> I<command>
975 Binds keys for the taskview. Works like the C<map> command.
977 =item touch I<filename>
979 Creates an empty file with the name I<filename>, unless it already exists.
981 =item tunmap [I<keys ...>]
983 Removes key mappings of the taskview. Works like the C<unmap> command.
985 =item unmap [I<keys> ...]
987 Removes the given key mappings in the "browser" context.  To unmap key bindings
988 in the console, taskview, or pager use "cunmap", "tunmap" or "punmap".
990 =item unmark I<pattern>
992 Unmark all files matching a regular expression pattern.
994 =item unmark_tag [I<tags>]
996 Unmark all tags that are tagged with either of the given tags.  When leaving
997 out the tag argument, all tagged files are unmarked.
999 =back
1004 =head1 FILES
1006 ranger reads several configuration files which are located in
1007 F<$HOME/.config/ranger> or F<$XDG_CONFIG_HOME/ranger> if $XDG_CONFIG_HOME is
1008 defined.  You can use the --copy-config option to obtain the default
1009 configuration files.  Each of the files contains further documentation.
1011 You don't need to copy the whole file though, most configuration files are
1012 overlaid on top of the defaults (F<commands.py>, F<rc.conf>) or can be
1013 sub-classed (F<colorschemes>).
1015 When starting ranger with the B<--clean> option, it will not access or create
1016 any of these files.
1018 =head2 CONFIGURATION
1020 =over 10
1022 =item rc.conf
1024 Contains a list of commands which are executed on startup.  Mostly key bindings
1025 and settings are defined here.
1027 =item commands.py
1029 A python module that defines commands which can be used in ranger's console by
1030 typing ":" or in the rc.conf file.
1032 =item rifle.conf
1034 This is the configuration file for the built-in file launcher called "rifle".
1036 =item scope.sh
1038 This is a script that handles file previews.  When the options
1039 I<use_preview_script> and I<preview_files> are set, the program specified in
1040 the option I<preview_script> is run and its output and/or exit code determines
1041 rangers reaction.
1043 =item colorschemes/
1045 Colorschemes can be placed here.
1047 =item plugins/
1049 Plugins can be placed here.
1051 =back
1053 =head2 STORAGE
1055 =over 10
1057 =item bookmarks
1059 This file contains a list of bookmarks.  The syntax is /^(.):(.*)$/. The first
1060 character is the bookmark key and the rest after the colon is the path to the
1061 file.  In ranger, bookmarks can be set by typing m<key>, accessed by typing
1062 '<key> and deleted by typing um<key>.
1064 =item copy_buffer
1066 When running the command :save_copy_buffer, the paths of all currently copied
1067 files are saved in this file.  You can later run :load_copy_buffer to copy the
1068 same files again, pass them to another ranger instance or process them in a
1069 script.
1071 =item history
1073 Contains a list of commands that have been previously typed in.
1075 =item tagged
1077 Contains a list of tagged files. The syntax is /^(.:)?(.*)$/ where the first
1078 letter is the optional name of the tag and the rest after the optional colon is
1079 the path to the file.  In ranger, tags can be set by pressing t and removed
1080 with T.  To assign a named tag, type "<tagname>.
1082 =back
1087 =head1 ENVIRONMENT
1089 These environment variables have an effect on ranger:
1091 =over 8
1093 =item RANGER_LEVEL
1095 ranger sets this environment variable to "1" or increments it if it already
1096 exists.  External programs can determine whether they were spawned from ranger
1097 by checking for this variable.
1099 =item EDITOR
1101 Defines the editor to be used for the "E" key.  Defaults to the first installed
1102 program out of "vim", "emacs" and "nano".
1104 =item SHELL
1106 Defines the shell that ranger is going to use with the :shell command and
1107 the "S" key.  Defaults to "bash".
1109 =item TERMCMD
1111 Defines the terminal emulator command that ranger is going to use with the
1112 :terminal command and the "t" run flag.  Defaults to "x-terminal-emulator" or
1113 "xterm"
1116 =item XDG_CONFIG_HOME
1118 Specifies the directory for configuration files. Defaults to F<$HOME/.config>.
1120 =item PYTHONOPTIMIZE
1122 This variable determines the optimize level of python.
1124 Using PYTHONOPTIMIZE=1 (like python -O) will make python discard assertion
1125 statements.  You will gain efficiency at the cost of losing some debug info.
1127 Using PYTHONOPTIMIZE=2 (like python -OO) will additionally discard any
1128 docstrings.  Using this will disable the <F1> key on commands.
1130 =back
1135 =head1 EXAMPLES
1137 There are various examples on how to extend ranger with plugins or combine
1138 ranger with other programs.  These can be found in the F<examples/> directory
1139 that is provided along with the source code.
1144 =head1 LICENSE
1146 GNU General Public License 3 or (at your option) any later version.
1151 =head1 LINKS
1153 =over
1155 =item Download: L<http://ranger.nongnu.org/ranger-stable.tar.gz>
1157 =item The project page: L<http://ranger.nongnu.org/>
1159 =item The mailing list: L<http://savannah.nongnu.org/mail/?group=ranger>
1161 =back
1163 ranger is maintained with the git version control system.  To fetch a fresh
1164 copy, run:
1166  git clone git://git.savannah.nongnu.org/ranger.git
1171 =head1 BUGS
1173 Report bugs here: L<http://savannah.nongnu.org/bugs/?group=ranger>
1175 Please include as much relevant information as possible.  For the most
1176 diagnostic output, run ranger like this: C<PYTHONOPTIMIZE= ranger --debug>