You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

rc.conf 18KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614
  1. set viewmode miller
  2. # How many columns are there, and what are their relative widths?
  3. set column_ratios 1,4,4
  4. # Which files should be hidden? (regular expression)
  5. set hidden_filter ^\.|\.(?:pyc|pyo|bak|swp)$|^lost\+found$|^__(py)?cache__$|^nimcache$
  6. set show_hidden false
  7. set confirm_on_delete multiple
  8. set preview_script ~/.local/etc/ranger/scope.sh
  9. set use_preview_script true
  10. set automatically_count_files true
  11. set open_all_images false
  12. # Be aware of version control systems and display information.
  13. set vcs_aware false
  14. # State of the four backends git, hg, bzr, svn. The possible states are
  15. # disabled, local (only show local info), enabled (show local and remote
  16. # information).
  17. set vcs_backend_git enabled
  18. set vcs_backend_hg disabled
  19. set vcs_backend_bzr disabled
  20. set vcs_backend_svn disabled
  21. set preview_images true
  22. set preview_images_method kitty
  23. set unicode_ellipsis true
  24. # BIDI support - try to properly display file names in RTL languages (Hebrew, Arabic).
  25. # Requires the python-bidi pip package
  26. set bidi_support false
  27. # Show dotfiles in the bookmark preview box?
  28. set show_hidden_bookmarks true
  29. # Which colorscheme to use? These colorschemes are available by default:
  30. # default, jungle, snow, solarized
  31. set colorscheme default
  32. # Preview files on the rightmost column?
  33. # And collapse (shrink) the last column if there is nothing to preview?
  34. set preview_files true
  35. set preview_directories true
  36. set collapse_preview true
  37. set save_console_history true
  38. set status_bar_on_top false
  39. set draw_progress_bar_in_status_bar true
  40. set draw_borders false
  41. set dirname_in_tabs true
  42. set mouse_enabled true
  43. set display_size_in_main_column true
  44. set display_size_in_status_bar true
  45. set display_free_space_in_status_bar true
  46. # Display files tags in all columns or only in main column?
  47. set display_tags_in_all_columns true
  48. set update_title true
  49. set update_tmux_title true
  50. # Shorten the title if it gets long? The number defines how many
  51. # directories are displayed at once, 0 turns off this feature.
  52. set shorten_title 3
  53. set hostname_in_titlebar false
  54. set tilde_in_titlebar true
  55. # How many directory-changes or console-commands should be kept in history?
  56. set max_history_size 20
  57. set max_console_history_size 50
  58. set scroll_offset 8
  59. # Flush the input after each key hit? (Noticeable when ranger lags)
  60. set flushinput true
  61. # Padding on the right when there's no preview?
  62. # This allows you to click into the space to run the file.
  63. set padding_right true
  64. # Save bookmarks (used with mX and `X) instantly?
  65. # This helps to synchronize bookmarks between multiple ranger
  66. # instances but leads to *slight* performance loss.
  67. # When false, bookmarks are saved when ranger is exited.
  68. set autosave_bookmarks true
  69. # Save the "`" bookmark to disk. This can be used to switch to the last
  70. # directory by typing "``".
  71. set save_backtick_bookmark true
  72. # You can display the "real" cumulative size of directories by using the
  73. # command :get_cumulative_size or typing "dc". The size is expensive to
  74. # calculate and will not be updated automatically. You can choose
  75. # to update it automatically though by turning on this option:
  76. set autoupdate_cumulative_size false
  77. # Turning this on makes sense for screen readers:
  78. set show_cursor false
  79. # One of: size, natural, basename, atime, ctime, mtime, type, random
  80. set sort natural
  81. # Additional sorting options
  82. set sort_reverse false
  83. set sort_case_insensitive true
  84. set sort_directories_first true
  85. set sort_unicode false
  86. # Enable this if key combinations with the Alt Key don't work for you.
  87. # (Especially on xterm)
  88. set xterm_alt_key false
  89. # Whether to include bookmarks in cd command
  90. set cd_bookmarks true
  91. # Changes case sensitivity for the cd command tab completion
  92. set cd_tab_case sensitive
  93. # Use fuzzy tab completion with the "cd" command. For example,
  94. # ":cd /u/lo/b<tab>" expands to ":cd /usr/local/bin".
  95. set cd_tab_fuzzy false
  96. # Avoid previewing files larger than this size, in bytes. Use a value of 0 to
  97. # disable this feature.
  98. set preview_max_size 0
  99. # The key hint lists up to this size have their sublists expanded.
  100. # Otherwise the submaps are replaced with "...".
  101. set hint_collapse_threshold 10
  102. # Add the highlighted file to the path in the titlebar
  103. set show_selection_in_titlebar true
  104. # The delay that ranger idly waits for user input, in milliseconds, with a
  105. # resolution of 100ms. Lower delay reduces lag between directory updates but
  106. # increases CPU load.
  107. set idle_delay 2000
  108. # When the metadata manager module looks for metadata, should it only look for
  109. # a ".metadata.json" file in the current directory, or do a deep search and
  110. # check all directories above the current one as well?
  111. set metadata_deep_search false
  112. # Clear all existing filters when leaving a directory
  113. set clear_filters_on_dir_change false
  114. # Disable displaying line numbers in main column
  115. set line_numbers false
  116. # When line_numbers=relative show the absolute line number in the
  117. # current line.
  118. set relative_current_zero false
  119. # Start line numbers from 1 instead of 0
  120. set one_indexed false
  121. set save_tabs_on_exit false
  122. set wrap_scroll true
  123. # Set the global_inode_type_filter to nothing. Possible options: d, f and l for
  124. # directories, files and symlinks respectively.
  125. set global_inode_type_filter
  126. # This setting allows to freeze the list of files to save I/O bandwidth. It
  127. # should be 'false' during start-up, but you can toggle it by pressing F.
  128. set freeze_files false
  129. # ===================================================================
  130. # == Local Options
  131. # ===================================================================
  132. # You can set local options that only affect a single directory.
  133. # Examples:
  134. # setlocal path=~/downloads sort mtime
  135. # ===================================================================
  136. # == Command Aliases in the Console
  137. # ===================================================================
  138. alias e edit
  139. alias q quit
  140. alias q! quit!
  141. alias qa quitall
  142. alias qa! quitall!
  143. alias qall quitall
  144. alias qall! quitall!
  145. alias setl setlocal
  146. alias filter scout -prts
  147. alias find scout -aets
  148. alias mark scout -mr
  149. alias unmark scout -Mr
  150. alias search scout -rs
  151. alias search_inc scout -rts
  152. alias travel scout -aefklst
  153. # ===================================================================
  154. # == Define keys for the browser
  155. # ===================================================================
  156. # Basic
  157. map Q quitall
  158. map q quit
  159. copymap q ZZ ZQ
  160. map R reload_cwd
  161. map F set freeze_files!
  162. map <C-r> reset
  163. map <C-l> redraw_window
  164. map <C-c> abort
  165. map <esc> change_mode normal
  166. map ~ set viewmode!
  167. map i display_file
  168. map ? help
  169. map W display_log
  170. map w taskview_open
  171. map S shell elvish
  172. map : console
  173. map ; console
  174. map ! console shell%space
  175. map @ console -p6 shell %%s
  176. map # console shell -p%space
  177. map s console shell%space
  178. map r chain draw_possible_programs; console open_with%%space
  179. map f console find%space
  180. map cd console cd%space
  181. map <C-p> chain console; eval fm.ui.console.history_move(-1)
  182. # Change the line mode
  183. map Mf linemode filename
  184. map Mi linemode fileinfo
  185. map Mm linemode mtime
  186. map Mp linemode permissions
  187. map Ms linemode sizemtime
  188. map Mt linemode metatitle
  189. # Tagging / Marking
  190. map t tag_toggle
  191. map ut tag_remove
  192. map "<any> tag_toggle tag=%any
  193. map <Space> mark_files toggle=True
  194. map v mark_files all=True toggle=True
  195. map uv mark_files all=True val=False
  196. map V toggle_visual_mode
  197. map uV toggle_visual_mode reverse=True
  198. # For the nostalgics: Midnight Commander bindings
  199. map <F1> help
  200. map <F2> rename_append
  201. map <F3> display_file
  202. map <F4> edit
  203. map <F5> copy
  204. map <F6> cut
  205. map <F7> console mkdir%space
  206. map <F8> console delete
  207. map <F10> exit
  208. # In case you work on a keyboard with dvorak layout
  209. map <UP> move up=1
  210. map <DOWN> move down=1
  211. map <LEFT> move left=1
  212. map <RIGHT> move right=1
  213. map <HOME> move to=0
  214. map <END> move to=-1
  215. map <PAGEDOWN> move down=1 pages=True
  216. map <PAGEUP> move up=1 pages=True
  217. map <CR> move right=1
  218. #map <DELETE> console delete
  219. map <INSERT> console touch%space
  220. # VIM-like
  221. copymap <UP> k
  222. copymap <DOWN> j
  223. copymap <LEFT> h
  224. copymap <RIGHT> l
  225. copymap <HOME> gg
  226. copymap <END> G
  227. copymap <PAGEDOWN> <C-F>
  228. copymap <PAGEUP> <C-B>
  229. map J move down=0.5 pages=True
  230. map K move up=0.5 pages=True
  231. copymap J <C-D>
  232. copymap K <C-U>
  233. # Jumping around
  234. map H history_go -1
  235. map L history_go 1
  236. map ] move_parent 1
  237. map [ move_parent -1
  238. map } traverse
  239. map { traverse_backwards
  240. map ) jump_non
  241. map gh cd ~
  242. map gc eval fm.cd(os.getenv('XDG_CONFIG_HOME'))
  243. map ge cd /etc
  244. map gu cd /usr
  245. map gd cd /dev
  246. map gD eval fm.cd(os.getenv('XDG_DATA_HOME'))
  247. map go cd /opt
  248. map gv cd /var
  249. map gm cd /media
  250. map gM cd /mnt
  251. map gp cd /tmp
  252. map g/ cd /
  253. map g? cd /usr/share/doc/ranger
  254. # External Programs
  255. map E edit
  256. map du shell -p du --max-depth=1 -h --apparent-size
  257. map dU shell -p du --max-depth=1 -h --apparent-size | sort -rh
  258. map yp yank path
  259. map yd yank dir
  260. map yn yank name
  261. map y. yank name_without_extension
  262. # Filesystem Operations
  263. map = chmod
  264. map cw console rename%space
  265. map a rename_append
  266. map A eval fm.open_console('rename ' + fm.thisfile.relative_path.replace("%", "%%"))
  267. map I eval fm.open_console('rename ' + fm.thisfile.relative_path.replace("%", "%%"), position=7)
  268. map pp paste
  269. map po paste overwrite=True
  270. map pP paste append=True
  271. map pO paste overwrite=True append=True
  272. map pl paste_symlink relative=False
  273. map pL paste_symlink relative=True
  274. map phl paste_hardlink
  275. map pht paste_hardlinked_subtree
  276. map dD console delete
  277. map dd cut
  278. map ud uncut
  279. map da cut mode=add
  280. map dr cut mode=remove
  281. map dt cut mode=toggle
  282. map yy copy
  283. map uy uncut
  284. map ya copy mode=add
  285. map yr copy mode=remove
  286. map yt copy mode=toggle
  287. # Temporary workarounds
  288. map dgg eval fm.cut(dirarg=dict(to=0), narg=quantifier)
  289. map dG eval fm.cut(dirarg=dict(to=-1), narg=quantifier)
  290. map dj eval fm.cut(dirarg=dict(down=1), narg=quantifier)
  291. map dk eval fm.cut(dirarg=dict(up=1), narg=quantifier)
  292. map ygg eval fm.copy(dirarg=dict(to=0), narg=quantifier)
  293. map yG eval fm.copy(dirarg=dict(to=-1), narg=quantifier)
  294. map yj eval fm.copy(dirarg=dict(down=1), narg=quantifier)
  295. map yk eval fm.copy(dirarg=dict(up=1), narg=quantifier)
  296. # Searching
  297. map / console search%space
  298. map n search_next
  299. map N search_next forward=False
  300. map ct search_next order=tag
  301. map cs search_next order=size
  302. map ci search_next order=mimetype
  303. map cc search_next order=ctime
  304. map cm search_next order=mtime
  305. map ca search_next order=atime
  306. # Tabs
  307. map <C-n> tab_new
  308. map <C-w> tab_close
  309. map <TAB> tab_move 1
  310. map <S-TAB> tab_move -1
  311. map <A-Right> tab_move 1
  312. map <A-Left> tab_move -1
  313. map gt tab_move 1
  314. map gT tab_move -1
  315. map gn tab_new
  316. map uq tab_restore
  317. map <a-1> tab_open 1
  318. map <a-2> tab_open 2
  319. map <a-3> tab_open 3
  320. map <a-4> tab_open 4
  321. map <a-5> tab_open 5
  322. map <a-6> tab_open 6
  323. map <a-7> tab_open 7
  324. map <a-8> tab_open 8
  325. map <a-9> tab_open 9
  326. # Sorting
  327. map or set sort_reverse!
  328. map oz set sort=random
  329. map os chain set sort=size; set sort_reverse=False
  330. map ob chain set sort=basename; set sort_reverse=False
  331. map on chain set sort=natural; set sort_reverse=False
  332. map om chain set sort=mtime; set sort_reverse=False
  333. map oc chain set sort=ctime; set sort_reverse=False
  334. map oa chain set sort=atime; set sort_reverse=False
  335. map ot chain set sort=type; set sort_reverse=False
  336. map oe chain set sort=extension; set sort_reverse=False
  337. map oS chain set sort=size; set sort_reverse=True
  338. map oB chain set sort=basename; set sort_reverse=True
  339. map oN chain set sort=natural; set sort_reverse=True
  340. map oM chain set sort=mtime; set sort_reverse=True
  341. map oC chain set sort=ctime; set sort_reverse=True
  342. map oA chain set sort=atime; set sort_reverse=True
  343. map oT chain set sort=type; set sort_reverse=True
  344. map oE chain set sort=extension; set sort_reverse=True
  345. map dc get_cumulative_size
  346. # Settings
  347. map zc set collapse_preview!
  348. map zd set sort_directories_first!
  349. map zh set show_hidden!
  350. map <C-h> set show_hidden!
  351. copymap <C-h> <backspace>
  352. copymap <backspace> <backspace2>
  353. map zI set flushinput!
  354. map zi set preview_images!
  355. map zm set mouse_enabled!
  356. map zp set preview_files!
  357. map zP set preview_directories!
  358. map zs set sort_case_insensitive!
  359. map zu set autoupdate_cumulative_size!
  360. map zv set use_preview_script!
  361. map zf console filter%space
  362. copymap zf zz
  363. # Filter stack
  364. map .n console filter_stack add name%space
  365. map .m console filter_stack add mime%space
  366. map .d filter_stack add type d
  367. map .f filter_stack add type f
  368. map .l filter_stack add type l
  369. map .| filter_stack add or
  370. map .& filter_stack add and
  371. map .! filter_stack add not
  372. map .r console filter_stack rotate
  373. map .c filter_stack clear
  374. map .* filter_stack decompose
  375. map .p filter_stack pop
  376. map .. filter_stack show
  377. # Bookmarks
  378. map `<any> enter_bookmark %any
  379. map '<any> enter_bookmark %any
  380. map m<any> set_bookmark %any
  381. map um<any> unset_bookmark %any
  382. map m<bg> draw_bookmarks
  383. copymap m<bg> um<bg> `<bg> '<bg>
  384. # Generate all the chmod bindings with some python help:
  385. eval for arg in "rwxXst": cmd("map +u{0} shell -f chmod u+{0} %s".format(arg))
  386. eval for arg in "rwxXst": cmd("map +g{0} shell -f chmod g+{0} %s".format(arg))
  387. eval for arg in "rwxXst": cmd("map +o{0} shell -f chmod o+{0} %s".format(arg))
  388. eval for arg in "rwxXst": cmd("map +a{0} shell -f chmod a+{0} %s".format(arg))
  389. eval for arg in "rwxXst": cmd("map +{0} shell -f chmod u+{0} %s".format(arg))
  390. eval for arg in "rwxXst": cmd("map -u{0} shell -f chmod u-{0} %s".format(arg))
  391. eval for arg in "rwxXst": cmd("map -g{0} shell -f chmod g-{0} %s".format(arg))
  392. eval for arg in "rwxXst": cmd("map -o{0} shell -f chmod o-{0} %s".format(arg))
  393. eval for arg in "rwxXst": cmd("map -a{0} shell -f chmod a-{0} %s".format(arg))
  394. eval for arg in "rwxXst": cmd("map -{0} shell -f chmod u-{0} %s".format(arg))
  395. # ===================================================================
  396. # == Define keys for the console
  397. # ===================================================================
  398. # Note: Unmapped keys are passed directly to the console.
  399. # Basic
  400. cmap <tab> eval fm.ui.console.tab()
  401. cmap <s-tab> eval fm.ui.console.tab(-1)
  402. cmap <ESC> eval fm.ui.console.close()
  403. cmap <CR> eval fm.ui.console.execute()
  404. cmap <C-l> redraw_window
  405. copycmap <ESC> <C-c>
  406. copycmap <CR> <C-j>
  407. # Move around
  408. cmap <up> eval fm.ui.console.history_move(-1)
  409. cmap <down> eval fm.ui.console.history_move(1)
  410. cmap <left> eval fm.ui.console.move(left=1)
  411. cmap <right> eval fm.ui.console.move(right=1)
  412. cmap <home> eval fm.ui.console.move(right=0, absolute=True)
  413. cmap <end> eval fm.ui.console.move(right=-1, absolute=True)
  414. cmap <a-b> eval fm.ui.console.move_word(left=1)
  415. cmap <a-f> eval fm.ui.console.move_word(right=1)
  416. copycmap <a-b> <a-left>
  417. copycmap <a-f> <a-right>
  418. # Line Editing
  419. cmap <backspace> eval fm.ui.console.delete(-1)
  420. cmap <delete> eval fm.ui.console.delete(0)
  421. cmap <C-w> eval fm.ui.console.delete_word()
  422. cmap <A-d> eval fm.ui.console.delete_word(backward=False)
  423. cmap <C-k> eval fm.ui.console.delete_rest(1)
  424. cmap <C-u> eval fm.ui.console.delete_rest(-1)
  425. cmap <C-y> eval fm.ui.console.paste()
  426. # And of course the emacs way
  427. copycmap <up> <C-p>
  428. copycmap <down> <C-n>
  429. copycmap <left> <C-b>
  430. copycmap <right> <C-f>
  431. copycmap <home> <C-a>
  432. copycmap <end> <C-e>
  433. copycmap <delete> <C-d>
  434. copycmap <backspace> <C-h>
  435. # Note: There are multiple ways to express backspaces. <backspace> (code 263)
  436. # and <backspace2> (code 127). To be sure, use both.
  437. copycmap <backspace> <backspace2>
  438. # This special expression allows typing in numerals:
  439. cmap <allow_quantifiers> false
  440. # ===================================================================
  441. # == Pager Keybindings
  442. # ===================================================================
  443. # Movement
  444. pmap <down> pager_move down=1
  445. pmap <up> pager_move up=1
  446. pmap <left> pager_move left=4
  447. pmap <right> pager_move right=4
  448. pmap <home> pager_move to=0
  449. pmap <end> pager_move to=-1
  450. pmap <pagedown> pager_move down=1.0 pages=True
  451. pmap <pageup> pager_move up=1.0 pages=True
  452. pmap <C-d> pager_move down=0.5 pages=True
  453. pmap <C-u> pager_move up=0.5 pages=True
  454. copypmap <UP> k <C-p>
  455. copypmap <DOWN> j <C-n> <CR>
  456. copypmap <LEFT> h
  457. copypmap <RIGHT> l
  458. copypmap <HOME> g
  459. copypmap <END> G
  460. copypmap <C-d> d
  461. copypmap <C-u> u
  462. copypmap <PAGEDOWN> n f <C-F> <Space>
  463. copypmap <PAGEUP> p b <C-B>
  464. # Basic
  465. pmap <C-l> redraw_window
  466. pmap <ESC> pager_close
  467. copypmap <ESC> q Q i <F3>
  468. pmap E edit_file
  469. # ===================================================================
  470. # == Taskview Keybindings
  471. # ===================================================================
  472. # Movement
  473. tmap <up> taskview_move up=1
  474. tmap <down> taskview_move down=1
  475. tmap <home> taskview_move to=0
  476. tmap <end> taskview_move to=-1
  477. tmap <pagedown> taskview_move down=1.0 pages=True
  478. tmap <pageup> taskview_move up=1.0 pages=True
  479. tmap <C-d> taskview_move down=0.5 pages=True
  480. tmap <C-u> taskview_move up=0.5 pages=True
  481. copytmap <UP> k <C-p>
  482. copytmap <DOWN> j <C-n> <CR>
  483. copytmap <HOME> g
  484. copytmap <END> G
  485. copytmap <C-u> u
  486. copytmap <PAGEDOWN> n f <C-F> <Space>
  487. copytmap <PAGEUP> p b <C-B>
  488. # Changing priority and deleting tasks
  489. tmap J eval -q fm.ui.taskview.task_move(-1)
  490. tmap K eval -q fm.ui.taskview.task_move(0)
  491. tmap dd eval -q fm.ui.taskview.task_remove()
  492. tmap <pagedown> eval -q fm.ui.taskview.task_move(-1)
  493. tmap <pageup> eval -q fm.ui.taskview.task_move(0)
  494. tmap <delete> eval -q fm.ui.taskview.task_remove()
  495. # Basic
  496. tmap <C-l> redraw_window
  497. tmap <ESC> taskview_close
  498. copytmap <ESC> q Q w <C-c>
  499. # ===================================================================
  500. # == Custom
  501. # ===================================================================
  502. map <alt>/ console fd_search %space
  503. map <alt>n fd_next
  504. map <alt>p fd_prev
  505. alias filter-glob scout -ftgsea
  506. map f console filter-glob%space