rc.conf 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459
  1. set column_ratios 1,3
  2. set hidden_filter ^\.|\.(?:pyc|pyo|bak|swp)$|^lost\+found$|^__(py)?cache__$
  3. set show_hidden false
  4. set confirm_on_delete multiple
  5. set preview_script ~/.config/ranger/scope.sh
  6. set use_preview_script true
  7. set automatically_count_files true
  8. set open_all_images true
  9. set vcs_aware false
  10. set vcs_backend_git enabled
  11. set vcs_backend_hg disabled
  12. set vcs_backend_bzr disabled
  13. set preview_images true
  14. set preview_images_method w3m
  15. set unicode_ellipsis false
  16. set show_hidden_bookmarks true
  17. set colorscheme default
  18. set preview_files true
  19. set preview_directories true
  20. set collapse_preview true
  21. set save_console_history true
  22. set status_bar_on_top false
  23. set draw_progress_bar_in_status_bar true
  24. set draw_borders true
  25. set dirname_in_tabs false
  26. set mouse_enabled true
  27. set display_size_in_main_column true
  28. set display_size_in_status_bar true
  29. set display_tags_in_all_columns true
  30. set update_title false
  31. set update_tmux_title false
  32. set shorten_title 3
  33. set tilde_in_titlebar false
  34. set max_history_size 20
  35. set max_console_history_size 50
  36. set scroll_offset 8
  37. set flushinput true
  38. set padding_right true
  39. set autosave_bookmarks true
  40. set autoupdate_cumulative_size false
  41. set show_cursor false
  42. set sort natural
  43. set sort_reverse false
  44. set sort_case_insensitive true
  45. set sort_directories_first true
  46. set sort_unicode false
  47. set xterm_alt_key false
  48. set cd_bookmarks true
  49. set preview_max_size 0
  50. set show_selection_in_titlebar true
  51. set idle_delay 2000
  52. set metadata_deep_search false
  53. # ===================================================================
  54. # == Local Options
  55. # ===================================================================
  56. # You can set local options that only affect a single directory.
  57. # Examples:
  58. # setlocal path=~/downloads sort mtime
  59. # ===================================================================
  60. # == Command Aliases in the Console
  61. # ===================================================================
  62. alias e edit
  63. alias q quit
  64. alias q! quitall
  65. alias qa quitall
  66. alias qall quitall
  67. alias setl setlocal
  68. alias filter scout -prt
  69. alias find scout -aeit
  70. alias mark scout -mr
  71. alias unmark scout -Mr
  72. alias search scout -rs
  73. alias search_inc scout -rts
  74. alias travel scout -aefiklst
  75. # ===================================================================
  76. # == Define keys for the browser
  77. # ===================================================================
  78. alias q quit
  79. alias q! quitall
  80. alias qa quitall
  81. alias qall quitall
  82. alias setl setlocal
  83. alias filter scout -prt
  84. alias find scout -aeit
  85. alias mark scout -mr
  86. alias unmark scout -Mr
  87. alias search scout -rs
  88. alias search_inc scout -rts
  89. alias travel scout -aefiklst
  90. # ===================================================================
  91. # == Define keys for the browser
  92. # ===================================================================
  93. # Basic
  94. map Q quit!
  95. map q quit
  96. copymap q ZZ ZQ
  97. map R reload_cwd
  98. map <C-r> reset
  99. map <C-l> redraw_window
  100. map <C-c> abort
  101. map <esc> change_mode normal
  102. map i display_file
  103. map ? help
  104. map W display_log
  105. map w taskview_open
  106. map S shell $SHELL
  107. map : console
  108. map ; console
  109. map ! console shell%space
  110. map @ console -p6 shell %%s
  111. map # console shell -p%space
  112. map s console shell%space
  113. map a chain draw_possible_programs; console open_with%space
  114. map f console find%space
  115. map cd console cd%space
  116. map mm console mkdir%space
  117. map mn console touch%space
  118. # Change the line mode
  119. map Mf linemode filename
  120. map Mi linemode fileinfo
  121. map Mp linemode permissions
  122. map Mt linemode metatitle
  123. # Tagging / Marking
  124. map t tag_toggle
  125. map ut tag_remove
  126. map "<any> tag_toggle tag=%any
  127. map <Space> mark_files toggle=True
  128. map p mark_files all=True toggle=True
  129. map up mark_files all=True val=False
  130. map P toggle_visual_mode
  131. map uP toggle_visual_mode reverse=True
  132. # For the nostalgics: Midnight Commander bindings
  133. map <F1> help
  134. map <F3> display_file
  135. map <F4> edit
  136. map <F5> copy
  137. map <F6> cut
  138. map <F7> console mkdir%space
  139. map <F8> console delete
  140. map <F10> exit
  141. map e display_file
  142. # In case you work on a keyboard with dvorak layout
  143. map <UP> move up=1
  144. map <DOWN> move down=1
  145. map <LEFT> move left=1
  146. map <RIGHT> move right=1
  147. map <HOME> move to=0
  148. map <END> move to=-1
  149. map <PAGEDOWN> move down=1 pages=True
  150. map <PAGEUP> move up=1 pages=True
  151. map <CR> move right=1
  152. #map <DELETE> console delete
  153. map <INSERT> console touch%space
  154. # VIM-like
  155. copymap <UP> k
  156. copymap <DOWN> j
  157. copymap <LEFT> h
  158. copymap <RIGHT> l
  159. copymap <HOME> gg
  160. copymap <END> G
  161. copymap <PAGEDOWN> <C-F>
  162. copymap <PAGEUP> <C-B>
  163. map J move down=0.5 pages=True
  164. map K move up=0.5 pages=True
  165. copymap J <C-D>
  166. copymap K <C-U>
  167. # Jumping around
  168. map H history_go -1
  169. map L history_go 1
  170. map ] move_parent 1
  171. map [ move_parent -1
  172. map } traverse
  173. map gh cd ~
  174. map ge cd /etc
  175. map gu cd /usr
  176. map gd cd /dev
  177. map gl cd -r .
  178. map gL cd -r %f
  179. map go cd /opt
  180. map gv cd /var
  181. map gm cd /media
  182. map gM cd /mnt
  183. map gs cd /srv
  184. map gr cd /
  185. map gR eval fm.cd(ranger.RANGERDIR)
  186. map g/ cd /
  187. map g? cd /usr/share/doc/ranger
  188. # External Programs
  189. map E edit
  190. map du shell -p du --max-depth=1 -h --apparent-size
  191. map dU shell -p du --max-depth=1 -h --apparent-size | sort -rh
  192. map cp shell -f echo -n %d/%f | xsel -i; xsel -o | xsel -i -b
  193. map cd shell -f echo -n %d | xsel -i; xsel -o | xsel -i -b
  194. map cn shell -f echo -n %f | xsel -i; xsel -o | xsel -i -b
  195. # Filesystem Operations
  196. map = chmod
  197. map rw console rename%space
  198. map r rename_append
  199. map R eval fm.open_console('rename ' + fm.thisfile.basename)
  200. map I eval fm.open_console('rename ' + fm.thisfile.basename, position=7)
  201. map vv paste
  202. map vo paste overwrite=True
  203. map vl paste_symlink relative=False
  204. map vL paste_symlink relative=True
  205. map vhl paste_hardlink
  206. map vht paste_hardlinked_subtree
  207. map dd console delete
  208. map ff cut
  209. map uf uncut
  210. map fa cut mode=add
  211. map fr cut mode=remove
  212. map cc copy
  213. map ca copy mode=add
  214. map cr copy mode=remove
  215. # Temporary workarounds
  216. map fgg eval fm.cut(dirarg=dict(to=0), narg=quantifier)
  217. map fG eval fm.cut(dirarg=dict(to=-1), narg=quantifier)
  218. map fj eval fm.cut(dirarg=dict(down=1), narg=quantifier)
  219. map fk eval fm.cut(dirarg=dict(up=1), narg=quantifier)
  220. map cgg eval fm.copy(dirarg=dict(to=0), narg=quantifier)
  221. map cG eval fm.copy(dirarg=dict(to=-1), narg=quantifier)
  222. map cj eval fm.copy(dirarg=dict(down=1), narg=quantifier)
  223. map ck eval fm.copy(dirarg=dict(up=1), narg=quantifier)
  224. # Searching
  225. map / console search%space
  226. map n search_next
  227. map N search_next forward=False
  228. map ct search_next order=tag
  229. map cs search_next order=size
  230. map ci search_next order=mimetype
  231. map cii search_next order=ctime
  232. map cm search_next order=mtime
  233. map ca search_next order=atime
  234. # Tabs
  235. map <C-n> tab_new ~
  236. map <C-w> tab_close
  237. map <TAB> tab_move 1
  238. map <S-TAB> tab_move -1
  239. map <A-Right> tab_move 1
  240. map <A-Left> tab_move -1
  241. map gt tab_move 1
  242. map gT tab_move -1
  243. map gn tab_new ~
  244. map gc tab_close
  245. map uq tab_restore
  246. map <a-1> tab_open 1
  247. map <a-2> tab_open 2
  248. map <a-3> tab_open 3
  249. map <a-4> tab_open 4
  250. map <a-5> tab_open 5
  251. map <a-6> tab_open 6
  252. map <a-7> tab_open 7
  253. map <a-8> tab_open 8
  254. map <a-9> tab_open 9
  255. # Sorting
  256. map or toggle_option sort_reverse
  257. map oz set sort=random
  258. map os chain set sort=size; set sort_reverse=False
  259. map ob chain set sort=basename; set sort_reverse=False
  260. map on chain set sort=natural; set sort_reverse=False
  261. map om chain set sort=mtime; set sort_reverse=False
  262. map oc chain set sort=ctime; set sort_reverse=False
  263. map oa chain set sort=atime; set sort_reverse=False
  264. map ot chain set sort=type; set sort_reverse=False
  265. map oe chain set sort=extension; set sort_reverse=False
  266. map oS chain set sort=size; set sort_reverse=True
  267. map oB chain set sort=basename; set sort_reverse=True
  268. map oN chain set sort=natural; set sort_reverse=True
  269. map oM chain set sort=mtime; set sort_reverse=True
  270. map oC chain set sort=ctime; set sort_reverse=True
  271. map oA chain set sort=atime; set sort_reverse=True
  272. map oT chain set sort=type; set sort_reverse=True
  273. map oE chain set sort=extension; set sort_reverse=True
  274. map dc get_cumulative_size
  275. # Settings
  276. map zc toggle_option collapse_preview
  277. map zd toggle_option sort_directories_first
  278. map zh toggle_option show_hidden
  279. map <C-h> toggle_option show_hidden
  280. map zi toggle_option flushinput
  281. map zm toggle_option mouse_enabled
  282. map zp toggle_option preview_files
  283. map zP toggle_option preview_directories
  284. map zs toggle_option sort_case_insensitive
  285. map zu toggle_option autoupdate_cumulative_size
  286. map zv toggle_option use_preview_script
  287. map zf console filter%space
  288. # Bookmarks
  289. map `<any> enter_bookmark %any
  290. map '<any> enter_bookmark %any
  291. map m<any> set_bookmark %any
  292. map um<any> unset_bookmark %any
  293. map m<bg> draw_bookmarks
  294. copymap m<bg> um<bg> `<bg> '<bg>
  295. # Generate all the chmod bindings with some python help:
  296. eval for arg in "rwxXst": cmd("map +u{0} shell -f chmod u+{0} %s".format(arg))
  297. eval for arg in "rwxXst": cmd("map +g{0} shell -f chmod g+{0} %s".format(arg))
  298. eval for arg in "rwxXst": cmd("map +o{0} shell -f chmod o+{0} %s".format(arg))
  299. eval for arg in "rwxXst": cmd("map +a{0} shell -f chmod a+{0} %s".format(arg))
  300. eval for arg in "rwxXst": cmd("map +{0} shell -f chmod u+{0} %s".format(arg))
  301. eval for arg in "rwxXst": cmd("map -u{0} shell -f chmod u-{0} %s".format(arg))
  302. eval for arg in "rwxXst": cmd("map -g{0} shell -f chmod g-{0} %s".format(arg))
  303. eval for arg in "rwxXst": cmd("map -o{0} shell -f chmod o-{0} %s".format(arg))
  304. eval for arg in "rwxXst": cmd("map -a{0} shell -f chmod a-{0} %s".format(arg))
  305. eval for arg in "rwxXst": cmd("map -{0} shell -f chmod u-{0} %s".format(arg))
  306. # ===================================================================
  307. # == Define keys for the console
  308. # ===================================================================
  309. # Note: Unmapped keys are passed directly to the console.
  310. # Basic
  311. cmap <tab> eval fm.ui.console.tab()
  312. cmap <s-tab> eval fm.ui.console.tab(-1)
  313. cmap <ESC> eval fm.ui.console.close()
  314. cmap <CR> eval fm.ui.console.execute()
  315. cmap <C-l> redraw_window
  316. copycmap <ESC> <C-c>
  317. copycmap <CR> <C-j>
  318. # Move around
  319. cmap <up> eval fm.ui.console.history_move(-1)
  320. cmap <down> eval fm.ui.console.history_move(1)
  321. cmap <left> eval fm.ui.console.move(left=1)
  322. cmap <right> eval fm.ui.console.move(right=1)
  323. cmap <home> eval fm.ui.console.move(right=0, absolute=True)
  324. cmap <end> eval fm.ui.console.move(right=-1, absolute=True)
  325. # Line Editing
  326. cmap <backspace> eval fm.ui.console.delete(-1)
  327. cmap <delete> eval fm.ui.console.delete(0)
  328. cmap <C-w> eval fm.ui.console.delete_word()
  329. cmap <C-k> eval fm.ui.console.delete_rest(1)
  330. cmap <C-u> eval fm.ui.console.delete_rest(-1)
  331. cmap <C-y> eval fm.ui.console.paste()
  332. # And of course the emacs way
  333. copycmap <up> <C-p>
  334. copycmap <down> <C-n>
  335. copycmap <left> <C-b>
  336. copycmap <right> <C-f>
  337. copycmap <home> <C-a>
  338. copycmap <end> <C-e>
  339. copycmap <delete> <C-d>
  340. copycmap <backspace> <C-h>
  341. # Note: There are multiple ways to express backspaces. <backspace> (code 263)
  342. # and <backspace2> (code 127). To be sure, use both.
  343. copycmap <backspace> <backspace2>
  344. # This special expression allows typing in numerals:
  345. cmap <allow_quantifiers> false
  346. # ===================================================================
  347. # == Pager Keybindings
  348. # ===================================================================
  349. # Movement
  350. pmap <down> pager_move down=1
  351. pmap <up> pager_move up=1
  352. pmap <left> pager_move left=4
  353. pmap <right> pager_move right=4
  354. pmap <home> pager_move to=0
  355. pmap <end> pager_move to=-1
  356. pmap <pagedown> pager_move down=1.0 pages=True
  357. pmap <pageup> pager_move up=1.0 pages=True
  358. pmap <C-d> pager_move down=0.5 pages=True
  359. pmap <C-u> pager_move up=0.5 pages=True
  360. copypmap <UP> k <C-p>
  361. copypmap <DOWN> j <C-n> <CR>
  362. copypmap <LEFT> h
  363. copypmap <RIGHT> l
  364. copypmap <HOME> g
  365. copypmap <END> G
  366. copypmap <C-d> d
  367. copypmap <C-u> u
  368. copypmap <PAGEDOWN> n f <C-F> <Space>
  369. copypmap <PAGEUP> p b <C-B>
  370. # Basic
  371. pmap <C-l> redraw_window
  372. pmap <ESC> pager_close
  373. copypmap <ESC> q Q i e <F3>
  374. pmap E edit_file
  375. # ===================================================================
  376. # == Taskview Keybindings
  377. # ===================================================================
  378. # Movement
  379. tmap <up> taskview_move up=1
  380. tmap <down> taskview_move down=1
  381. tmap <home> taskview_move to=0
  382. tmap <end> taskview_move to=-1
  383. tmap <pagedown> taskview_move down=1.0 pages=True
  384. tmap <pageup> taskview_move up=1.0 pages=True
  385. tmap <C-d> taskview_move down=0.5 pages=True
  386. tmap <C-u> taskview_move up=0.5 pages=True
  387. copytmap <UP> k <C-p>
  388. copytmap <DOWN> j <C-n> <CR>
  389. copytmap <HOME> g
  390. copytmap <END> G
  391. copytmap <C-u> u
  392. copytmap <PAGEDOWN> n f <C-F> <Space>
  393. copytmap <PAGEUP> p b <C-B>
  394. # Changing priority and deleting tasks
  395. tmap J eval -q fm.ui.taskview.task_move(-1)
  396. tmap K eval -q fm.ui.taskview.task_move(0)
  397. tmap dd eval -q fm.ui.taskview.task_remove()
  398. tmap <pagedown> eval -q fm.ui.taskview.task_move(-1)
  399. tmap <pageup> eval -q fm.ui.taskview.task_move(0)
  400. tmap <delete> eval -q fm.ui.taskview.task_remove()
  401. # Basic
  402. tmap <C-l> redraw_window
  403. tmap <ESC> taskview_close
  404. copytmap <ESC> q Q w <C-c>
  405. default_linemode devicons