THEAARBS ranger rc

Raw

#  _ __ __ _ _ __   __ _  ___ _ __
# | '__/ _` | '_ \ / _` |/ _ \ '__|
# | | | (_| | | | | (_| |  __/ |
# |_|  \__,_|_| |_|\__, |\___|_|
#                  |___/
#
# ~/.config/ranger/rc.conf

set column_ratios 1,3,4
set hidden_filter ^\.|\.(?:pyc|vrb|pyo|lof|bak|swp|aux|nav|out|snm|toc|bcf|run\.xml|synctex\.gz|blg|bbl)$|^lost\+found$|^__(py)?cache__$
set show_hidden false
set confirm_on_delete multiple
set preview_script ~/.config/ranger/scope.sh
set use_preview_script true
set automatically_count_files true
set open_all_images true
set vcs_aware false
set vcs_backend_git enabled
set vcs_backend_hg disabled
set vcs_backend_bzr disabled
set preview_images true
set preview_images_method w3m
set unicode_ellipsis false
set show_hidden_bookmarks false
set colorscheme default
set preview_files true
set preview_directories true
set collapse_preview true
set save_console_history false
set status_bar_on_top false
set draw_progress_bar_in_status_bar true
set draw_borders true
set dirname_in_tabs true
set mouse_enabled false
set display_size_in_main_column true
set display_size_in_status_bar true
set display_tags_in_all_columns true
set update_title false
set update_tmux_title true
set shorten_title 3
set tilde_in_titlebar true
set max_history_size 20
set max_console_history_size 50
set scroll_offset 8
set flushinput true
set padding_right true
set autosave_bookmarks false
set autoupdate_cumulative_size false
set show_cursor false
set sort natural
set sort_reverse false
set sort_case_insensitive true
set sort_directories_first true
set sort_unicode false
set xterm_alt_key false
set cd_bookmarks false
set preview_max_size 0
set show_selection_in_titlebar true
set idle_delay 2000
set metadata_deep_search false

alias e edit
alias q	quit
alias q! quitall
alias qa quitall
alias qall quitall
alias setl setlocal
alias filter scout -prt
alias find scout -aeit
alias mark scout -mr
alias unmark scout -Mr
alias search scout -rs
alias search_inc scout -rts
alias travel scout -aefiklst

