-
Notifications
You must be signed in to change notification settings - Fork 6
/
ranger.1.html
2391 lines (1579 loc) · 80.3 KB
/
ranger.1.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
<?xml version="1.0" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title></title>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<link rev="made" href="mailto:" />
</head>
<body>
<ul id="index">
<li><a href="#SYNOPSIS">SYNOPSIS</a></li>
<li><a href="#DESCRIPTION">DESCRIPTION</a></li>
<li><a href="#RESOURCES">RESOURCES</a></li>
<li><a href="#POSITIONAL-ARGUMENTS">POSITIONAL ARGUMENTS</a></li>
<li><a href="#OPTIONS">OPTIONS</a></li>
<li><a href="#CONCEPTS">CONCEPTS</a>
<ul>
<li><a href="#TAGS">TAGS</a></li>
<li><a href="#PREVIEWS">PREVIEWS</a>
<ul>
<li><a href="#iTerm2">iTerm2</a></li>
<li><a href="#kitty">kitty</a></li>
<li><a href="#terminology">terminology</a></li>
<li><a href="#ueberzug">ueberzug</a></li>
<li><a href="#urxvt">urxvt</a></li>
<li><a href="#urxvt-full">urxvt-full</a></li>
<li><a href="#w3m">w3m</a></li>
</ul>
</li>
<li><a href="#SELECTION">SELECTION</a></li>
<li><a href="#MACROS">MACROS</a></li>
<li><a href="#BOOKMARKS">BOOKMARKS</a></li>
<li><a href="#RIFLE">RIFLE</a></li>
<li><a href="#FLAGS">FLAGS</a></li>
<li><a href="#PLUGINS">PLUGINS</a></li>
</ul>
</li>
<li><a href="#KEY-BINDINGS">KEY BINDINGS</a>
<ul>
<li><a href="#MAIN-BINDINGS">MAIN BINDINGS</a></li>
<li><a href="#READLINE-LIKE-BINDINGS-IN-THE-CONSOLE">READLINE-LIKE BINDINGS IN THE CONSOLE</a></li>
</ul>
</li>
<li><a href="#MOUSE-BUTTONS">MOUSE BUTTONS</a></li>
<li><a href="#SETTINGS">SETTINGS</a></li>
<li><a href="#COMMANDS">COMMANDS</a></li>
<li><a href="#FILES">FILES</a>
<ul>
<li><a href="#CONFIGURATION">CONFIGURATION</a></li>
<li><a href="#STORAGE">STORAGE</a></li>
</ul>
</li>
<li><a href="#ENVIRONMENT">ENVIRONMENT</a></li>
<li><a href="#EXAMPLES">EXAMPLES</a></li>
<li><a href="#LICENSE">LICENSE</a></li>
<li><a href="#LINKS">LINKS</a></li>
<li><a href="#SEE-ALSO">SEE ALSO</a></li>
<li><a href="#BUGS">BUGS</a></li>
</ul>
<p>ranger - visual file manager</p>
<h1 id="SYNOPSIS">SYNOPSIS</h1>
<p><b>ranger</b> [<b>--version</b>] [<b>--help</b>] [<b>--debug</b>] [<b>--clean</b>] [<b>--cachedir</b>=<i>directory</i>] [<b>--confdir</b>=<i>directory</i>] [<b>--datadir</b>=<i>directory</i>] [<b>--copy-config</b>=<i>which</i>] [<b>--choosefile</b>=<i>target</i>] [<b>--choosefiles</b>=<i>target</i>] [<b>--choosedir</b>=<i>target</i>] [<b>--selectfile</b>=<i>filepath</i>] [<b>--show-only-dirs</b>] [<b>--list-unused-keys</b>] [<b>--list-tagged-files</b>=<i>tag</i>] [<b>--profile</b>] [<b>--cmd</b>=<i>command</i>] [<i>path ...</i>]</p>
<h1 id="DESCRIPTION">DESCRIPTION</h1>
<p>ranger is a console file manager with VI key bindings.</p>
<h1 id="RESOURCES">RESOURCES</h1>
<p>This <i>manual</i> contains instructions on how to use and configure ranger.</p>
<p>Inside <i>ranger</i>, you can press <i>?</i> for a list of key bindings, commands or settings.</p>
<p>The <i>README</i> contains install instructions.</p>
<p>The file <i>HACKING.md</i> contains guidelines for code modification.</p>
<p>The directory <i>doc/configs</i> contains configuration files. They are usually installed to <i>/usr/share/doc/ranger/config</i> and can be obtained with ranger's --copy-config option.</p>
<p>The directory <i>examples</i> contains reference implementations for ranger plugins, sample configuration files and some programs for integrating ranger with other software. They are usually installed to <i>/usr/share/doc/ranger/examples</i>.</p>
<p>The man page of rifle(1) describes the functions of the file opener</p>
<p>The section <i>LINKS</i> of this man page contains further resources.</p>
<h1 id="POSITIONAL-ARGUMENTS">POSITIONAL ARGUMENTS</h1>
<dl>
<dt id="path"><i>path ...</i></dt>
<dd>
<p>Each path will be opened in a tab and if the path is a file it will be selected. Omitting this is equivalent to providing the current directory.</p>
</dd>
</dl>
<h1 id="OPTIONS">OPTIONS</h1>
<dl>
<dt id="d---debug"><b>-d</b>, <b>--debug</b></dt>
<dd>
<p>Activate the debug mode: Whenever an error occurs, ranger will exit and print a full traceback. The default behavior is to merely print the name of the exception in the statusbar/log and try to keep running.</p>
</dd>
<dt id="c---clean"><b>-c</b>, <b>--clean</b></dt>
<dd>
<p>Activate the clean mode: ranger will not access or create any configuration files nor will it leave any traces on your system. This is useful when your configuration is broken, when you want to avoid clutter, etc.</p>
</dd>
<dt id="cachedir-dir"><b>--cachedir</b>=<i>dir</i></dt>
<dd>
<p>Change the cache directory of ranger from $XDG_CACHE_HOME or ~/.cache/ranger to "dir".</p>
</dd>
<dt id="r-dir---confdir-dir"><b>-r</b> <i>dir</i>, <b>--confdir</b>=<i>dir</i></dt>
<dd>
<p>Change the configuration directory of ranger from $XDG_CONFIG_HOME or ~/.config/ranger to "dir".</p>
</dd>
<dt id="datadir-dir"><b>--datadir</b>=<i>dir</i></dt>
<dd>
<p>Change the data directory of ranger from $XDG_DATA_HOME or ~/.local/share/ranger to "dir".</p>
</dd>
<dt id="copy-config-file"><b>--copy-config</b>=<i>file</i></dt>
<dd>
<p>Create copies of the default configuration files in your local configuration directory. Existing ones will not be overwritten. Possible values: <i>all</i>, <i>commands</i>, <i>commands_full</i>, <i>rc</i>, <i>rifle</i>, <i>scope</i>.</p>
<p>Note: You may want to disable loading of the global configuration files by exporting <i>RANGER_LOAD_DEFAULT_RC=FALSE</i> in your environment. See also: <b>FILES</b>, <b>ENVIRONMENT</b></p>
<p>--copy-config=<b>commands</b> will copy only a small sample configuration file with a thoroughly commented example. It is recommended to keep this file tidy to avoid getting defunct commands on ranger upgrades. The full default commands.py can be copied with --copy-config=<b>commands_full</b>, but that file will be ignored by ranger and serves only as a reference for making your own commands.</p>
</dd>
<dt id="choosefile-targetfile"><b>--choosefile</b>=<i>targetfile</i></dt>
<dd>
<p>Allows you to pick a file with ranger. This changes the behavior so that when you open a file, ranger will exit and write the absolute path of that file into <i>targetfile</i>.</p>
</dd>
<dt id="choosefiles-targetfile"><b>--choosefiles</b>=<i>targetfile</i></dt>
<dd>
<p>Allows you to pick multiple files with ranger. This changes the behavior so that when you open a file, ranger will exit and write the absolute paths of all selected files into <i>targetfile</i>, adding one newline after each filename.</p>
</dd>
<dt id="choosedir-targetfile"><b>--choosedir</b>=<i>targetfile</i></dt>
<dd>
<p>Allows you to pick a directory with ranger. When you exit ranger, it will write the last visited directory into <i>targetfile</i>.</p>
</dd>
<dt id="selectfile-targetfile"><b>--selectfile</b>=<i>targetfile</i></dt>
<dd>
<p>Open ranger with <i>targetfile</i> selected. This is a legacy option, superseded by the behavior for the POSITIONAL ARGUMENTS.</p>
</dd>
<dt id="show-only-dirs"><b>--show-only-dirs</b></dt>
<dd>
<p>Display only the directories. May be used in conjunction with <b>--choosedir</b>=<i>targetfile</i>.</p>
</dd>
<dt id="list-unused-keys"><b>--list-unused-keys</b></dt>
<dd>
<p>List common keys which are not bound to any action in the "browser" context. This list is not complete, you can bind any key that is supported by curses: use the key code returned by <code>getch()</code>.</p>
</dd>
<dt id="list-tagged-files-tag"><b>--list-tagged-files</b>=<i>tag</i></dt>
<dd>
<p>List all files which are tagged with the given tag. Note: Tags are single characters. The default tag is "*"</p>
</dd>
<dt id="profile"><b>--profile</b></dt>
<dd>
<p>Print statistics of CPU usage on exit.</p>
</dd>
<dt id="cmd-command"><b>--cmd</b>=<i>command</i></dt>
<dd>
<p>Execute the command after the configuration has been read. Use this option multiple times to run multiple commands.</p>
</dd>
<dt id="version"><b>--version</b></dt>
<dd>
<p>Print the version and exit.</p>
</dd>
<dt id="h---help"><b>-h</b>, <b>--help</b></dt>
<dd>
<p>Print a list of options and exit.</p>
</dd>
</dl>
<h1 id="CONCEPTS">CONCEPTS</h1>
<p>This part explains how certain parts of ranger work and how they can be used efficiently.</p>
<h2 id="TAGS">TAGS</h2>
<p>Tags are single characters which are displayed left of a filename. You can use tags however you want. Press "t" to toggle tags and "ut" to remove any tags of the selection. The default tag is an Asterisk ("*"), but you can use any tag by typing <i>"<tagname></i>.</p>
<h2 id="PREVIEWS">PREVIEWS</h2>
<p>By default, only text files are previewed, but you can enable external preview scripts by setting the option <code>use_preview_script</code> and <code>preview_files</code> to true.</p>
<p>This default script is <i>%rangerdir/data/scope.sh</i>. It contains more documentation and calls to many external programs to generate previews. They are automatically used when available but completely optional.</p>
<dl>
<dt id="For-general-usage">For general usage:</dt>
<dd>
<dl>
<dt id="pod">-</dt>
<dd>
<p><code>file</code> for determining file types</p>
</dd>
<dt id="pod1">-</dt>
<dd>
<p><code>chardet</code> (Python package) for improved encoding detection of text files</p>
</dd>
<dt id="pod2">-</dt>
<dd>
<p><code>sudo</code> to use the "run as root" feature</p>
</dd>
<dt id="pod3">-</dt>
<dd>
<p><code>python-bidi</code> (Python package) to display right-to-left file names correctly (Hebrew, Arabic)</p>
</dd>
</dl>
</dd>
<dt id="For-enhanced-file-previews-with-scope.sh">For enhanced file previews (with scope.sh):</dt>
<dd>
<dl>
<dt id="pod4">-</dt>
<dd>
<p><code>img2txt</code> (from <code>caca-utils</code>) for ASCII-art image previews</p>
</dd>
<dt id="pod5">-</dt>
<dd>
<p><code>w3mimgdisplay</code>, <code>ueberzug</code>, <code>mpv</code>, <code>iTerm2</code>, <code>kitty</code>, <code>terminology</code> or <code>urxvt</code> for image previews</p>
</dd>
<dt id="pod6">-</dt>
<dd>
<p><code>convert</code> (from <code>imagemagick</code>) to auto-rotate images and for SVG previews</p>
</dd>
<dt id="pod7">-</dt>
<dd>
<p><code>ffmpegthumbnailer</code> for video thumbnails</p>
</dd>
<dt id="pod8">-</dt>
<dd>
<p><code>highlight</code>, <code>bat</code> or <code>pygmentize</code> for syntax highlighting of code</p>
</dd>
<dt id="pod9">-</dt>
<dd>
<p><code>atool</code>, <code>bsdtar</code>, <code>unrar</code> and/or <code>7z</code> to preview archives</p>
</dd>
<dt id="pod10">-</dt>
<dd>
<p><code>bsdtar</code>, <code>tar</code>, <code>unrar</code>, <code>unzip</code> and/or <code>zipinfo</code> (and <code>sed</code>) to preview archives as their first image</p>
</dd>
<dt id="pod11">-</dt>
<dd>
<p><code>lynx</code>, <code>w3m</code> or <code>elinks</code> to preview html pages</p>
</dd>
<dt id="pod12">-</dt>
<dd>
<p><code>pdftotext</code> or <code>mutool</code> (and <code>fmt</code>) for textual pdf previews, <code>pdftoppm</code> to preview as image</p>
</dd>
<dt id="pod13">-</dt>
<dd>
<p><code>djvutxt</code> for textual DjVu previews, <code>ddjvu</code> to preview as image</p>
</dd>
<dt id="pod14">-</dt>
<dd>
<p><code>calibre</code> or <code>epub-thumbnailer</code> for image previews of ebooks</p>
</dd>
<dt id="pod15">-</dt>
<dd>
<p><code>transmission-show</code> for viewing BitTorrent information</p>
</dd>
<dt id="pod16">-</dt>
<dd>
<p><code>mediainfo</code> or <code>exiftool</code> for viewing information about media files</p>
</dd>
<dt id="pod17">-</dt>
<dd>
<p><code>odt2txt</code> for OpenDocument text files (odt, ods, odp and sxw)</p>
</dd>
<dt id="pod18">-</dt>
<dd>
<p><code>python</code> or <code>jq</code> for JSON files</p>
</dd>
<dt id="pod19">-</dt>
<dd>
<p><code>fontimage</code> for font previews</p>
</dd>
</dl>
</dd>
</dl>
<p>Install these programs (just the ones you need) and scope.sh will automatically use them.</p>
<p>Independently of the preview script, there is a feature to preview images by drawing them directly into the terminal. To enable this feature, set the option <code>preview_images</code> to true and enable one of the image preview modes:</p>
<h3 id="iTerm2">iTerm2</h3>
<p>This only works in iTerm2 compiled with image preview support, but works over ssh.</p>
<p>To enable this feature, set the option <code>preview_images_method</code> to iterm2.</p>
<p>This feature relies on the dimensions of the terminal's font. By default, a width of 8 and height of 11 are used. To use other values, set the options <code>iterm2_font_width</code> and <code>iterm2_font_height</code> to the desired values.</p>
<h3 id="kitty">kitty</h3>
<p>This only works in Kitty. It requires PIL (or pillow) to work. Allows remote image previews, for example in an ssh session.</p>
<p>To enable this feature, set the option <code>preview_images_method</code> to kitty.</p>
<h3 id="terminology">terminology</h3>
<p>This only works in terminology. It can render vector graphics, but works only locally.</p>
<p>To enable this feature, set the option <code>preview_images_method</code> to terminology.</p>
<h3 id="ueberzug">ueberzug</h3>
<p>Überzug is a command line utility which draws images on terminals using child windows. It requires PIL (or pillow) and relies on X11. This makes it compatible (in a limited way, i.e., tmux splits are not supported) with many terminals and tmux but not the Linux console or Wayland.</p>
<p>To enable this feature, set the option <code>preview_images_method</code> to ueberzug.</p>
<h3 id="urxvt">urxvt</h3>
<p>This only works in urxvt compiled with pixbuf support. Does not work over ssh.</p>
<p>Essentially this mode sets an image as a terminal background temporarily, so it will break any previously set image background.</p>
<p>To enable this feature, set the option <code>preview_images_method</code> to urxvt.</p>
<h3 id="urxvt-full">urxvt-full</h3>
<p>The same as urxvt but utilizing not only the preview pane but the whole terminal window.</p>
<p>To enable this feature, set the option <code>preview_images_method</code> to urxvt-full.</p>
<h3 id="w3m">w3m</h3>
<p>This does not work over ssh, requires certain terminals (tested on "xterm" and "urxvt") and is incompatible with tmux, although it works with screen.</p>
<p>To enable this feature, install the program "w3m" and set the option <code>preview_images_method</code> to w3m.</p>
<p>When using a terminal with a nonzero border which is not automatically detected, the w3m preview will be misaligned. Use the <code>w3m_offset</code> option to manually adjust the image offset. This should be the same value as the terminal's border value.</p>
<h2 id="SELECTION">SELECTION</h2>
<p>The <i>selection</i> is defined as "All marked files IF THERE ARE ANY, otherwise the current file." Be aware of this when using the :delete command, which deletes all files in the selection.</p>
<p>You can mark files by pressing <Space>, v, etc. A yellow <b>Mrk</b> symbol at the bottom right indicates that there are marked files in this directory.</p>
<h2 id="MACROS">MACROS</h2>
<p>Macros can be used in commands to abbreviate things.</p>
<pre><code>%f the highlighted file
%d the path of the current directory
%s the selected files in the current directory
%t all tagged files in the current directory
%c the full paths of the currently copied/cut files
%p the full paths of selected files</code></pre>
<p>The macros %f, %d, %p, and %s also have upper case variants, %F, %D, %P, and %S, which refer to the next tab. To refer to specific tabs, add a number in between. (%7s = selection of the seventh tab.)</p>
<p>%c is the only macro which ranges out of the current directory. So you may "abuse" the copying function for other purposes, like diffing two files which are in different directories:</p>
<pre><code>Yank the file A (type yy), move to the file B, then type
@diff %c %f</code></pre>
<p>Macros for file paths are generally shell-escaped so they can be used in the <code>shell</code> command.</p>
<p>When mapping keys you can use the placeholder <any>, the key entered in that position can be used through the %any and %any_path macros. (When using multiple <any> placeholders you can index the macros: %any0, %any_path0, %any1, %any_path1...) The macro %any will be replaced with the key pressed in the position of the <any> placeholder. The macro %any_path will be replaced with the path of the bookmark mapped to the key pressed in the position of the <any> placeholder. For example this macro can be used to echo the key that was pressed after "c":</p>
<pre><code>map c<any> echo %any</code></pre>
<p>%any is used in the ranger configuration to create a keybinding for adding a bookmark. c<set_bookmark> creates a bookmark for the current directory and the key for the bookmark is the first supplied argument. In this case the key pressed after "m":</p>
<pre><code>map m<any> set_bookmark %any</code></pre>
<p>The %any_path macro can be used to echo the path of the bookmark that is set to the key pressed after "c":</p>
<pre><code>map c<any> echo %any_path</code></pre>
<p>A practical example of the use of %any_path is the pasting of cut/copied files to a bookmarked directory:</p>
<pre><code>map p'<any> paste dest=%any_path</code></pre>
<p>The macro %rangerdir expands to the directory of ranger's python library, you can use it for something like this command: alias show_commands shell less %rangerdir/config/commands.py</p>
<p>%confdir expands to the directory given by <b>--confdir</b>.</p>
<p>%datadir expands to the directory given by <b>--datadir</b>.</p>
<p>The macro %space expands to a space character. You can use it to add spaces to the end of a command when needed, while preventing editors to strip spaces off the end of the line automatically.</p>
<p>To write a literal %, you need to escape it by writing %%.</p>
<p>Note that macros are expanded twice when using chain. For example, to insert a space character in a chained command, you would write %%space: chain command1; command2%%space</p>
<h2 id="BOOKMARKS">BOOKMARKS</h2>
<p>Type <b>m<key></b> to bookmark the current directory. You can re-enter this directory by typing <b>`<key></b>. <key> can be any letter or digit. Unlike vim, both lowercase and uppercase bookmarks are persistent.</p>
<p>Each time you jump to a bookmark, the special bookmark at key ` will be set to the last directory. So typing "``" gets you back to where you were before.</p>
<p>Bookmarks are selectable when tabbing in the :cd command.</p>
<p>Note: The bookmarks ' (Apostrophe) and ` (Backtick) are the same.</p>
<h2 id="RIFLE">RIFLE</h2>
<p>Rifle is the file opener of ranger. It can be used as a standalone program or a python module. It is located at <i>$repo/ranger/ext/rifle.py</i>. In contrast to other, more simple file openers, rifle can automatically find installed programs so it can be used effectively out of the box on a variety of systems.</p>
<p>It's configured in <i>rifle.conf</i> through a list of conditions and commands. For each line the conditions are checked and if they are met, the respective command is taken into consideration. By default, simply the first matching rule is used. In ranger, you can list and choose rules by typing "r" or simply by typing "<rulenumber><enter>". If you use rifle standalone, you can list all rules with the "-l" option and pick a rule with "-p <number>".</p>
<p>The rules, along with further documentation, are contained in <i>$repo/ranger/config/rifle.conf</i>.</p>
<h2 id="FLAGS">FLAGS</h2>
<p>Flags give you a way to modify the behavior of the spawned process. They are used in the commands <code>:open_with</code> (key "r") and <code>:shell</code> (key "!").</p>
<pre><code>f Fork the process, i.e. run in background. Please use this flag
instead of calling "disown" or "nohup", to avoid killing the
background command when pressing Ctrl+C in ranger.
c Run the current file only, instead of the selection
r Run application with root privilege (requires sudo)
t Run application in a new terminal window</code></pre>
<p>There are some additional flags that can currently be used only in the <code>shell</code> command: (for example <code>:shell -w df</code>)</p>
<pre><code>p Redirect output to the pager
s Silent mode. Output will be discarded.
w Wait for an Enter-press when the process is done</code></pre>
<p>By default, all the flags are off unless otherwise specified in <i>rc.conf</i> key bindings or <i>rifle.conf</i> rules. You can specify as many flags as you want. An uppercase flag negates the effect: "ffcccFsf" is equivalent to "cs".</p>
<p>The terminal program name for the "t" flag is taken from the environment variable $TERMCMD. If it doesn't exist, it tries to extract it from $TERM, uses "x-terminal-emulator" as a fallback, and then "xterm" if that fails.</p>
<p>Examples: <code>:open_with c</code> will open the file that you currently point at, even if you have selected other files. <code>:shell -w df</code> will run "df" and wait for you to press Enter before switching back to ranger.</p>
<h2 id="PLUGINS">PLUGINS</h2>
<p>ranger's plugin system consists of python files which are located in <i>~/.config/ranger/plugins/</i> and are imported in alphabetical order when starting ranger. A plugin changes rangers behavior by overwriting or extending a function that ranger uses. This allows you to change pretty much every part of ranger, but there is no guarantee that things will continue to work in future versions as the source code evolves.</p>
<p>Adding new commands via a plugin as simple as specifying them like you would do in the <i>commands.py</i>.</p>
<p>There are some hooks that are specifically made for the use in plugins. They are functions that start with hook_ and can be found throughout the code.</p>
<pre><code>grep 'def hook_' -r /path/to/rangers/source</code></pre>
<p>Also try:</p>
<pre><code>pydoc ranger.api</code></pre>
<p>Note that you should NOT simply overwrite a function unless you know what you're doing. Instead, save the existing function and call it from your new one. This way, multiple plugins can use the same hook. There are several sample plugins in the <i>/usr/share/doc/ranger/examples/</i> directory, including a hello-world plugin that describes this procedure.</p>
<h1 id="KEY-BINDINGS">KEY BINDINGS</h1>
<p>Key bindings are defined in the file <i>%rangerdir/config/rc.conf</i>. Check this file for a list of all key bindings. You can copy it to your local configuration directory with the --copy-config=rc option.</p>
<p>Many key bindings take an additional numeric argument. Type <i>5j</i> to move down 5 lines, <i>2l</i> to open a file in mode 2, <i>10<Space></i> to mark 10 files.</p>
<p>This list contains the most useful bindings:</p>
<h2 id="MAIN-BINDINGS">MAIN BINDINGS</h2>
<dl>
<dt id="h-j-k-l">h, j, k, l</dt>
<dd>
<p>Move left, down, up or right</p>
</dd>
<dt id="D-or-J-U-or-K">^D or J, ^U or K</dt>
<dd>
<p>Move a half page down, up</p>
</dd>
<dt id="H-L">H, L</dt>
<dd>
<p>Move back and forward in the history</p>
</dd>
<dt id="gg">gg</dt>
<dd>
<p>Move to the top</p>
</dd>
<dt id="G">G</dt>
<dd>
<p>Move to the bottom</p>
</dd>
<dt id="pod20">[, ]</dt>
<dd>
<p>Move up and down in the parent directory.</p>
</dd>
<dt id="R">^R</dt>
<dd>
<p>Reload everything</p>
</dd>
<dt id="F">F</dt>
<dd>
<p>Toggle <i>freeze_files</i> setting. When active (indicated by a cyan <i>FROZEN</i> message in the status bar), directories and files will not be loaded, improving performance when all the files you need are already loaded. This does not affect file previews, which can be toggled with <i>zI</i>. Also try disabling the preview of directories with <i>zP</i>.</p>
</dd>
<dt id="L">^L</dt>
<dd>
<p>Redraw the screen</p>
</dd>
<dt id="i">i</dt>
<dd>
<p>Inspect the current file in a bigger window.</p>
</dd>
<dt id="E">E</dt>
<dd>
<p>Edit the current file in $VISUAL otherwise $EDITOR otherwise "vim"</p>
</dd>
<dt id="S">S</dt>
<dd>
<p>Open a shell in the current directory</p>
</dd>
<dt id="pod21">?</dt>
<dd>
<p>Opens this man page</p>
</dd>
<dt id="W">W</dt>
<dd>
<p>Opens the log window where you can review messages that pop up at the bottom.</p>
</dd>
<dt id="w">w</dt>
<dd>
<p>Opens the task window where you can view and modify background processes that currently run in ranger. In there, you can type "dd" to abort a process and "J" or "K" to change the priority of a process. Only one process is run at a time.</p>
</dd>
<dt id="C">^C</dt>
<dd>
<p>Stop the currently running background process that ranger has started, like copying files, loading directories or file previews.</p>
</dd>
<dt id="octal-whowhat--whowhat"><octal>=, +<who><what>, -<who><what></dt>
<dd>
<p>Change the permissions of the selection. For example, <code>777=</code> is equivalent to <code>chmod 777 %s</code>, <code>+ar</code> does <code>chmod a+r %s</code>, <code>-ow</code> does <code>chmod o-w %s</code> etc.</p>
</dd>
<dt id="yy">yy</dt>
<dd>
<p>Copy (yank) the selection, like pressing Ctrl+C in modern GUI programs. (You can also type "ya" to add files to the copy buffer, "yr" to remove files again, or "yt" for toggling.)</p>
</dd>
<dt id="dd">dd</dt>
<dd>
<p>Cut the selection, like pressing Ctrl+X in modern GUI programs. (There are also "da", "dr" and "dt" shortcuts equivalent to "ya", "yr" and "yt".)</p>
</dd>
<dt id="pp">pp</dt>
<dd>
<p>Paste the files which were previously copied or cut, like pressing Ctrl+V in modern GUI programs.</p>
<p>Conflicts will be renamed by appending an '_' (and a counter if necessary), resulting in <code>file.ext_</code>, <code>file.ext_0</code>, etc. If you prefer <code>file_.ext</code> you can use the <code>paste_ext</code> command.</p>
</dd>
<dt id="po">po</dt>
<dd>
<p>Paste the copied/cut files, overwriting existing files.</p>
</dd>
<dt id="pP-pO">pP, pO</dt>
<dd>
<p>Like pp and po, but queues the operation so that it will be executed <i>after</i> any other operations. Reminder: type <code>w</code> to open the task window.</p>
</dd>
<dt id="pl-pL">pl, pL</dt>
<dd>
<p>Create symlinks (absolute or relative) to the copied files</p>
</dd>
<dt id="phl">phl</dt>
<dd>
<p>Create hardlinks to the copied files</p>
</dd>
<dt id="pht">pht</dt>
<dd>
<p>Duplicate the subdirectory tree of the copied directory, then create hardlinks for each contained file into the new directory tree.</p>
</dd>
<dt id="mX">m<i>X</i></dt>
<dd>
<p>Create a bookmark with the name <i>X</i></p>
</dd>
<dt id="X">`<i>X</i></dt>
<dd>
<p>Move to the bookmark with the name <i>X</i></p>
</dd>
<dt id="n">n</dt>
<dd>
<p>Find the next file. By default, this gets you to the newest file in the directory, but if you search something using the keys /, cm, ct, ..., it will get you to the next found entry.</p>
</dd>
<dt id="N">N</dt>
<dd>
<p>Find the previous file.</p>
</dd>
<dt id="oX">o<i>X</i></dt>
<dd>
<p>Change the sort method (like in mutt)</p>
</dd>
<dt id="zX">z<i>X</i></dt>
<dd>
<p>Change settings. See the settings section for a list of settings and their hotkey.</p>
</dd>
<dt id="u">u<i>?</i></dt>
<dd>
<p>Universal undo-key. Depending on the key that you press after "u", it either restores closed tabs (uq), removes tags (ut), clears the copy/cut buffer (ud), starts the reversed visual mode (uV) or clears the selection (uv).</p>
</dd>
<dt id="f">f</dt>
<dd>
<p>Quickly navigate by entering a part of the filename.</p>
</dd>
<dt id="Space">Space</dt>
<dd>
<p>Mark a file.</p>
</dd>
<dt id="v">v</dt>
<dd>
<p>Toggle the mark-status of all files</p>
</dd>
<dt id="V">V</dt>
<dd>
<p>Starts the visual mode, which selects all files between the starting point and the cursor until you press ESC. To unselect files in the same way, use "uV".</p>
</dd>
<dt id="pod22">/</dt>
<dd>
<p>Search for files in the current directory.</p>
</dd>
<dt id="pod23">:</dt>
<dd>
<p>Open the console.</p>
</dd>
<dt id="pod24">!</dt>
<dd>
<p>Open the console with the content "shell " so you can quickly run commands</p>
</dd>
<dt id="pod25">@</dt>
<dd>
<p>Open the console with the content "shell %s", placing the cursor before the " %s" so you can quickly run commands with the current selection as the argument.</p>
</dd>
<dt id="r">r</dt>
<dd>
<p>Open the console with the content "open with " so you can decide which program to use to open the current file selection.</p>
</dd>
<dt id="cd">cd</dt>
<dd>
<p>Open the console with the content "cd "</p>
</dd>
<dt id="P">^P</dt>
<dd>
<p>Open the console with the most recent command.</p>
</dd>
<dt id="Alt-N">Alt-<i>N</i></dt>
<dd>
<p>Open a tab. N has to be a number from 0 to 9. If the tab doesn't exist yet, it will be created.</p>
</dd>
<dt id="Alt-l-Alt-r">Alt-l, Alt-r</dt>
<dd>
<p>Shift a tab left, respectively right.</p>
</dd>
<dt id="gn-N">gn, ^N</dt>
<dd>
<p>Create a new tab.</p>
</dd>
<dt id="gt-gT">gt, gT</dt>
<dd>
<p>Go to the next or previous tab. You can also use TAB and SHIFT+TAB instead.</p>
</dd>
<dt id="gc-W">gc, ^W</dt>
<dd>
<p>Close the current tab. The last tab cannot be closed this way.</p>
</dd>
<dt id="M">M</dt>
<dd>
<p>A key chain that allows you to quickly change the line mode of all the files of the current directory. For a more permanent solution, use the command "default_linemode" in your rc.conf.</p>
</dd>
<dt id="d">.d</dt>
<dd>
<p>Apply the typefilter "directory".</p>
</dd>
<dt id="f1">.f</dt>
<dd>
<p>Apply the typefilter "file".</p>
</dd>
<dt id="l">.l</dt>
<dd>
<p>Apply the typefilter "symlink".</p>
</dd>
<dt id="m">.m</dt>
<dd>
<p>Apply a new mimetype filter.</p>
</dd>
<dt id="n1">.n</dt>
<dd>
<p>Apply a new filename filter.</p>
</dd>
<dt id="pod26">.#</dt>
<dd>
<p>Apply a new hash filter.</p>
</dd>
<dt id="pod27">."</dt>
<dd>
<p>Apply a new duplicate filter.</p>
</dd>
<dt id="pod28">.'</dt>
<dd>
<p>Apply a new unique filter.</p>
</dd>
<dt id="pod29">.|</dt>
<dd>
<p>Combine the two topmost filters from the filter stack in the <code>OR</code> relationship, instead of the <code>AND</code> used implicitly.</p>
</dd>
<dt id="pod30">.&</dt>
<dd>
<p>Explicitly combine the two topmost filters in the <code>AND</code> relationship. Usually not needed because filters are implicitly in this relationship though might be useful in more complicated scenarios.</p>
</dd>
<dt id="pod31">.!</dt>
<dd>
<p>Negate the topmost filter.</p>
</dd>
<dt id="r1">.r</dt>
<dd>
<p>Rotate the filter stack by N elements. Where N is provided as a numeric prefix like vim's <i>count</i> and defaults to 1, i.e. move the topmost element to the bottom of the stack.</p>
</dd>
<dt id="c">.c</dt>
<dd>
<p>Clear the filter stack.</p>
</dd>
<dt id="pod32">.*</dt>
<dd>
<p>Decompose the topmost filter combinator (e.g. <code>.!</code>, <code>.|</code>).</p>
</dd>
<dt id="p">.p</dt>
<dd>
<p>Pop the topmost filter from the filter stack.</p>
</dd>
<dt id="pod33">..</dt>
<dd>
<p>Show the current filter stack state.</p>
</dd>
</dl>
<h2 id="READLINE-LIKE-BINDINGS-IN-THE-CONSOLE">READLINE-LIKE BINDINGS IN THE CONSOLE</h2>
<dl>
<dt id="B-F">^B, ^F</dt>
<dd>
<p>Move left and right (B for back, F for forward)</p>
</dd>
<dt id="P-N">^P, ^N</dt>
<dd>
<p>Move up and down (P for previous, N for Next)</p>
</dd>
<dt id="A-E">^A, ^E</dt>
<dd>
<p>Move to the start or to the end</p>
</dd>
<dt id="Alt-B-Alt-LEFT">Alt-B, Alt-LEFT</dt>
<dd>
<p>Move backwards by words.</p>
</dd>
<dt id="Alt-F-Alt-RIGHT">Alt-F, Alt-RIGHT</dt>
<dd>
<p>Move forwards by words.</p>
</dd>
<dt id="D">^D</dt>
<dd>
<p>Delete the current character.</p>
</dd>
<dt id="H">^H</dt>
<dd>
<p>Backspace.</p>
</dd>
</dl>
<h1 id="MOUSE-BUTTONS">MOUSE BUTTONS</h1>
<dl>
<dt id="Left-Mouse-Button">Left Mouse Button</dt>
<dd>
<p>Click on something and you'll move there. To run a file, "enter" it, like a directory, by clicking on the preview.</p>
</dd>
<dt id="Right-Mouse-Button">Right Mouse Button</dt>
<dd>