summaryrefslogtreecommitdiff
path: root/ranger/.config/ranger/rc.conf
diff options
context:
space:
mode:
Diffstat (limited to 'ranger/.config/ranger/rc.conf')
-rw-r--r--ranger/.config/ranger/rc.conf726
1 files changed, 726 insertions, 0 deletions
diff --git a/ranger/.config/ranger/rc.conf b/ranger/.config/ranger/rc.conf
new file mode 100644
index 0000000..2722f18
--- /dev/null
+++ b/ranger/.config/ranger/rc.conf
@@ -0,0 +1,726 @@
1# ===================================================================
2# This file contains the default startup commands for ranger.
3# To change them, it is recommended to create either /etc/ranger/rc.conf
4# (system-wide) or ~/.config/ranger/rc.conf (per user) and add your custom
5# commands there.
6#
7# If you copy this whole file there, you may want to set the environment
8# variable RANGER_LOAD_DEFAULT_RC to FALSE to avoid loading it twice.
9#
10# The purpose of this file is mainly to define keybindings and settings.
11# For running more complex python code, please create a plugin in "plugins/" or
12# a command in "commands.py".
13#
14# Each line is a command that will be run before the user interface
15# is initialized. As a result, you can not use commands which rely
16# on the UI such as :delete or :mark.
17# ===================================================================
18
19# ===================================================================
20# == Options
21# ===================================================================
22
23# Which viewmode should be used? Possible values are:
24# miller: Use miller columns which show multiple levels of the hierarchy
25# multipane: Midnight-commander like multipane view showing all tabs next
26# to each other
27set viewmode miller
28#set viewmode multipane
29
30# How many columns are there, and what are their relative widths?
31set column_ratios 1,3,4
32
33# Which files should be hidden? (regular expression)
34set hidden_filter ^\.|\.(?:pyc|pyo|bak|swp)$|^lost\+found$|^__(py)?cache__$
35
36# Show hidden files? You can toggle this by typing 'zh'
37set show_hidden false
38
39# Ask for a confirmation when running the "delete" command?
40# Valid values are "always", "never", "multiple" (default)
41# With "multiple", ranger will ask only if you delete multiple files at once.
42set confirm_on_delete multiple
43
44# Use non-default path for file preview script?
45# ranger ships with scope.sh, a script that calls external programs (see
46# README.md for dependencies) to preview images, archives, etc.
47#set preview_script ~/.config/ranger/scope.sh
48
49# Use the external preview script or display simple plain text or image previews?
50set use_preview_script true
51
52# Automatically count files in the directory, even before entering them?
53set automatically_count_files true
54
55# Open all images in this directory when running certain image viewers
56# like feh or sxiv? You can still open selected files by marking them.
57set open_all_images true
58
59# Be aware of version control systems and display information.
60set vcs_aware false
61
62# State of the four backends git, hg, bzr, svn. The possible states are
63# disabled, local (only show local info), enabled (show local and remote
64# information).
65set vcs_backend_git enabled
66set vcs_backend_hg disabled
67set vcs_backend_bzr disabled
68set vcs_backend_svn disabled
69
70# Use one of the supported image preview protocols
71set preview_images true
72
73# Set the preview image method. Supported methods:
74#
75# * w3m (default):
76# Preview images in full color with the external command "w3mimgpreview"?
77# This requires the console web browser "w3m" and a supported terminal.
78# It has been successfully tested with "xterm" and "urxvt" without tmux.
79#
80# * iterm2:
81# Preview images in full color using iTerm2 image previews
82# (http://iterm2.com/images.html). This requires using iTerm2 compiled
83# with image preview support.
84#
85# This feature relies on the dimensions of the terminal's font. By default, a
86# width of 8 and height of 11 are used. To use other values, set the options
87# iterm2_font_width and iterm2_font_height to the desired values.
88#
89# * terminology:
90# Previews images in full color in the terminology terminal emulator.
91# Supports a wide variety of formats, even vector graphics like svg.
92#
93# * urxvt:
94# Preview images in full color using urxvt image backgrounds. This
95# requires using urxvt compiled with pixbuf support.
96#
97# * urxvt-full:
98# The same as urxvt but utilizing not only the preview pane but the
99# whole terminal window.
100#
101# * kitty:
102# Preview images in full color using kitty image protocol.
103# Requires python PIL or pillow library.
104# If ranger does not share the local filesystem with kitty
105# the transfer method is changed to encode the whole image;
106# while slower, this allows remote previews,
107# for example during an ssh session.
108# Tmux is unsupported.
109set preview_images_method w3m
110
111# Delay in seconds before displaying an image with the w3m method.
112# Increase it in case of experiencing display corruption.
113set w3m_delay 0.02
114
115# Default iTerm2 font size (see: preview_images_method: iterm2)
116set iterm2_font_width 8
117set iterm2_font_height 11
118
119# Use a unicode "..." character to mark cut-off filenames?
120set unicode_ellipsis false
121
122# BIDI support - try to properly display file names in RTL languages (Hebrew, Arabic).
123# Requires the python-bidi pip package
124set bidi_support false
125
126# Show dotfiles in the bookmark preview box?
127set show_hidden_bookmarks true
128
129# Which colorscheme to use? These colorschemes are available by default:
130# default, jungle, snow, solarized
131set colorscheme default
132
133# Preview files on the rightmost column?
134# And collapse (shrink) the last column if there is nothing to preview?
135set preview_files true
136set preview_directories true
137set collapse_preview true
138
139# Save the console history on exit?
140set save_console_history true
141
142# Draw the status bar on top of the browser window (default: bottom)
143set status_bar_on_top false
144
145# Draw a progress bar in the status bar which displays the average state of all
146# currently running tasks which support progress bars?
147set draw_progress_bar_in_status_bar true
148
149# Draw borders around columns? (separators, outline, both, or none)
150# Separators are vertical lines between columns.
151# Outline draws a box around all the columns.
152# Both combines the two.
153set draw_borders none
154
155# Display the directory name in tabs?
156set dirname_in_tabs false
157
158# Enable the mouse support?
159set mouse_enabled true
160
161# Display the file size in the main column or status bar?
162set display_size_in_main_column true
163set display_size_in_status_bar true
164
165# Display the free disk space in the status bar?
166set display_free_space_in_status_bar true
167
168# Display files tags in all columns or only in main column?
169set display_tags_in_all_columns true
170
171# Set a title for the window?
172set update_title false
173
174# Set the title to "ranger" in the tmux program?
175set update_tmux_title true
176
177# Shorten the title if it gets long? The number defines how many
178# directories are displayed at once, 0 turns off this feature.
179set shorten_title 3
180
181# Show hostname in titlebar?
182set hostname_in_titlebar true
183
184# Abbreviate $HOME with ~ in the titlebar (first line) of ranger?
185set tilde_in_titlebar false
186
187# How many directory-changes or console-commands should be kept in history?
188set max_history_size 20
189set max_console_history_size 50
190
191# Try to keep so much space between the top/bottom border when scrolling:
192set scroll_offset 8
193
194# Flush the input after each key hit? (Noticeable when ranger lags)
195set flushinput true
196
197# Padding on the right when there's no preview?
198# This allows you to click into the space to run the file.
199set padding_right true
200
201# Save bookmarks (used with mX and `X) instantly?
202# This helps to synchronize bookmarks between multiple ranger
203# instances but leads to *slight* performance loss.
204# When false, bookmarks are saved when ranger is exited.
205set autosave_bookmarks true
206
207# Save the "`" bookmark to disk. This can be used to switch to the last
208# directory by typing "``".
209set save_backtick_bookmark true
210
211# You can display the "real" cumulative size of directories by using the
212# command :get_cumulative_size or typing "dc". The size is expensive to
213# calculate and will not be updated automatically. You can choose
214# to update it automatically though by turning on this option:
215set autoupdate_cumulative_size false
216
217# Turning this on makes sense for screen readers:
218set show_cursor false
219
220# One of: size, natural, basename, atime, ctime, mtime, type, random
221set sort natural
222
223# Additional sorting options
224set sort_reverse false
225set sort_case_insensitive true
226set sort_directories_first true
227set sort_unicode false
228
229# Enable this if key combinations with the Alt Key don't work for you.
230# (Especially on xterm)
231set xterm_alt_key false
232
233# Whether to include bookmarks in cd command
234set cd_bookmarks true
235
236# Changes case sensitivity for the cd command tab completion
237set cd_tab_case sensitive
238
239# Use fuzzy tab completion with the "cd" command. For example,
240# ":cd /u/lo/b<tab>" expands to ":cd /usr/local/bin".
241set cd_tab_fuzzy false
242
243# Avoid previewing files larger than this size, in bytes. Use a value of 0 to
244# disable this feature.
245set preview_max_size 0
246
247# The key hint lists up to this size have their sublists expanded.
248# Otherwise the submaps are replaced with "...".
249set hint_collapse_threshold 10
250
251# Add the highlighted file to the path in the titlebar
252set show_selection_in_titlebar true
253
254# The delay that ranger idly waits for user input, in milliseconds, with a
255# resolution of 100ms. Lower delay reduces lag between directory updates but
256# increases CPU load.
257set idle_delay 2000
258
259# When the metadata manager module looks for metadata, should it only look for
260# a ".metadata.json" file in the current directory, or do a deep search and
261# check all directories above the current one as well?
262set metadata_deep_search false
263
264# Clear all existing filters when leaving a directory
265set clear_filters_on_dir_change false
266
267# Disable displaying line numbers in main column.
268# Possible values: false, absolute, relative.
269set line_numbers false
270
271# When line_numbers=relative show the absolute line number in the
272# current line.
273set relative_current_zero false
274
275# Start line numbers from 1 instead of 0
276set one_indexed false
277
278# Save tabs on exit
279set save_tabs_on_exit false
280
281# Enable scroll wrapping - moving down while on the last item will wrap around to
282# the top and vice versa.
283set wrap_scroll false
284
285# Set the global_inode_type_filter to nothing. Possible options: d, f and l for
286# directories, files and symlinks respectively.
287set global_inode_type_filter
288
289# This setting allows to freeze the list of files to save I/O bandwidth. It
290# should be 'false' during start-up, but you can toggle it by pressing F.
291set freeze_files false
292
293# ===================================================================
294# == Local Options
295# ===================================================================
296# You can set local options that only affect a single directory.
297
298# Examples:
299# setlocal path=~/downloads sort mtime
300
301# ===================================================================
302# == Command Aliases in the Console
303# ===================================================================
304
305alias e edit
306alias q quit
307alias q! quit!
308alias qa quitall
309alias qa! quitall!
310alias qall quitall
311alias qall! quitall!
312alias setl setlocal
313
314alias filter scout -prts
315alias find scout -aets
316alias mark scout -mr
317alias unmark scout -Mr
318alias search scout -rs
319alias search_inc scout -rts
320alias travel scout -aefklst
321
322# ===================================================================
323# == Define keys for the browser
324# ===================================================================
325
326# Basic
327map Q quitall
328map q quit
329copymap q ZZ ZQ
330
331map R reload_cwd
332map F set freeze_files!
333map <C-r> reset
334map <C-l> redraw_window
335map <C-c> abort
336map <esc> change_mode normal
337map ~ set viewmode!
338
339map i display_file
340map ? help
341map W display_log
342map w taskview_open
343map S shell $SHELL
344
345map : console
346map ; console
347map ! console shell%space
348map @ console -p6 shell %%s
349map # console shell -p%space
350map s console shell%space
351map r chain draw_possible_programs; console open_with%%space
352map f console find%space
353map cd console cd%space
354
355map <C-p> chain console; eval fm.ui.console.history_move(-1)
356
357# Change the line mode
358map Mf linemode filename
359map Mi linemode fileinfo
360map Mm linemode mtime
361map Mp linemode permissions
362map Ms linemode sizemtime
363map Mt linemode metatitle
364
365# Tagging / Marking
366map t tag_toggle
367map ut tag_remove
368map "<any> tag_toggle tag=%any
369map <Space> mark_files toggle=True
370map v mark_files all=True toggle=True
371map uv mark_files all=True val=False
372map V toggle_visual_mode
373map uV toggle_visual_mode reverse=True
374
375# For the nostalgics: Midnight Commander bindings
376map <F1> help
377map <F2> rename_append
378map <F3> display_file
379map <F4> edit
380map <F5> copy
381map <F6> cut
382map <F7> console mkdir%space
383map <F8> console delete
384map <F10> exit
385
386# In case you work on a keyboard with dvorak layout
387map <UP> move up=1
388map <DOWN> move down=1
389map <LEFT> move left=1
390map <RIGHT> move right=1
391map <HOME> move to=0
392map <END> move to=-1
393map <PAGEDOWN> move down=1 pages=True
394map <PAGEUP> move up=1 pages=True
395map <CR> move right=1
396#map <DELETE> console delete
397map <INSERT> console touch%space
398
399# VIM-like
400copymap <UP> k
401copymap <DOWN> j
402copymap <LEFT> h
403copymap <RIGHT> l
404copymap <HOME> gg
405copymap <END> G
406copymap <PAGEDOWN> <C-F>
407copymap <PAGEUP> <C-B>
408
409map J move down=0.5 pages=True
410map K move up=0.5 pages=True
411copymap J <C-D>
412copymap K <C-U>
413
414# Jumping around
415map H history_go -1
416map L history_go 1
417map ] move_parent 1
418map [ move_parent -1
419map } traverse
420map { traverse_backwards
421map ) jump_non
422
423map gh cd ~
424map ge cd /etc
425map gw cd /home/ssaini/Pictures/Walls
426map gu cd /usr
427map gd cd /dev
428map gl cd -r .
429map gL cd -r %f
430map go cd /opt
431map gv cd /var
432map gm cd /run/media
433map gi eval fm.cd('/run/media/' + os.getenv('USER'))
434map gM cd /mnt
435map gs cd /srv
436map gp cd /tmp
437map gr cd /
438map gR eval fm.cd(ranger.RANGERDIR)
439map g/ cd /
440map g? cd /usr/share/doc/ranger
441
442# External Programs
443map E edit
444map du shell -p du --max-depth=1 -h --apparent-size
445map dU shell -p du --max-depth=1 -h --apparent-size | sort -rh
446map yp yank path
447map yd yank dir
448map yn yank name
449map y. yank name_without_extension
450
451# Filesystem Operations
452map = chmod
453
454map cw console rename%space
455map a rename_append
456map A eval fm.open_console('rename ' + fm.thisfile.relative_path.replace("%", "%%"))
457map I eval fm.open_console('rename ' + fm.thisfile.relative_path.replace("%", "%%"), position=7)
458
459map pp paste
460map po paste overwrite=True
461map pP paste append=True
462map pO paste overwrite=True append=True
463map pl paste_symlink relative=False
464map pL paste_symlink relative=True
465map phl paste_hardlink
466map pht paste_hardlinked_subtree
467
468map dD console delete
469
470map dd cut
471map ud uncut
472map da cut mode=add
473map dr cut mode=remove
474map dt cut mode=toggle
475
476map yy copy
477map uy uncut
478map ya copy mode=add
479map yr copy mode=remove
480map yt copy mode=toggle
481
482# Temporary workarounds
483map dgg eval fm.cut(dirarg=dict(to=0), narg=quantifier)
484map dG eval fm.cut(dirarg=dict(to=-1), narg=quantifier)
485map dj eval fm.cut(dirarg=dict(down=1), narg=quantifier)
486map dk eval fm.cut(dirarg=dict(up=1), narg=quantifier)
487map ygg eval fm.copy(dirarg=dict(to=0), narg=quantifier)
488map yG eval fm.copy(dirarg=dict(to=-1), narg=quantifier)
489map yj eval fm.copy(dirarg=dict(down=1), narg=quantifier)
490map yk eval fm.copy(dirarg=dict(up=1), narg=quantifier)
491
492# Searching
493map / console search%space
494map n search_next
495map N search_next forward=False
496map ct search_next order=tag
497map cs search_next order=size
498map ci search_next order=mimetype
499map cc search_next order=ctime
500map cm search_next order=mtime
501map ca search_next order=atime
502
503# Tabs
504map <C-n> tab_new
505map <C-w> tab_close
506map <TAB> tab_move 1
507map <S-TAB> tab_move -1
508map <A-Right> tab_move 1
509map <A-Left> tab_move -1
510map gt tab_move 1
511map gT tab_move -1
512map gn tab_new
513map gc tab_close
514map uq tab_restore
515map <a-1> tab_open 1
516map <a-2> tab_open 2
517map <a-3> tab_open 3
518map <a-4> tab_open 4
519map <a-5> tab_open 5
520map <a-6> tab_open 6
521map <a-7> tab_open 7
522map <a-8> tab_open 8
523map <a-9> tab_open 9
524map <a-r> tab_shift 1
525map <a-l> tab_shift -1
526
527# Sorting
528map or set sort_reverse!
529map oz set sort=random
530map os chain set sort=size; set sort_reverse=False
531map ob chain set sort=basename; set sort_reverse=False
532map on chain set sort=natural; set sort_reverse=False
533map om chain set sort=mtime; set sort_reverse=False
534map oc chain set sort=ctime; set sort_reverse=False
535map oa chain set sort=atime; set sort_reverse=False
536map ot chain set sort=type; set sort_reverse=False
537map oe chain set sort=extension; set sort_reverse=False
538
539map oS chain set sort=size; set sort_reverse=True
540map oB chain set sort=basename; set sort_reverse=True
541map oN chain set sort=natural; set sort_reverse=True
542map oM chain set sort=mtime; set sort_reverse=True
543map oC chain set sort=ctime; set sort_reverse=True
544map oA chain set sort=atime; set sort_reverse=True
545map oT chain set sort=type; set sort_reverse=True
546map oE chain set sort=extension; set sort_reverse=True
547
548map dc get_cumulative_size
549
550# Settings
551map zc set collapse_preview!
552map zd set sort_directories_first!
553map zh set show_hidden!
554map <C-h> set show_hidden!
555copymap <C-h> <backspace>
556copymap <backspace> <backspace2>
557map zI set flushinput!
558map zi set preview_images!
559map zm set mouse_enabled!
560map zp set preview_files!
561map zP set preview_directories!
562map zs set sort_case_insensitive!
563map zu set autoupdate_cumulative_size!
564map zv set use_preview_script!
565map zf console filter%space
566copymap zf zz
567
568# Filter stack
569map .n console filter_stack add name%space
570map .m console filter_stack add mime%space
571map .d filter_stack add type d
572map .f filter_stack add type f
573map .l filter_stack add type l
574map .| filter_stack add or
575map .& filter_stack add and
576map .! filter_stack add not
577map .r console filter_stack rotate
578map .c filter_stack clear
579map .* filter_stack decompose
580map .p filter_stack pop
581map .. filter_stack show
582
583# Bookmarks
584map `<any> enter_bookmark %any
585map '<any> enter_bookmark %any
586map m<any> set_bookmark %any
587map um<any> unset_bookmark %any
588
589map m<bg> draw_bookmarks
590copymap m<bg> um<bg> `<bg> '<bg>
591
592# Generate all the chmod bindings with some python help:
593eval for arg in "rwxXst": cmd("map +u{0} shell -f chmod u+{0} %s".format(arg))
594eval for arg in "rwxXst": cmd("map +g{0} shell -f chmod g+{0} %s".format(arg))
595eval for arg in "rwxXst": cmd("map +o{0} shell -f chmod o+{0} %s".format(arg))
596eval for arg in "rwxXst": cmd("map +a{0} shell -f chmod a+{0} %s".format(arg))
597eval for arg in "rwxXst": cmd("map +{0} shell -f chmod u+{0} %s".format(arg))
598
599eval for arg in "rwxXst": cmd("map -u{0} shell -f chmod u-{0} %s".format(arg))
600eval for arg in "rwxXst": cmd("map -g{0} shell -f chmod g-{0} %s".format(arg))
601eval for arg in "rwxXst": cmd("map -o{0} shell -f chmod o-{0} %s".format(arg))
602eval for arg in "rwxXst": cmd("map -a{0} shell -f chmod a-{0} %s".format(arg))
603eval for arg in "rwxXst": cmd("map -{0} shell -f chmod u-{0} %s".format(arg))
604
605# ===================================================================
606# == Define keys for the console
607# ===================================================================
608# Note: Unmapped keys are passed directly to the console.
609
610# Basic
611cmap <tab> eval fm.ui.console.tab()
612cmap <s-tab> eval fm.ui.console.tab(-1)
613cmap <ESC> eval fm.ui.console.close()
614cmap <CR> eval fm.ui.console.execute()
615cmap <C-l> redraw_window
616
617copycmap <ESC> <C-c>
618copycmap <CR> <C-j>
619
620# Move around
621cmap <up> eval fm.ui.console.history_move(-1)
622cmap <down> eval fm.ui.console.history_move(1)
623cmap <left> eval fm.ui.console.move(left=1)
624cmap <right> eval fm.ui.console.move(right=1)
625cmap <home> eval fm.ui.console.move(right=0, absolute=True)
626cmap <end> eval fm.ui.console.move(right=-1, absolute=True)
627cmap <a-b> eval fm.ui.console.move_word(left=1)
628cmap <a-f> eval fm.ui.console.move_word(right=1)
629
630copycmap <a-b> <a-left>
631copycmap <a-f> <a-right>
632
633# Line Editing
634cmap <backspace> eval fm.ui.console.delete(-1)
635cmap <delete> eval fm.ui.console.delete(0)
636cmap <C-w> eval fm.ui.console.delete_word()
637cmap <A-d> eval fm.ui.console.delete_word(backward=False)
638cmap <C-k> eval fm.ui.console.delete_rest(1)
639cmap <C-u> eval fm.ui.console.delete_rest(-1)
640cmap <C-y> eval fm.ui.console.paste()
641
642# And of course the emacs way
643copycmap <ESC> <C-g>
644copycmap <up> <C-p>
645copycmap <down> <C-n>
646copycmap <left> <C-b>
647copycmap <right> <C-f>
648copycmap <home> <C-a>
649copycmap <end> <C-e>
650copycmap <delete> <C-d>
651copycmap <backspace> <C-h>
652
653# Note: There are multiple ways to express backspaces. <backspace> (code 263)
654# and <backspace2> (code 127). To be sure, use both.
655copycmap <backspace> <backspace2>
656
657# This special expression allows typing in numerals:
658cmap <allow_quantifiers> false
659
660# ===================================================================
661# == Pager Keybindings
662# ===================================================================
663
664# Movement
665pmap <down> pager_move down=1
666pmap <up> pager_move up=1
667pmap <left> pager_move left=4
668pmap <right> pager_move right=4
669pmap <home> pager_move to=0
670pmap <end> pager_move to=-1
671pmap <pagedown> pager_move down=1.0 pages=True
672pmap <pageup> pager_move up=1.0 pages=True
673pmap <C-d> pager_move down=0.5 pages=True
674pmap <C-u> pager_move up=0.5 pages=True
675
676copypmap <UP> k <C-p>
677copypmap <DOWN> j <C-n> <CR>
678copypmap <LEFT> h
679copypmap <RIGHT> l
680copypmap <HOME> g
681copypmap <END> G
682copypmap <C-d> d
683copypmap <C-u> u
684copypmap <PAGEDOWN> n f <C-F> <Space>
685copypmap <PAGEUP> p b <C-B>
686
687# Basic
688pmap <C-l> redraw_window
689pmap <ESC> pager_close
690copypmap <ESC> q Q i <F3>
691pmap E edit_file
692
693# ===================================================================
694# == Taskview Keybindings
695# ===================================================================
696
697# Movement
698tmap <up> taskview_move up=1
699tmap <down> taskview_move down=1
700tmap <home> taskview_move to=0
701tmap <end> taskview_move to=-1
702tmap <pagedown> taskview_move down=1.0 pages=True
703tmap <pageup> taskview_move up=1.0 pages=True
704tmap <C-d> taskview_move down=0.5 pages=True
705tmap <C-u> taskview_move up=0.5 pages=True
706
707copytmap <UP> k <C-p>
708copytmap <DOWN> j <C-n> <CR>
709copytmap <HOME> g
710copytmap <END> G
711copytmap <C-u> u
712copytmap <PAGEDOWN> n f <C-F> <Space>
713copytmap <PAGEUP> p b <C-B>
714
715# Changing priority and deleting tasks
716tmap J eval -q fm.ui.taskview.task_move(-1)
717tmap K eval -q fm.ui.taskview.task_move(0)
718tmap dd eval -q fm.ui.taskview.task_remove()
719tmap <pagedown> eval -q fm.ui.taskview.task_move(-1)
720tmap <pageup> eval -q fm.ui.taskview.task_move(0)
721tmap <delete> eval -q fm.ui.taskview.task_remove()
722
723# Basic
724tmap <C-l> redraw_window
725tmap <ESC> taskview_close
726copytmap <ESC> q Q w <C-c>