|
|
# ===================================================================# This file contains the default startup commands for ranger.# To change them, it is recommended to create either /etc/ranger/rc.conf# (system-wide) or ~/.config/ranger/rc.conf (per user) and add your custom# commands there.## If you copy this whole file there, you may want to set the environment# variable RANGER_LOAD_DEFAULT_RC to FALSE to avoid loading it twice.## The purpose of this file is mainly to define keybindings and settings.# For running more complex python code, please create a plugin in "plugins/" or# a command in "commands.py".## Each line is a command that will be run before the user interface# is initialized. As a result, you can not use commands which rely# on the UI such as :delete or :mark.# ===================================================================
# ===================================================================# == Options# ===================================================================
# Which viewmode should be used? Possible values are:# miller: Use miller columns which show multiple levels of the hierarchy# multipane: Midnight-commander like multipane view showing all tabs next# to each otherset viewmode miller#set viewmode multipane
# How many columns are there, and what are their relative widths?set column_ratios 1,3,4
# Which files should be hidden? (regular expression)set hidden_filter ^\.|\.(?:pyc|pyo|bak|swp)$|^lost\+found$|^__(py)?cache__$
# Show hidden files? You can toggle this by typing 'zh'set show_hidden false
# Ask for a confirmation when running the "delete" command?# Valid values are "always", "never", "multiple" (default)# With "multiple", ranger will ask only if you delete multiple files at once.set confirm_on_delete multiple
# Use non-default path for file preview script?# ranger ships with scope.sh, a script that calls external programs (see# README.md for dependencies) to preview images, archives, etc.#set preview_script ~/.config/ranger/scope.sh
# Use the external preview script or display simple plain text or image previews?set use_preview_script true
# Automatically count files in the directory, even before entering them?set automatically_count_files true
# Open all images in this directory when running certain image viewers# like feh or sxiv? You can still open selected files by marking them.set open_all_images true
# Be aware of version control systems and display information.set vcs_aware false
# State of the four backends git, hg, bzr, svn. The possible states are# disabled, local (only show local info), enabled (show local and remote# information).set vcs_backend_git enabledset vcs_backend_hg disabledset vcs_backend_bzr disabledset vcs_backend_svn disabled
# Use one of the supported image preview protocolsset preview_images false
# Set the preview image method. Supported methods:## * w3m (default):# Preview images in full color with the external command "w3mimgpreview"?# This requires the console web browser "w3m" and a supported terminal.# It has been successfully tested with "xterm" and "urxvt" without tmux.## * iterm2:# Preview images in full color using iTerm2 image previews# (http://iterm2.com/images.html). This requires using iTerm2 compiled# with image preview support.## 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# iterm2_font_width and iterm2_font_height to the desired values.## * terminology:# Previews images in full color in the terminology terminal emulator.# Supports a wide variety of formats, even vector graphics like svg.## * urxvt:# Preview images in full color using urxvt image backgrounds. This# requires using urxvt compiled with pixbuf support.## * urxvt-full:# The same as urxvt but utilizing not only the preview pane but the# whole terminal window.## * kitty:# Preview images in full color using kitty image protocol.# Requires python PIL or pillow library.# If ranger does not share the local filesystem with kitty# the transfer method is changed to encode the whole image;# while slower, this allows remote previews,# for example during an ssh session.# Tmux is unsupported.set preview_images_method w3m
# Delay in seconds before displaying an image with the w3m method.# Increase it in case of experiencing display corruption.set w3m_delay 0.02
# Default iTerm2 font size (see: preview_images_method: iterm2)set iterm2_font_width 8set iterm2_font_height 11
# Use a unicode "..." character to mark cut-off filenames?set unicode_ellipsis false
# BIDI support - try to properly display file names in RTL languages (Hebrew, Arabic).# Requires the python-bidi pip packageset bidi_support false
# Show dotfiles in the bookmark preview box?set show_hidden_bookmarks true
# Which colorscheme to use? These colorschemes are available by default:# default, jungle, snow, solarizedset colorscheme default
# Preview files on the rightmost column?# And collapse (shrink) the last column if there is nothing to preview?set preview_files trueset preview_directories trueset collapse_preview true
# Save the console history on exit?set save_console_history true
# Draw the status bar on top of the browser window (default: bottom)set status_bar_on_top false
# Draw a progress bar in the status bar which displays the average state of all# currently running tasks which support progress bars?set draw_progress_bar_in_status_bar true
# Draw borders around columns? (separators, outline, both, or none)# Separators are vertical lines between columns.# Outline draws a box around all the columns.# Both combines the two.set draw_borders none
# Display the directory name in tabs?set dirname_in_tabs false
# Enable the mouse support?set mouse_enabled true
# Display the file size in the main column or status bar?set display_size_in_main_column trueset display_size_in_status_bar true
# Display the free disk space in the status bar?set display_free_space_in_status_bar true
# Display files tags in all columns or only in main column?set display_tags_in_all_columns true
# Set a title for the window?set update_title false
# Set the title to "ranger" in the tmux program?set update_tmux_title true
# Shorten the title if it gets long? The number defines how many# directories are displayed at once, 0 turns off this feature.set shorten_title 3
# Show hostname in titlebar?set hostname_in_titlebar true
# Abbreviate $HOME with ~ in the titlebar (first line) of ranger?set tilde_in_titlebar false
# How many directory-changes or console-commands should be kept in history?set max_history_size 20set max_console_history_size 50
# Try to keep so much space between the top/bottom border when scrolling:set scroll_offset 8
# Flush the input after each key hit? (Noticeable when ranger lags)set flushinput true
# Padding on the right when there's no preview?# This allows you to click into the space to run the file.set padding_right true
# Save bookmarks (used with mX and `X) instantly?# This helps to synchronize bookmarks between multiple ranger# instances but leads to *slight* performance loss.# When false, bookmarks are saved when ranger is exited.set autosave_bookmarks true
# Save the "`" bookmark to disk. This can be used to switch to the last# directory by typing "``".set save_backtick_bookmark true
# You can display the "real" cumulative size of directories by using the# command :get_cumulative_size or typing "dc". The size is expensive to# calculate and will not be updated automatically. You can choose# to update it automatically though by turning on this option:set autoupdate_cumulative_size false
# Turning this on makes sense for screen readers:set show_cursor false
# One of: size, natural, basename, atime, ctime, mtime, type, randomset sort natural
# Additional sorting optionsset sort_reverse falseset sort_case_insensitive trueset sort_directories_first trueset sort_unicode false
# Enable this if key combinations with the Alt Key don't work for you.# (Especially on xterm)set xterm_alt_key false
# Whether to include bookmarks in cd commandset cd_bookmarks true
# Changes case sensitivity for the cd command tab completionset cd_tab_case sensitive
# Use fuzzy tab completion with the "cd" command. For example,# ":cd /u/lo/b<tab>" expands to ":cd /usr/local/bin".set cd_tab_fuzzy false
# Avoid previewing files larger than this size, in bytes. Use a value of 0 to# disable this feature.set preview_max_size 0
# The key hint lists up to this size have their sublists expanded.# Otherwise the submaps are replaced with "...".set hint_collapse_threshold 10
# Add the highlighted file to the path in the titlebarset show_selection_in_titlebar true
# The delay that ranger idly waits for user input, in milliseconds, with a# resolution of 100ms. Lower delay reduces lag between directory updates but# increases CPU load.set idle_delay 2000
# When the metadata manager module looks for metadata, should it only look for# a ".metadata.json" file in the current directory, or do a deep search and# check all directories above the current one as well?set metadata_deep_search false
# Clear all existing filters when leaving a directoryset clear_filters_on_dir_change false
# Disable displaying line numbers in main column.# Possible values: false, absolute, relative.set line_numbers false
# When line_numbers=relative show the absolute line number in the# current line.set relative_current_zero false
# Start line numbers from 1 instead of 0set one_indexed false
# Save tabs on exitset save_tabs_on_exit false
# Enable scroll wrapping - moving down while on the last item will wrap around to# the top and vice versa.set wrap_scroll false
# Set the global_inode_type_filter to nothing. Possible options: d, f and l for# directories, files and symlinks respectively.set global_inode_type_filter
# This setting allows to freeze the list of files to save I/O bandwidth. It# should be 'false' during start-up, but you can toggle it by pressing F.set freeze_files false
# ===================================================================# == Local Options# ===================================================================# You can set local options that only affect a single directory.
# Examples:# setlocal path=~/downloads sort mtime
# ===================================================================# == Command Aliases in the Console# ===================================================================
alias e editalias q quitalias q! quit!alias qa quitallalias qa! quitall!alias qall quitallalias qall! quitall!alias setl setlocal
alias filter scout -prtsalias find scout -aetsalias mark scout -mralias unmark scout -Mralias search scout -rsalias search_inc scout -rtsalias travel scout -aefklst
# ===================================================================# == Define keys for the browser# ===================================================================
# Basicmap Q quitallmap q quitcopymap q ZZ ZQ
map R reload_cwdmap F set freeze_files!map <C-r> resetmap <C-l> redraw_windowmap <C-c> abortmap <esc> change_mode normalmap ~ set viewmode!
map i display_filemap ? helpmap W display_logmap w taskview_openmap S shell $SHELL
map : consolemap ; consolemap ! console shell%spacemap @ console -p6 shell %%smap # console shell -p%spacemap s console shell%spacemap r chain draw_possible_programs; console open_with%%spacemap f console find%spacemap cd console cd%space
map <C-p> chain console; eval fm.ui.console.history_move(-1)
# Change the line modemap Mf linemode filenamemap Mi linemode fileinfomap Mm linemode mtimemap Mp linemode permissionsmap Ms linemode sizemtimemap Mt linemode metatitle
# Tagging / Markingmap t tag_togglemap ut tag_removemap "<any> tag_toggle tag=%anymap <Space> mark_files toggle=Truemap v mark_files all=True toggle=Truemap uv mark_files all=True val=Falsemap V toggle_visual_modemap uV toggle_visual_mode reverse=True
# For the nostalgics: Midnight Commander bindingsmap <F1> helpmap <F2> rename_appendmap <F3> display_filemap <F4> editmap <F5> copymap <F6> cutmap <F7> console mkdir%spacemap <F8> console deletemap <F10> exit
# In case you work on a keyboard with dvorak layoutmap <UP> move up=1map <DOWN> move down=1map <LEFT> move left=1map <RIGHT> move right=1map <HOME> move to=0map <END> move to=-1map <PAGEDOWN> move down=1 pages=Truemap <PAGEUP> move up=1 pages=Truemap <CR> move right=1#map <DELETE> console deletemap <INSERT> console touch%space
# VIM-likecopymap <UP> kcopymap <DOWN> jcopymap <LEFT> hcopymap <RIGHT> lcopymap <HOME> ggcopymap <END> Gcopymap <PAGEDOWN> <C-F>copymap <PAGEUP> <C-B>
map J move down=0.5 pages=Truemap K move up=0.5 pages=Truecopymap J <C-D>copymap K <C-U>
# Jumping aroundmap H history_go -1map L history_go 1map ] move_parent 1map [ move_parent -1map } traversemap { traverse_backwardsmap ) jump_non
map gh cd ~map ge cd /etcmap gu cd /usrmap gd cd /devmap gl cd -r .map gL cd -r %fmap go cd /optmap gv cd /varmap gm cd /mediamap gi eval fm.cd('/run/media/' + os.getenv('USER'))map gM cd /mntmap gs cd /srvmap gp cd /tmpmap gr cd /map gR eval fm.cd(ranger.RANGERDIR)map g/ cd /map g? cd /usr/share/doc/ranger
# External Programsmap E editmap du shell -p du --max-depth=1 -h --apparent-sizemap dU shell -p du --max-depth=1 -h --apparent-size | sort -rhmap yp yank pathmap yd yank dirmap yn yank namemap y. yank name_without_extension
# Filesystem Operationsmap = chmod
map cw console rename%spacemap a rename_appendmap A eval fm.open_console('rename ' + fm.thisfile.relative_path.replace("%", "%%"))map I eval fm.open_console('rename ' + fm.thisfile.relative_path.replace("%", "%%"), position=7)
map pp pastemap po paste overwrite=Truemap pP paste append=Truemap pO paste overwrite=True append=Truemap pl paste_symlink relative=Falsemap pL paste_symlink relative=Truemap phl paste_hardlinkmap pht paste_hardlinked_subtree
map dD console delete
map dd cutmap ud uncutmap da cut mode=addmap dr cut mode=removemap dt cut mode=toggle
map yy copymap uy uncutmap ya copy mode=addmap yr copy mode=removemap yt copy mode=toggle
# Temporary workaroundsmap dgg eval fm.cut(dirarg=dict(to=0), narg=quantifier)map dG eval fm.cut(dirarg=dict(to=-1), narg=quantifier)map dj eval fm.cut(dirarg=dict(down=1), narg=quantifier)map dk eval fm.cut(dirarg=dict(up=1), narg=quantifier)map ygg eval fm.copy(dirarg=dict(to=0), narg=quantifier)map yG eval fm.copy(dirarg=dict(to=-1), narg=quantifier)map yj eval fm.copy(dirarg=dict(down=1), narg=quantifier)map yk eval fm.copy(dirarg=dict(up=1), narg=quantifier)
# Searchingmap / console search%spacemap n search_nextmap N search_next forward=Falsemap ct search_next order=tagmap cs search_next order=sizemap ci search_next order=mimetypemap cc search_next order=ctimemap cm search_next order=mtimemap ca search_next order=atime
# Tabsmap <C-n> tab_newmap <C-w> tab_closemap <TAB> tab_move 1map <S-TAB> tab_move -1map <A-Right> tab_move 1map <A-Left> tab_move -1map gt tab_move 1map gT tab_move -1map gn tab_newmap gc tab_closemap uq tab_restoremap <a-1> tab_open 1map <a-2> tab_open 2map <a-3> tab_open 3map <a-4> tab_open 4map <a-5> tab_open 5map <a-6> tab_open 6map <a-7> tab_open 7map <a-8> tab_open 8map <a-9> tab_open 9map <a-r> tab_shift 1map <a-l> tab_shift -1
# Sortingmap or set sort_reverse!map oz set sort=randommap os chain set sort=size; set sort_reverse=Falsemap ob chain set sort=basename; set sort_reverse=Falsemap on chain set sort=natural; set sort_reverse=Falsemap om chain set sort=mtime; set sort_reverse=Falsemap oc chain set sort=ctime; set sort_reverse=Falsemap oa chain set sort=atime; set sort_reverse=Falsemap ot chain set sort=type; set sort_reverse=Falsemap oe chain set sort=extension; set sort_reverse=False
map oS chain set sort=size; set sort_reverse=Truemap oB chain set sort=basename; set sort_reverse=Truemap oN chain set sort=natural; set sort_reverse=Truemap oM chain set sort=mtime; set sort_reverse=Truemap oC chain set sort=ctime; set sort_reverse=Truemap oA chain set sort=atime; set sort_reverse=Truemap oT chain set sort=type; set sort_reverse=Truemap oE chain set sort=extension; set sort_reverse=True
map dc get_cumulative_size
# Settingsmap zc set collapse_preview!map zd set sort_directories_first!map zh set show_hidden!map <C-h> set show_hidden!copymap <C-h> <backspace>copymap <backspace> <backspace2>map zI set flushinput!map zi set preview_images!map zm set mouse_enabled!map zp set preview_files!map zP set preview_directories!map zs set sort_case_insensitive!map zu set autoupdate_cumulative_size!map zv set use_preview_script!map zf console filter%spacecopymap zf zz
# Filter stackmap .n console filter_stack add name%spacemap .m console filter_stack add mime%spacemap .d filter_stack add type dmap .f filter_stack add type fmap .l filter_stack add type lmap .| filter_stack add ormap .& filter_stack add andmap .! filter_stack add notmap .r console filter_stack rotatemap .c filter_stack clearmap .* filter_stack decomposemap .p filter_stack popmap .. filter_stack show
# Bookmarksmap `<any> enter_bookmark %anymap '<any> enter_bookmark %anymap m<any> set_bookmark %anymap um<any> unset_bookmark %any
map m<bg> draw_bookmarkscopymap m<bg> um<bg> `<bg> '<bg>
# Generate all the chmod bindings with some python help:eval for arg in "rwxXst": cmd("map +u{0} shell -f chmod u+{0} %s".format(arg))eval for arg in "rwxXst": cmd("map +g{0} shell -f chmod g+{0} %s".format(arg))eval for arg in "rwxXst": cmd("map +o{0} shell -f chmod o+{0} %s".format(arg))eval for arg in "rwxXst": cmd("map +a{0} shell -f chmod a+{0} %s".format(arg))eval for arg in "rwxXst": cmd("map +{0} shell -f chmod u+{0} %s".format(arg))
eval for arg in "rwxXst": cmd("map -u{0} shell -f chmod u-{0} %s".format(arg))eval for arg in "rwxXst": cmd("map -g{0} shell -f chmod g-{0} %s".format(arg))eval for arg in "rwxXst": cmd("map -o{0} shell -f chmod o-{0} %s".format(arg))eval for arg in "rwxXst": cmd("map -a{0} shell -f chmod a-{0} %s".format(arg))eval for arg in "rwxXst": cmd("map -{0} shell -f chmod u-{0} %s".format(arg))
# ===================================================================# == Define keys for the console# ===================================================================# Note: Unmapped keys are passed directly to the console.
# Basiccmap <tab> eval fm.ui.console.tab()cmap <s-tab> eval fm.ui.console.tab(-1)cmap <ESC> eval fm.ui.console.close()cmap <CR> eval fm.ui.console.execute()cmap <C-l> redraw_window
copycmap <ESC> <C-c>copycmap <CR> <C-j>
# Move aroundcmap <up> eval fm.ui.console.history_move(-1)cmap <down> eval fm.ui.console.history_move(1)cmap <left> eval fm.ui.console.move(left=1)cmap <right> eval fm.ui.console.move(right=1)cmap <home> eval fm.ui.console.move(right=0, absolute=True)cmap <end> eval fm.ui.console.move(right=-1, absolute=True)cmap <a-b> eval fm.ui.console.move_word(left=1)cmap <a-f> eval fm.ui.console.move_word(right=1)
copycmap <a-b> <a-left>copycmap <a-f> <a-right>
# Line Editingcmap <backspace> eval fm.ui.console.delete(-1)cmap <delete> eval fm.ui.console.delete(0)cmap <C-w> eval fm.ui.console.delete_word()cmap <A-d> eval fm.ui.console.delete_word(backward=False)cmap <C-k> eval fm.ui.console.delete_rest(1)cmap <C-u> eval fm.ui.console.delete_rest(-1)cmap <C-y> eval fm.ui.console.paste()
# And of course the emacs waycopycmap <ESC> <C-g>copycmap <up> <C-p>copycmap <down> <C-n>copycmap <left> <C-b>copycmap <right> <C-f>copycmap <home> <C-a>copycmap <end> <C-e>copycmap <delete> <C-d>copycmap <backspace> <C-h>
# Note: There are multiple ways to express backspaces. <backspace> (code 263)# and <backspace2> (code 127). To be sure, use both.copycmap <backspace> <backspace2>
# This special expression allows typing in numerals:cmap <allow_quantifiers> false
# ===================================================================# == Pager Keybindings# ===================================================================
# Movementpmap <down> pager_move down=1pmap <up> pager_move up=1pmap <left> pager_move left=4pmap <right> pager_move right=4pmap <home> pager_move to=0pmap <end> pager_move to=-1pmap <pagedown> pager_move down=1.0 pages=Truepmap <pageup> pager_move up=1.0 pages=Truepmap <C-d> pager_move down=0.5 pages=Truepmap <C-u> pager_move up=0.5 pages=True
copypmap <UP> k <C-p>copypmap <DOWN> j <C-n> <CR>copypmap <LEFT> hcopypmap <RIGHT> lcopypmap <HOME> gcopypmap <END> Gcopypmap <C-d> dcopypmap <C-u> ucopypmap <PAGEDOWN> n f <C-F> <Space>copypmap <PAGEUP> p b <C-B>
# Basicpmap <C-l> redraw_windowpmap <ESC> pager_closecopypmap <ESC> q Q i <F3>pmap E edit_file
# ===================================================================# == Taskview Keybindings# ===================================================================
# Movementtmap <up> taskview_move up=1tmap <down> taskview_move down=1tmap <home> taskview_move to=0tmap <end> taskview_move to=-1tmap <pagedown> taskview_move down=1.0 pages=Truetmap <pageup> taskview_move up=1.0 pages=Truetmap <C-d> taskview_move down=0.5 pages=Truetmap <C-u> taskview_move up=0.5 pages=True
copytmap <UP> k <C-p>copytmap <DOWN> j <C-n> <CR>copytmap <HOME> gcopytmap <END> Gcopytmap <C-u> ucopytmap <PAGEDOWN> n f <C-F> <Space>copytmap <PAGEUP> p b <C-B>
# Changing priority and deleting taskstmap J eval -q fm.ui.taskview.task_move(-1)tmap K eval -q fm.ui.taskview.task_move(0)tmap dd eval -q fm.ui.taskview.task_remove()tmap <pagedown> eval -q fm.ui.taskview.task_move(-1)tmap <pageup> eval -q fm.ui.taskview.task_move(0)tmap <delete> eval -q fm.ui.taskview.task_remove()
# Basictmap <C-l> redraw_windowtmap <ESC> taskview_closecopytmap <ESC> q Q w <C-c>
|