]> git.rmz.io Git - dotfiles.git/blob - ranger/rc.conf
ranger: set local sort options
[dotfiles.git] / ranger / rc.conf
1 # ===================================================================
2 # This file contains the default startup commands for ranger.
3 # To change them, it is recommended to create the file
4 # ~/.config/ranger/rc.conf and add your custom commands there.
5 #
6 # If you copy this whole file there, you may want to set the environment
7 # variable RANGER_LOAD_DEFAULT_RC to FALSE to avoid loading it twice.
8 #
9 # The purpose of this file is mainly to define keybindings and settings.
10 # For running more complex python code, please create a plugin in "plugins/" or
11 # a command in "commands.py".
12 #
13 # Each line is a command that will be run before the user interface
14 # is initialized. As a result, you can not use commands which rely
15 # on the UI such as :delete or :mark.
16 # ===================================================================
17
18 # ===================================================================
19 # == Options
20 # ===================================================================
21
22 # How many columns are there, and what are their relative widths?
23 #set column_ratios 1,3,4
24
25 # Which files should be hidden? (regular expression)
26 set hidden_filter ^\.|^lost\+found$
27
28 # Show hidden files? You can toggle this by typing 'zh'
29 #set show_hidden false
30
31 # Ask for a confirmation when running the "delete" command?
32 # Valid values are "always" (default), "never", "multiple"
33 # With "multiple", ranger will ask only if you delete multiple files at once.
34 set confirm_on_delete multiple
35
36 # Which script is used to generate file previews?
37 # ranger ships with scope.sh, a script that calls external programs (see
38 # README for dependencies) to preview images, archives, etc.
39 set preview_script ~/.config/ranger/scope.sh
40
41 # Use the external preview script or display simple plain text previews?
42 set use_preview_script true
43
44 # Open all images in this directory when running certain image viewers
45 # like feh or sxiv? You can still open selected files by marking them.
46 set open_all_images true
47
48 # Be aware of version control systems and display information.
49 set vcs_aware true
50
51 # State of the three backends git, hg, bzr. The possible states are
52 # disabled, local (only show local info), enabled (show local and remote
53 # information).
54 #set vcs_backend_git enabled
55 #set vcs_backend_hg disabled
56 #set vcs_backend_bzr disabled
57
58 # Preview images in full color with the external command "w3mimgpreview"?
59 # This requires the console web browser "w3m" and a supported terminal.
60 # It has been successfully tested with "xterm" and "urxvt" without tmux.
61 # Does not work in urxvt with 32bit colordepth, tradeoff between preview
62 # and transparency.
63 set preview_images true
64
65 # Use a unicode "..." character to mark cut-off filenames?
66 set unicode_ellipsis true
67
68 # Show dotfiles in the bookmark preview box?
69 #set show_hidden_bookmarks true
70
71 # Which colorscheme to use? These colorschemes are available by default:
72 # default, jungle, snow
73 set colorscheme custom
74
75 # Preview files on the rightmost column?
76 # And collapse (shrink) the last column if there is nothing to preview?
77 #set preview_files true
78 #set preview_directories true
79 #set collapse_preview true
80
81 # Save the console history on exit?
82 #set save_console_history true
83
84 # Draw the status bar on top of the browser window (default: bottom)
85 #set status_bar_on_top false
86
87 # Draw a progress bar in the status bar which displays the average state of all
88 # currently running tasks which support progress bars?
89 #set draw_progress_bar_in_status_bar true
90
91 # Draw borders around columns?
92 set draw_borders true
93
94 # Display the directory name in tabs?
95 set dirname_in_tabs true
96
97 # Enable the mouse support?
98 #set mouse_enabled true
99
100 # Display the file size in the main column or status bar?
101 #set display_size_in_main_column true
102 #set display_size_in_status_bar true
103
104 # Display files tags in all columns or only in main column?
105 #set display_tags_in_all_columns true
106
107 # Set a title for the window?
108 set update_title true
109
110 # Set the title to "ranger" in the tmux program?
111 #set update_tmux_title false
112
113 # Shorten the title if it gets long? The number defines how many
114 # directories are displayed at once, 0 turns off this feature.
115 #set shorten_title 3
116
117 # Abbreviate $HOME with ~ in the titlebar (first line) of ranger?
118 set tilde_in_titlebar true
119
120 # How many directory-changes or console-commands should be kept in history?
121 set max_history_size 2000
122 set max_console_history_size 5000
123
124 # Try to keep so much space between the top/bottom border when scrolling:
125 #set scroll_offset 8
126
127 # Flush the input after each key hit? (Noticable when ranger lags)
128 #set flushinput true
129
130 # Padding on the right when there's no preview?
131 # This allows you to click into the space to run the file.
132 set padding_right false
133
134 # Save bookmarks (used with mX and `X) instantly?
135 # This helps to synchronize bookmarks between multiple ranger
136 # instances but leads to *slight* performance loss.
137 # When false, bookmarks are saved when ranger is exited.
138 #set autosave_bookmarks true
139
140 # You can display the "real" cumulative size of directories by using the
141 # command :get_cumulative_size or typing "dc". The size is expensive to
142 # calculate and will not be updated automatically. You can choose
143 # to update it automatically though by turning on this option:
144 set autoupdate_cumulative_size false
145
146 # Turning this on makes sense for screen readers:
147 #set show_cursor false
148
149 # One of: size, basename, mtime, type
150 #set sort natural
151
152 # Additional sorting options
153 #set sort_reverse false
154 #set sort_case_insensitive true
155 set sort_directories_first false
156
157 # Enable this if key combinations with the Alt Key don't work for you.
158 # (Especially on xterm)
159 #set xterm_alt_key false
160
161 # ===================================================================
162 # == Local Options
163 # ===================================================================
164 # You can set local options that only affect a single directory.
165
166 # Examples:
167 setlocal path=~/downloads sort mtime
168
169 # ===================================================================
170 # == Command Aliases in the Console
171 # ===================================================================
172
173 #alias e edit
174 #alias q quit
175 #alias q! quitall
176 #alias qall quitall
177 #alias setl setlocal
178
179 #alias filter scout -prt
180 #alias find scout -aet
181 #alias mark scout -mr
182 #alias unmark scout -Mr
183 #alias search scout -rs
184 #alias search_inc scout -rts
185 #alias travel scout -aefiklst
186
187 # ===================================================================
188 # == Define keys for the browser
189 # ===================================================================
190
191 # Basic
192 #map Q quit!
193 #map q quit
194 #copymap q ZZ ZQ
195
196 #map R reload_cwd
197 #map <C-r> reset
198 #map <C-l> redraw_window
199 #map <C-c> abort
200 #map <esc> change_mode normal
201
202 #map i display_file
203 #map ? help
204 #map W display_log
205 #map w taskview_open
206 #map S shell $SHELL
207
208 #map : console
209 #map ; console
210 #map ! console shell
211 #map @ console -p6 shell %%s
212 #map # console shell -p
213 #map s console shell
214 #map r chain draw_possible_programs; console open_with
215 #map f console find
216 #map cd console cd
217
218 # Tagging / Marking
219 #map t tag_toggle
220 #map ut tag_remove
221 #map "<any> tag_toggle tag=%any
222 #map <Space> mark_files toggle=True
223 #map v mark_files all=True toggle=True
224 #map uv mark_files all=True val=False
225 #map V toggle_visual_mode
226 #map uV toggle_visual_mode reverse=True
227
228 # For the nostalgics: Midnight Commander bindings
229 #map <F1> help
230 #map <F3> display_file
231 #map <F4> edit
232 #map <F5> copy
233 #map <F6> cut
234 #map <F7> console mkdir
235 #map <F8> console delete
236 #map <F10> exit
237
238 # In case you work on a keyboard with dvorak layout
239 #map <UP> move up=1
240 #map <DOWN> move down=1
241 #map <LEFT> move left=1
242 #map <RIGHT> move right=1
243 #map <HOME> move to=0
244 #map <END> move to=-1
245 #map <PAGEDOWN> move down=1 pages=True
246 #map <PAGEUP> move up=1 pages=True
247 #map <CR> move right=1
248 #map <DELETE> console delete
249 #map <INSERT> console touch
250
251 # VIM-like
252 #copymap <UP> k
253 #copymap <DOWN> j
254 #copymap <LEFT> h
255 #copymap <RIGHT> l
256 #copymap <HOME> gg
257 #copymap <END> G
258 #copymap <PAGEDOWN> <C-F>
259 #copymap <PAGEUP> <C-B>
260
261 #map J move down=0.5 pages=True
262 #map K move up=0.5 pages=True
263 #copymap J <C-D>
264 #copymap K <C-U>
265
266 # Jumping around
267 #map H history_go -1
268 #map L history_go 1
269 #map ] move_parent 1
270 #map [ move_parent -1
271 #map } traverse
272
273 #map gh cd ~
274 #map ge cd /etc
275 #map gu cd /usr
276 #map gd cd /dev
277 #map gl cd -r .
278 #map gL cd -r %f
279 #map go cd /opt
280 #map gv cd /var
281 #map gm cd /media
282 #map gM cd /mnt
283 #map gs cd /srv
284 #map gr cd /
285 #map gR eval fm.cd(ranger.RANGERDIR)
286 #map g/ cd /
287 #map g? cd /usr/share/doc/ranger
288
289 # External Programs
290 #map E edit
291 #map du shell -p du --max-depth=1 -h --apparent-size
292 #map dU shell -p du --max-depth=1 -h --apparent-size | sort -rh
293 #map yp shell -d echo -n %d/%f | xsel -i
294 #map yd shell -d echo -n %d | xsel -i
295 #map yn shell -d echo -n %f | xsel -i
296
297 # Filesystem Operations
298 #map = chmod
299
300 #map cw console rename
301 #map A eval fm.open_console('rename ' + fm.thisfile.basename)
302 #map I eval fm.open_console('rename ' + fm.thisfile.basename, position=7)
303
304 #map pp paste
305 #map po paste overwrite=True
306 #map pl paste_symlink relative=False
307 #map pL paste_symlink relative=True
308 #map phl paste_hardlink
309 #map pht paste_hardlinked_subtree
310
311 #map dd cut
312 #map ud uncut
313 #map da cut mode=add
314 #map dr cut mode=remove
315
316 #map yy copy
317 #map uy uncut
318 #map ya copy mode=add
319 #map yr copy mode=remove
320
321 # Temporary workarounds
322 #map dgg eval fm.cut(dirarg=dict(to=0), narg=quantifier)
323 #map dG eval fm.cut(dirarg=dict(to=-1), narg=quantifier)
324 #map dj eval fm.cut(dirarg=dict(down=1), narg=quantifier)
325 #map dk eval fm.cut(dirarg=dict(up=1), narg=quantifier)
326 #map ygg eval fm.copy(dirarg=dict(to=0), narg=quantifier)
327 #map yG eval fm.copy(dirarg=dict(to=-1), narg=quantifier)
328 #map yj eval fm.copy(dirarg=dict(down=1), narg=quantifier)
329 #map yk eval fm.copy(dirarg=dict(up=1), narg=quantifier)
330
331 # Searching
332 #map / console search
333 #map n search_next
334 #map N search_next forward=False
335 #map ct search_next order=tag
336 #map cs search_next order=size
337 #map ci search_next order=mimetype
338 #map cc search_next order=ctime
339 #map cm search_next order=mtime
340 #map ca search_next order=atime
341
342 # Tabs
343 #map <C-n> tab_new ~
344 #map <C-w> tab_close
345 #map <TAB> tab_move 1
346 #map <S-TAB> tab_move -1
347 #map <A-Right> tab_move 1
348 #map <A-Left> tab_move -1
349 #map gt tab_move 1
350 #map gT tab_move -1
351 map gn tab_new
352 #map gc tab_close
353 #map uq tab_restore
354 map <a-!> tab_open 1
355 map <a-@> tab_open 2
356 map <a-#> tab_open 3
357 map <a-$> tab_open 4
358 map <a-%> tab_open 5
359 map <a-^> tab_open 6
360 map <a-&> tab_open 7
361 map <a-*> tab_open 8
362 map <a-(> tab_open 9
363
364 # Sorting
365 map or toggle_option sort_reverse
366 map os chain setlocal sort=size; setlocal sort_reverse=False
367 map ob chain setlocal sort=basename; setlocal sort_reverse=False
368 map on chain setlocal sort=natural; setlocal sort_reverse=False
369 map om chain setlocal sort=mtime; setlocal sort_reverse=False
370 map oc chain setlocal sort=ctime; setlocal sort_reverse=False
371 map oa chain setlocal sort=atime; setlocal sort_reverse=False
372 map ot chain setlocal sort=type; setlocal sort_reverse=False
373
374 map oS chain setlocal sort=size; setlocal sort_reverse=True
375 map oB chain setlocal sort=basename; setlocal sort_reverse=True
376 map oN chain setlocal sort=natural; setlocal sort_reverse=True
377 map oM chain setlocal sort=mtime; setlocal sort_reverse=True
378 map oC chain setlocal sort=ctime; setlocal sort_reverse=True
379 map oA chain setlocal sort=atime; setlocal sort_reverse=True
380 map oT chain setlocal sort=type; setlocal sort_reverse=True
381
382 map Or toggle_option sort_reverse
383 map Os chain set sort=size; set sort_reverse=False
384 map Ob chain set sort=basename; set sort_reverse=False
385 map On chain set sort=natural; set sort_reverse=False
386 map Om chain set sort=mtime; set sort_reverse=False
387 map Oc chain set sort=ctime; set sort_reverse=False
388 map Oa chain set sort=atime; set sort_reverse=False
389 map Ot chain set sort=type; set sort_reverse=False
390
391 map OS chain set sort=size; set sort_reverse=True
392 map OB chain set sort=basename; set sort_reverse=True
393 map ON chain set sort=natural; set sort_reverse=True
394 map OM chain set sort=mtime; set sort_reverse=True
395 map OC chain set sort=ctime; set sort_reverse=True
396 map OA chain set sort=atime; set sort_reverse=True
397 map OT chain set sort=type; set sort_reverse=True
398
399 #map dc get_cumulative_size
400
401 # Settings
402 #map zc toggle_option collapse_preview
403 #map zd toggle_option sort_directories_first
404 #map zh toggle_option show_hidden
405 #map <C-h> toggle_option show_hidden
406 #map zi toggle_option flushinput
407 #map zm toggle_option mouse_enabled
408 #map zp toggle_option preview_files
409 #map zP toggle_option preview_directories
410 #map zs toggle_option sort_case_insensitive
411 #map zu toggle_option autoupdate_cumulative_size
412 #map zv toggle_option use_preview_script
413 #map zf console filter
414
415 # Bookmarks
416 #map `<any> enter_bookmark %any
417 #map '<any> enter_bookmark %any
418 #map m<any> set_bookmark %any
419 #map um<any> unset_bookmark %any
420
421 #map m<bg> draw_bookmarks
422 #copymap m<bg> um<bg> `<bg> '<bg>
423
424 # Generate all the chmod bindings with some python help:
425 #eval for arg in "rwxXst": cmd("map +u{0} shell -d chmod u+{0} %s".format(arg))
426 #eval for arg in "rwxXst": cmd("map +g{0} shell -d chmod g+{0} %s".format(arg))
427 #eval for arg in "rwxXst": cmd("map +o{0} shell -d chmod o+{0} %s".format(arg))
428 #eval for arg in "rwxXst": cmd("map +a{0} shell -d chmod a+{0} %s".format(arg))
429 #eval for arg in "rwxXst": cmd("map +{0} shell -d chmod u+{0} %s".format(arg))
430
431 #eval for arg in "rwxXst": cmd("map -u{0} shell -d chmod u-{0} %s".format(arg))
432 #eval for arg in "rwxXst": cmd("map -g{0} shell -d chmod g-{0} %s".format(arg))
433 #eval for arg in "rwxXst": cmd("map -o{0} shell -d chmod o-{0} %s".format(arg))
434 #eval for arg in "rwxXst": cmd("map -a{0} shell -d chmod a-{0} %s".format(arg))
435 #eval for arg in "rwxXst": cmd("map -{0} shell -d chmod u-{0} %s".format(arg))
436
437 # ===================================================================
438 # == Define keys for the console
439 # ===================================================================
440 # Note: Unmapped keys are passed directly to the console.
441
442 # Basic
443 #cmap <tab> eval fm.ui.console.tab()
444 #cmap <s-tab> eval fm.ui.console.tab(-1)
445 #cmap <ESC> eval fm.ui.console.close()
446 #cmap <CR> eval fm.ui.console.execute()
447 #cmap <C-l> redraw_window
448
449 #copycmap <ESC> <C-c>
450 #copycmap <CR> <C-j>
451
452 # Move around
453 #cmap <up> eval fm.ui.console.history_move(-1)
454 #cmap <down> eval fm.ui.console.history_move(1)
455 #cmap <left> eval fm.ui.console.move(left=1)
456 #cmap <right> eval fm.ui.console.move(right=1)
457 #cmap <home> eval fm.ui.console.move(right=0, absolute=True)
458 #cmap <end> eval fm.ui.console.move(right=-1, absolute=True)
459
460 # Line Editing
461 #cmap <backspace> eval fm.ui.console.delete(-1)
462 #cmap <delete> eval fm.ui.console.delete(0)
463 #cmap <C-w> eval fm.ui.console.delete_word()
464 #cmap <C-k> eval fm.ui.console.delete_rest(1)
465 #cmap <C-u> eval fm.ui.console.delete_rest(-1)
466 #cmap <C-y> eval fm.ui.console.paste()
467
468 # And of course the emacs way
469 #copycmap <up> <C-p>
470 #copycmap <down> <C-n>
471 #copycmap <left> <C-b>
472 #copycmap <right> <C-f>
473 #copycmap <home> <C-a>
474 #copycmap <end> <C-e>
475 #copycmap <delete> <C-d>
476 #copycmap <backspace> <C-h>
477
478 # Note: There are multiple ways to express backspaces. <backspace> (code 263)
479 # and <backspace2> (code 127). To be sure, use both.
480 #copycmap <backspace> <backspace2>
481
482 # This special expression allows typing in numerals:
483 #cmap <allow_quantifiers> false
484
485 # ===================================================================
486 # == Pager Keybindings
487 # ===================================================================
488
489 # Movement
490 #pmap <down> pager_move down=1
491 #pmap <up> pager_move up=1
492 #pmap <left> pager_move left=4
493 #pmap <right> pager_move right=4
494 #pmap <home> pager_move to=0
495 #pmap <end> pager_move to=-1
496 #pmap <pagedown> pager_move down=1.0 pages=True
497 #pmap <pageup> pager_move up=1.0 pages=True
498 #pmap <C-d> pager_move down=0.5 pages=True
499 #pmap <C-u> pager_move up=0.5 pages=True
500
501 #copypmap <UP> k <C-p>
502 #copypmap <DOWN> j <C-n> <CR>
503 #copypmap <LEFT> h
504 #copypmap <RIGHT> l
505 #copypmap <HOME> g
506 #copypmap <END> G
507 #copypmap <C-d> d
508 #copypmap <C-u> u
509 #copypmap <PAGEDOWN> n f <C-F> <Space>
510 #copypmap <PAGEUP> p b <C-B>
511
512 # Basic
513 #pmap <ESC> pager_close
514 #copypmap <ESC> q Q i <F3>
515 #pmap E edit_file
516
517 # ===================================================================
518 # == Taskview Keybindings
519 # ===================================================================
520
521 # Movement
522 #tmap <up> taskview_move up=1
523 #tmap <down> taskview_move down=1
524 #tmap <home> taskview_move to=0
525 #tmap <end> taskview_move to=-1
526 #tmap <pagedown> taskview_move down=1.0 pages=True
527 #tmap <pageup> taskview_move up=1.0 pages=True
528 #tmap <C-d> taskview_move down=0.5 pages=True
529 #tmap <C-u> taskview_move up=0.5 pages=True
530
531 #copytmap <UP> k <C-p>
532 #copytmap <DOWN> j <C-n> <CR>
533 #copytmap <HOME> g
534 #copytmap <END> G
535 #copytmap <C-u> u
536 #copytmap <PAGEDOWN> n f <C-F> <Space>
537 #copytmap <PAGEUP> p b <C-B>
538
539 # Changing priority and deleting tasks
540 #tmap J eval -q fm.ui.taskview.task_move(-1)
541 #tmap K eval -q fm.ui.taskview.task_move(0)
542 #tmap dd eval -q fm.ui.taskview.task_remove()
543 #tmap <pagedown> eval -q fm.ui.taskview.task_move(-1)
544 #tmap <pageup> eval -q fm.ui.taskview.task_move(0)
545 #tmap <delete> eval -q fm.ui.taskview.task_remove()
546
547 # Basic
548 #tmap <ESC> taskview_close
549 #copytmap <ESC> q Q w <C-c>