# ALPHABET KEYS
map q		quit
map Q		quit!
map w		taskview_open
map W		display_log
map E		edit
map r		chain draw_possible_programs; console open_with%%space
map R		console shell ./%s
map tf		shell tail -f %s
map tr		tab_new /
map th		tab_new ~
map td		tab_new ~/Documents
map tn		tab_new ~/Documents/networks
map tD		tab_new ~/Downloads
map tm		tab_new ~/Music
map tp		tab_new ~/Pictures
map tP		tab_new ~/Projects
map tv		tab_new ~/Videos
map tw		tab_new ~/Hugo
map tcf		tab_new ~/.config
map ts		tab_new ~/.local/bin
map tt		tab_new %s
map TH		shell setsid sxiv -t %s/* &disown
map yy		copy
map ya		copy mode=add
map yr		copy mode=remove
map yt		copy mode=toggle
map Yh		shell cp -r %s ~		; notify-send "🏠 Copied %s to ~/."
map Yd		shell cp -rv %s ~/Documents	; notify-send "📂 Copied %s to ~/Documents."
map YD		shell cp -rv %s ~/Downloads	; notify-send "⬇ Copied %s to ~/Downloads."
map Ym		shell cp -rv %s ~/Music		; notify-send "🎼 Copied %s to ~/Music."
map Yp		shell cp -rv %s ~/Pictures	; notify-send "🖼 Copied %s to ~/Pictures."
map Yv		shell cp -rv %s ~/Videos	; notify-send "🎬 Copied %s to ~/Videos."
map Yw		shell cp -rv %s ~/Hugo		; notify-send "🗞 Copied %s to ~/Hugo."
map Ycf		shell cp -rv %s ~/.config	; notify-send "Copied %s to ~/.config."
map Ys		shell cp -rv %s ~/.local/bin	; notify-send "📜 Copied %s to ~/.local/bin."
map ud		uncut
map uy		uncut
map uq		tab_restore
map i		display_file
map I		eval fm.open_console('rename ' + fm.thisfile.relative_path, position=7)
map or		toggle_option sort_reverse
map oz		set sort=random
map os		chain set sort=size	; set sort_reverse=False
map oS		chain set sort=size	; set sort_reverse=True
map ob		chain set sort=basename	; set sort_reverse=False
map oB		chain set sort=basename	; set sort_reverse=True
map on		chain set sort=natural	; set sort_reverse=False
map oN		chain set sort=natural	; set sort_reverse=True
map om		chain set sort=mtime	; set sort_reverse=False
map oM		chain set sort=mtime	; set sort_reverse=True
map oc		chain set sort=ctime	; set sort_reverse=False
map oC		chain set sort=ctime	; set sort_reverse=True
map oa		chain set sort=atime	; set sort_reverse=False
map oA		chain set sort=atime	; set sort_reverse=True
map ot		chain set sort=type	; set sort_reverse=False
map oT		chain set sort=type	; set sort_reverse=True
map oe		chain set sort=extension	; set sort_reverse=False
map oE		chain set sort=extension	; set sort_reverse=True
map O		shell handle %s
map pp		paste
map po		paste overwrite=True
map pP		paste append=True
map pO		paste overwrite=True append=True
map pl		paste_symlink relative=False
map pL		paste_symlink relative=True
map phl		paste_hardlink
map pht		paste_hardlinked_subtree
map P		cd ~/Projects
map pqr		shell qr %f
map p1s		shell lpr -o sides=one-sided %f && notify-send "🖨️ Printing %f"
map p1l		shell lpr -o orientation-requested=4 %f && notify-send "🖨️ Printing %f"
map p2s		shell lpr -o sides=two-sided-long-edge %f && notify-send "🖨️ Printing %f"
map aa		rename_append
map ac		shell addtocalcurse %s
map A		eval fm.open_console('rename ' + fm.thisfile.relative_path)
map sc		console shell ln -sT%space
map sl		shell sent %f &disown
map S		shell $SHELL
map du		shell -p du --max-depth=1 -h --apparent-size | sort -rh
map dc		get_cumulative_size
map dD		shell mv %s /home/${USER}/.local/share/Trash/files/ ; notify-send "🗑️ $(basename %s) is now trash."
map dd		cut
map da		cut mode=add
map dr		cut mode=remove
map dt		cut mode=toggle
map D		console delete
map f		fzf_select
map gr		cd /
map gh		cd ~
map gd		cd ~/Documents
map gn		cd ~/Documents/networks
map gD		cd ~/Downloads
map gm		cd ~/Music
map gp		cd ~/Pictures
map gP		cd ~/Projects
map gv		cd ~/Videos
map gw		cd ~/Hugo
map gcf		cd ~/.config
map gs		cd ~/.local/bin
map gL		cd -r %f
map ge		cd /etc
map gu		cd /usr
map g?		cd /usr/share/doc/ranger
map H		history_go -1
map J		move down=0.5  pages=True
map K		move up=0.5    pages=True
map L		history_go 1
map zc		toggle_option collapse_preview
map zd		toggle_option sort_directories_first
map zh		toggle_option show_hidden
map zi		toggle_option flushinput
map zm		toggle_option mouse_enabled
map zp		toggle_option preview_files
map zP		toggle_option preview_directories
map zs		toggle_option sort_case_insensitive
map zu		toggle_option autoupdate_cumulative_size
map zv		toggle_option use_preview_script
map zf		console filter%space
map Z		shell tar -cvzf %f.tar.gz %f && notify-send "📦 %f zipped"
map x		shell chmod -x %s
map X		shell extract %f
map cd		console cd%space
map cW		shell vidir %s
map cw		console rename%space
map cr		shell gpg -c %f && rm -rf %f && notify-send "🔒 %f encrypted."
map cf		shell tar -cvzf %f.tar.gz %f && gpg -c %f.tar.gz && rm -rf %f && rm -rf %f.tar.gz && notify-send "🔒 %f encrypted."
map cz		shell gpg %f && notify-send "🔓 %f decrypted."
map ct		search_next order=tag
map cs		search_next order=size
map ci		search_next order=mimetype
map cc		search_next order=ctime
map cm		search_next order=mtime
map ca		search_next order=atime
map va		mark_files all=True toggle=True
map V		console shell vim%space
map n		search_next
map N		search_next forward=False
map mkd		console mkdir%space
map mh		shell mv %s ~			; notify-send "🏠 Moved %s to ~/."
map md		shell mv -v %s ~/Documents	; notify-send "📂 Moved %s to ~/Documents."
map mD		shell mv -v %s ~/Downloads	; notify-send "⬇ Moved %s to ~/Downloads."
map mm		shell mv -v %s ~/Music		; notify-send "🎼 Moved %s to ~/Music."
map mp		shell mv -v %s ~/Pictures	; notify-send "🖼 Moved %s to ~/Pictures."
map mv		shell mv -v %s ~/Videos		; notify-send "🎬 Moved %s to ~/Videos."
map mw		shell mv -v %s ~/Hugo		; notify-send "🗞 Moved %s to ~/Hugo."
map mcf		shell mv -v %s ~/.config	; notify-send "Moved %s to ~/.config."
map ms		shell mv -v %s ~/.local/bin	; notify-send "📜 Moved %s to ~/.local/bin."
map M3		shell ffmpeg -i %f -vn -ar 44100 -ac 2 -ab 192k -f mp3 %f.mp3
map MP		shell name=$(echo %f | cut -f 1 -d '.') && pandoc %f -o $name.pdf && notify-send "🗞️ %f converted to $name.pdf"
map MD		shell name=$(echo %f | cut -f 1 -d '.') && pandoc %f -o $name.docx && notify-send "🗞️ %f converted to $name.docx"
map MH		shell name=$(echo %f | cut -f 1 -d '.') && pandoc %f -o $name.html && notify-send "🗞️ %f converted to $name.html"
map MM		shell name=$(echo %f | cut -f 1 -d '.') && pandoc %f -o $name.md && notify-send "🗞️ %f converted to $name.md"
map MZ  	shell name=$(echo %f | cut -f 1 -d '.') && ext=$(inprompt "File extension:") && pandoc %f -o $name.$ext && notify-send "🗞️ %f converted to $name.$ext"

map ?		help
map :		console
map ;		console
map /		console search%space
map !		console shell%space
map @		console -p6 shell  %s
map #		console shell -p%space
map *		tag_toggle
map =		chmod
map &		shell chmod 777 %s
map ^		shell chmod 765 %s
map ]		move_parent 1
map [		move_parent -1
map }		traverse
map <esc>	change_mode normal
map <Space>	mark_files toggle=True

map <C-n>	console touch%space
map <C-r>	reset
map <C-c>	abort
map <C-w>	tab_close
map <TAB>	tab_move 1
map <S-TAB>	tab_move -1
map <A-Right>	tab_move 1
map <A-Left>	tab_move -1
map <a-1>	tab_open 1
map <a-2>	tab_open 2
map <a-3>	tab_open 3
map <a-4>	tab_open 4
map <a-5>	tab_open 5
map <a-6>	tab_open 6
map <a-7>	tab_open 7
map <a-8>	tab_open 8
map <a-9>	tab_open 9

# CHMOD KEYS
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))

# ALTERNATE (COPY OF) BINDINGS
copymap <F1> ?
copymap <C-h> zh
copymap <UP> k
copymap <DOWN> j
copymap <LEFT> h
copymap <RIGHT> l
copymap <HOME> gg
copymap <END> G
copymap <PAGEDOWN> <C-F>
copymap <PAGEUP> <C-B>
copymap J <C-D>
copymap K <C-U>

# CONSOLE KEYS
cmap <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 <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 <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()
# This special expression allows typing in numerals:
cmap <allow_quantifiers> false
# Note: There are multiple ways to express backspaces.  <backspace> (code 263)
# and <backspace2> (code 127).  To be sure, use both.
copycmap <backspace> <backspace2>
copycmap <ESC> <C-c>
copycmap <CR> <C-j>

# PAGER KEYS
pmap <ESC>	pager_close
pmap <down>	pager_move down=1
pmap <up>	pager_move up=1
pmap <left>	pager_move left=4
pmap <right>	pager_move right=4
pmap <home>	pager_move to=0
pmap <end>	pager_move to=-1
pmap <pagedown>	pager_move down=1.0 pages=True
pmap <pageup>	pager_move up=1.0 pages=True
pmap <C-d>	pager_move down=0.5 pages=True
pmap <C-u>	pager_move up=0.5 pages=True
pmap E		edit_file
copypmap <ESC> q Q i <F3>
copypmap <UP> k <C-p>
copypmap <DOWN> j <C-n> <CR>
copypmap <LEFT> h
copypmap <RIGHT> l
copypmap <HOME> g
copypmap <END> G
copypmap <C-d> d
copypmap <C-u> u
copypmap <PAGEDOWN> n f <C-F> <Space>
copypmap <PAGEUP> p b <C-B>

# TASK VIEW KEYS
tmap <up>	taskview_move up=1
tmap <down>	taskview_move down=1
tmap <home>	taskview_move to=0
tmap <end>	taskview_move to=-1
tmap <pagedown>	taskview_move down=1.0  pages=True
tmap <pageup>	taskview_move up=1.0    pages=True
tmap <C-d>	taskview_move down=0.5  pages=True
tmap <C-u>	taskview_move up=0.5    pages=True
tmap <ESC>	taskview_close
tmap 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()
copytmap <UP> k <C-p>
copytmap <DOWN> j <C-n> <CR>
copytmap <HOME> g
copytmap <END> G
copytmap <C-u> u
copytmap <PAGEDOWN> n f <C-F> <Space>
copytmap <PAGEUP> p b <C-B>
copytmap <ESC> q Q w <C-c>

# a plugin that adds file glyphs / icon support to Ranger:
# https://github.com/alexanderjeurissen/ranger_devicons
default_linemode devicons