# =================================================================== # This file contains the default startup commands for ranger. # To change them, it is recommended to create the file # ~/.config/ranger/rc.conf 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 files should be hidden? (regular expression) set hidden_filter ^\. # 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. set preview_images true # Display the directory name in tabs? set dirname_in_tabs true # Enable the mouse support? set mouse_enabled false # How many directory-changes or console-commands should be kept in history? set max_history_size 20 set 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? (Noticable 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 false # One of: size, basename, mtime, type set sort natural # Additional sorting options set sort_reverse false set sort_case_insensitive true set sort_directories_first true set 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 ## VCS support. This is quite slow. set vcs_aware false set vcs_backend_git enabled set vcs_backend_bzr disabled set vcs_backend_hg disabled # =================================================================== # == 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 edit alias q quit alias q! quitall alias qa quitall alias qall quitall alias setl setlocal # =================================================================== # == Define keys for the browser # =================================================================== # Basic map ! console shell -w # For the nostalgics: Midnight Commander bindings map bulkrename map shell -w file %s map console touch map console mkcd # =================================================================== # == Overrides # =================================================================== map A rename_append # =================================================================== # == Personal shorcuts # =================================================================== ## Prevent accidental exit when using programs that also uses this key to quit. unmap q map Q quit ## Move to trash (without Trash-CLI) # map DD shell mv -t ~/.local/share/Trash/files %s ## Move to trash (with Trash-CLI) map DD shell trash-put -- %s ## Extraction using atools. map ex shell -w aunpack -e %s map eXg shell -w aunpack -e %s -X "$HOME/games/" map eXh extracthere ## Git map ega shell -w git add %f %s map egc shell git commit map egC shell git commit -a map egD shell git diff map egd shell git diff --cached %s map egl shell git log --stat %s map egp shell -w git pull map egP shell -w git push map egr shell -w git checkout -- %f %s map egs shell -w git status -uno %s ## Pictures map ep shell -w mogrify -resize 50% %s ## Video ## Note that latin1 for mplayer/mpv is actually cp1252. map ev console shell mpv "%f" --sub-file "%s" map eV console shell mpv "%f" --sub-file "%s" --subcp latin1 ## Subs map es shell -w subdl %f ## Audio map ea shell cmus-remote -P %s ## Mount ISO map em shell imagemount %s map eu shell imagemount -u %s ## Quick moves map K move up=5 map J move down=5 ## New tab in current folder. Use 'gn' for home folder. map eval fm.tab_new('%d') ## Start shell in current folder. Needs zshcd script. This is useful if you have ## multiple tabs and you do not want to lose them just to run a shell. map S shell zshcd %d ## Image preview toggle map zi set preview_images=True map zI set preview_images=False ## toggle_flat map zF toggle_flat