Another copy of my dotfiles. Because I don't completely trust GitHub.
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.

560 lines
16 KiB

4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
  1. set viewmode miller
  2. set column_ratios 2,2,4
  3. set hidden_filter ^\.|\.(?:pyc|pyo|bak|swp)$|^lost\+found$|^__(py)?cache__$
  4. set show_hidden false
  5. # only confirm when deleting multiple files
  6. set confirm_on_delete multiple
  7. set preview_script ~/.config/ranger/scope.sh
  8. set use_preview_script true
  9. set automatically_count_files true
  10. set open_all_images true
  11. # Be aware of version control systems and display information.
  12. set vcs_aware true
  13. set vcs_backend_git enabled
  14. set vcs_backend_hg disabled
  15. set vcs_backend_bzr disabled
  16. # Use one of the supported image preview protocols
  17. set preview_images true
  18. set preview_images_method ueberzug
  19. # Use a unicode "..." character to mark cut-off filenames?
  20. set unicode_ellipsis true
  21. # Show dotfiles in the bookmark preview box?
  22. set show_hidden_bookmarks true
  23. #set colorscheme material-ocean
  24. # Preview files on the rightmost column?
  25. # And collapse (shrink) the last column if there is nothing to preview?
  26. set preview_files true
  27. set preview_directories true
  28. set collapse_preview false
  29. # Save the console history on exit?
  30. set save_console_history true
  31. # Draw the status bar on top of the browser window (default: bottom)
  32. set status_bar_on_top false
  33. # Draw a progress bar in the status bar which displays the average state of all
  34. # currently running tasks which support progress bars?
  35. set draw_progress_bar_in_status_bar true
  36. # Draw borders around columns?
  37. set draw_borders true
  38. # Display the directory name in tabs?
  39. set dirname_in_tabs true
  40. # Enable the mouse support?
  41. set mouse_enabled true
  42. # Display the file size in the main column or status bar?
  43. set display_size_in_main_column true
  44. set display_size_in_status_bar true
  45. # Display files tags in all columns or only in main column?
  46. set display_tags_in_all_columns true
  47. # Set a title for the window?
  48. set update_title true
  49. # Set the title to "ranger" in the tmux program?
  50. set update_tmux_title true
  51. # Shorten the title if it gets long? The number defines how many
  52. # directories are displayed at once, 0 turns off this feature.
  53. set shorten_title 3
  54. # Abbreviate $HOME with ~ in the titlebar (first line) of ranger?
  55. set tilde_in_titlebar false
  56. # How many directory-changes or console-commands should be kept in history?
  57. set max_history_size 20
  58. set max_console_history_size 50
  59. # Try to keep so much space between the top/bottom border when scrolling:
  60. set scroll_offset 8
  61. # Flush the input after each key hit? (Noticeable when ranger lags)
  62. set flushinput true
  63. # Padding on the right when there's no preview?
  64. # This allows you to click into the space to run the file.
  65. set padding_right true
  66. # Save bookmarks (used with mX and `X) instantly?
  67. # This helps to synchronize bookmarks between multiple ranger
  68. # instances but leads to *slight* performance loss.
  69. # When false, bookmarks are saved when ranger is exited.
  70. set autosave_bookmarks false
  71. default_linemode devicons2
  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 true
  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. # Avoid previewing files larger than this size, in bytes. Use a value of 0 to
  92. # disable this feature.
  93. set preview_max_size 0
  94. # Add the highlighted file to the path in the titlebar
  95. set show_selection_in_titlebar true
  96. # The delay that ranger idly waits for user input, in milliseconds, with a
  97. # resolution of 100ms. Lower delay reduces lag between directory updates but
  98. # increases CPU load.
  99. set idle_delay 2000
  100. # When the metadata manager module looks for metadata, should it only look for
  101. # a ".metadata.json" file in the current directory, or do a deep search and
  102. # check all directories above the current one as well?
  103. set metadata_deep_search false
  104. # Clear all existing filters when leaving a directory
  105. set clear_filters_on_dir_change false
  106. # Disable displaying line numbers in main column
  107. set line_numbers false
  108. # ===================================================================
  109. # == Local Options
  110. # ===================================================================
  111. # You can set local options that only affect a single directory.
  112. # Examples:
  113. # setlocal path=~/downloads sort mtime
  114. # ===================================================================
  115. # == Command Aliases in the Console
  116. # ===================================================================
  117. alias e edit
  118. alias q quit
  119. alias q! quitall
  120. alias qa quitall
  121. alias qall quitall
  122. alias setl setlocal
  123. alias filter scout -prt
  124. alias find scout -aeit
  125. alias mark scout -mr
  126. alias unmark scout -Mr
  127. alias search scout -rs
  128. alias search_inc scout -rts
  129. alias travel scout -aefiklst
  130. # ===================================================================
  131. # == Define keys for the browser
  132. # ===================================================================
  133. # Basic
  134. map Q quit!
  135. map q quit
  136. copymap q ZZ ZQ
  137. map R reload_cwd
  138. map <C-r> reset
  139. map <C-l> redraw_window
  140. map <C-c> abort
  141. map <esc> change_mode normal
  142. map ~ set viewmode!
  143. map i display_file
  144. map ? help
  145. map W display_log
  146. map w taskview_open
  147. map S shell $SHELL
  148. map : console
  149. map ; console
  150. map ! console shell%space
  151. map @ console -p6 shell %%s
  152. map # console shell -p%space
  153. map s console shell%space
  154. map r chain draw_possible_programs; console open_with%%space
  155. map f console find%space
  156. map cd console cd%space
  157. # Change the line mode
  158. map Mf linemode filename
  159. map Mi linemode fileinfo
  160. map Mm linemode mtime
  161. map Md linemode devicons2
  162. map Mp linemode permissions
  163. map Ms linemode sizemtime
  164. map Mt linemode metatitle
  165. # Tagging / Marking
  166. map t tag_toggle
  167. map ut tag_remove
  168. map "<any> tag_toggle tag=%any
  169. map <Space> mark_files toggle=True
  170. map v mark_files all=True toggle=True
  171. map uv mark_files all=True val=False
  172. map V toggle_visual_mode
  173. map uV toggle_visual_mode reverse=True
  174. # For the nostalgics: Midnight Commander bindings
  175. map <F1> help
  176. map <F3> display_file
  177. map <F4> edit
  178. map <F5> copy
  179. map <F6> cut
  180. map <F7> console mkdir%space
  181. map <F8> console delete
  182. map <F10> exit
  183. # In case you work on a keyboard with dvorak layout
  184. map <UP> move up=1
  185. map <DOWN> move down=1
  186. map <LEFT> move left=1
  187. map <RIGHT> move right=1
  188. map <HOME> move to=0
  189. map <END> move to=-1
  190. map <PAGEDOWN> move down=1 pages=True
  191. map <PAGEUP> move up=1 pages=True
  192. map <CR> move right=1
  193. #map <DELETE> console delete
  194. map <INSERT> console touch%space
  195. # VIM-like
  196. copymap <UP> k
  197. copymap <DOWN> j
  198. copymap <LEFT> h
  199. copymap <RIGHT> l
  200. copymap <HOME> gg
  201. copymap <END> G
  202. copymap <PAGEDOWN> <C-F>
  203. copymap <PAGEUP> <C-B>
  204. map J move down=0.5 pages=True
  205. map K move up=0.5 pages=True
  206. copymap J <C-D>
  207. copymap K <C-U>
  208. # Jumping around
  209. map H history_go -1
  210. map L history_go 1
  211. map ] move_parent 1
  212. map [ move_parent -1
  213. map } traverse
  214. map gh cd ~
  215. map ge cd /etc
  216. map gu cd /usr
  217. map gd cd /dev
  218. map gl cd -r .
  219. map gL cd -r %f
  220. map go cd /opt
  221. map gv cd /var
  222. map gm cd /media
  223. map gM cd /mnt
  224. map gs cd /srv
  225. map gr cd /
  226. map gR eval fm.cd(ranger.RANGERDIR)
  227. map g/ cd /
  228. map g? cd /usr/share/doc/ranger
  229. # Encryption and Compression
  230. map eE encrypt
  231. map eD decrypt
  232. map X extract
  233. map C compress
  234. # External Programs
  235. map e edit
  236. map du shell -p du --max-depth=1 -h --apparent-size
  237. map dU shell -p du --max-depth=1 -h --apparent-size | sort -rh
  238. map yp shell -f echo -n %d/%f | xsel -i; xsel -o | xsel -i -b
  239. map yd shell -f echo -n %d | xsel -i; xsel -o | xsel -i -b
  240. map yn shell -f echo -n %f | xsel -i; xsel -o | xsel -i -b
  241. # Filesystem Operations
  242. map = chmod
  243. map cw console rename%space
  244. map a rename_append
  245. map A eval fm.open_console('rename ' + fm.thisfile.relative_path.replace("%", "%%"))
  246. map I eval fm.open_console('rename ' + fm.thisfile.relative_path.replace("%", "%%"), position=7)
  247. map pp paste
  248. map po paste overwrite=True
  249. map pP paste append=True
  250. map pO paste overwrite=True append=True
  251. map pl paste_symlink relative=False
  252. map pL paste_symlink relative=True
  253. map phl paste_hardlink
  254. map pht paste_hardlinked_subtree
  255. map D delete
  256. map dd cut
  257. map ud uncut
  258. map da cut mode=add
  259. map dr cut mode=remove
  260. map dt cut mode=toggle
  261. map yy copy
  262. map Y YankContent
  263. map uy uncut
  264. map ya copy mode=add
  265. map yr copy mode=remove
  266. map yt copy mode=toggle
  267. # Temporary workarounds
  268. map dgg eval fm.cut(dirarg=dict(to=0), narg=quantifier)
  269. map dG eval fm.cut(dirarg=dict(to=-1), narg=quantifier)
  270. map dj eval fm.cut(dirarg=dict(down=1), narg=quantifier)
  271. map dk eval fm.cut(dirarg=dict(up=1), narg=quantifier)
  272. map ygg eval fm.copy(dirarg=dict(to=0), narg=quantifier)
  273. map yG eval fm.copy(dirarg=dict(to=-1), narg=quantifier)
  274. map yj eval fm.copy(dirarg=dict(down=1), narg=quantifier)
  275. map yk eval fm.copy(dirarg=dict(up=1), narg=quantifier)
  276. # Searching
  277. map / console search%space
  278. map n search_next
  279. map N search_next forward=False
  280. map ct search_next order=tag
  281. map cz console z%space
  282. map cs search_next order=size
  283. map ci search_next order=mimetype
  284. map cc search_next order=ctime
  285. map cm search_next order=mtime
  286. map ca search_next order=atime
  287. map cf fzf_select
  288. # Tabs
  289. map <C-n> tab_new ~
  290. map <C-w> tab_close
  291. map <TAB> tab_move 1
  292. map <S-TAB> tab_move -1
  293. map <A-Right> tab_move 1
  294. map <A-Left> tab_move -1
  295. map gt tab_move 1
  296. map gT tab_move -1
  297. map gn tab_new ~
  298. map gc tab_close
  299. map uq tab_restore
  300. map <a-1> tab_open 1
  301. map <a-2> tab_open 2
  302. map <a-3> tab_open 3
  303. map <a-4> tab_open 4
  304. map <a-5> tab_open 5
  305. map <a-6> tab_open 6
  306. map <a-7> tab_open 7
  307. map <a-8> tab_open 8
  308. map <a-9> tab_open 9
  309. # Sorting
  310. map or set sort_reverse!
  311. map oz set sort=random
  312. map os chain set sort=size; set sort_reverse=False
  313. map ob chain set sort=basename; set sort_reverse=False
  314. map on chain set sort=natural; set sort_reverse=False
  315. map om chain set sort=mtime; set sort_reverse=False
  316. map oc chain set sort=ctime; set sort_reverse=False
  317. map oa chain set sort=atime; set sort_reverse=False
  318. map ot chain set sort=type; set sort_reverse=False
  319. map oe chain set sort=extension; set sort_reverse=False
  320. map oS chain set sort=size; set sort_reverse=True
  321. map oB chain set sort=basename; set sort_reverse=True
  322. map oN chain set sort=natural; set sort_reverse=True
  323. map oM chain set sort=mtime; set sort_reverse=True
  324. map oC chain set sort=ctime; set sort_reverse=True
  325. map oA chain set sort=atime; set sort_reverse=True
  326. map oT chain set sort=type; set sort_reverse=True
  327. map oE chain set sort=extension; set sort_reverse=True
  328. map dc get_cumulative_size
  329. map dh chrome_choose .
  330. map dn console chrome_choose
  331. # Settings
  332. map zc set collapse_preview!
  333. map zd set sort_directories_first!
  334. map zh set show_hidden!
  335. map <C-h> set show_hidden!
  336. map <C-f> toggle_flat
  337. map zI set flushinput!
  338. map zi set preview_images!
  339. map zm set mouse_enabled!
  340. map zp set preview_files!
  341. map zP set preview_directories!
  342. map zs set sort_case_insensitive!
  343. map zu set autoupdate_cumulative_size!
  344. map zv set use_preview_script!
  345. map zf console filter%space
  346. # Bookmarks
  347. map `<any> enter_bookmark %any
  348. map '<any> enter_bookmark %any
  349. map m<any> set_bookmark %any
  350. map um<any> unset_bookmark %any
  351. map m<bg> draw_bookmarks
  352. copymap m<bg> um<bg> `<bg> '<bg>
  353. # Generate all the chmod bindings with some python help:
  354. eval for arg in "rwxXst": cmd("map +u{0} shell -f chmod u+{0} %s".format(arg))
  355. eval for arg in "rwxXst": cmd("map +g{0} shell -f chmod g+{0} %s".format(arg))
  356. eval for arg in "rwxXst": cmd("map +o{0} shell -f chmod o+{0} %s".format(arg))
  357. eval for arg in "rwxXst": cmd("map +a{0} shell -f chmod a+{0} %s".format(arg))
  358. eval for arg in "rwxXst": cmd("map +{0} shell -f chmod u+{0} %s".format(arg))
  359. eval for arg in "rwxXst": cmd("map -u{0} shell -f chmod u-{0} %s".format(arg))
  360. eval for arg in "rwxXst": cmd("map -g{0} shell -f chmod g-{0} %s".format(arg))
  361. eval for arg in "rwxXst": cmd("map -o{0} shell -f chmod o-{0} %s".format(arg))
  362. eval for arg in "rwxXst": cmd("map -a{0} shell -f chmod a-{0} %s".format(arg))
  363. eval for arg in "rwxXst": cmd("map -{0} shell -f chmod u-{0} %s".format(arg))
  364. # ===================================================================
  365. # == Define keys for the console
  366. # ===================================================================
  367. # Note: Unmapped keys are passed directly to the console.
  368. # Basic
  369. cmap <tab> eval fm.ui.console.tab()
  370. cmap <s-tab> eval fm.ui.console.tab(-1)
  371. cmap <ESC> eval fm.ui.console.close()
  372. cmap <CR> eval fm.ui.console.execute()
  373. cmap <C-l> redraw_window
  374. copycmap <ESC> <C-c>
  375. copycmap <CR> <C-j>
  376. # Move around
  377. cmap <up> eval fm.ui.console.history_move(-1)
  378. cmap <down> eval fm.ui.console.history_move(1)
  379. cmap <left> eval fm.ui.console.move(left=1)
  380. cmap <right> eval fm.ui.console.move(right=1)
  381. cmap <home> eval fm.ui.console.move(right=0, absolute=True)
  382. cmap <end> eval fm.ui.console.move(right=-1, absolute=True)
  383. cmap <a-left> eval fm.ui.console.move_word(left=1)
  384. cmap <a-right> eval fm.ui.console.move_word(right=1)
  385. # Line Editing
  386. cmap <backspace> eval fm.ui.console.delete(-1)
  387. cmap <delete> eval fm.ui.console.delete(0)
  388. cmap <C-w> eval fm.ui.console.delete_word()
  389. cmap <A-d> eval fm.ui.console.delete_word(backward=False)
  390. cmap <C-k> eval fm.ui.console.delete_rest(1)
  391. cmap <C-u> eval fm.ui.console.delete_rest(-1)
  392. cmap <C-y> eval fm.ui.console.paste()
  393. # And of course the emacs way
  394. copycmap <up> <C-p>
  395. copycmap <down> <C-n>
  396. copycmap <left> <C-b>
  397. copycmap <right> <C-f>
  398. copycmap <home> <C-a>
  399. copycmap <end> <C-e>
  400. copycmap <delete> <C-d>
  401. copycmap <backspace> <C-h>
  402. # Note: There are multiple ways to express backspaces. <backspace> (code 263)
  403. # and <backspace2> (code 127). To be sure, use both.
  404. copycmap <backspace> <backspace2>
  405. # This special expression allows typing in numerals:
  406. cmap <allow_quantifiers> false
  407. # ===================================================================
  408. # == Pager Keybindings
  409. # ===================================================================
  410. # Movement
  411. pmap <down> pager_move down=1
  412. pmap <up> pager_move up=1
  413. pmap <left> pager_move left=4
  414. pmap <right> pager_move right=4
  415. pmap <home> pager_move to=0
  416. pmap <end> pager_move to=-1
  417. pmap <pagedown> pager_move down=1.0 pages=True
  418. pmap <pageup> pager_move up=1.0 pages=True
  419. pmap <C-d> pager_move down=0.5 pages=True
  420. pmap <C-u> pager_move up=0.5 pages=True
  421. copypmap <UP> k <C-p>
  422. copypmap <DOWN> j <C-n> <CR>
  423. copypmap <LEFT> h
  424. copypmap <RIGHT> l
  425. copypmap <HOME> g
  426. copypmap <END> G
  427. copypmap <C-d> d
  428. copypmap <C-u> u
  429. copypmap <PAGEDOWN> n f <C-F> <Space>
  430. copypmap <PAGEUP> p b <C-B>
  431. # Basic
  432. pmap <C-l> redraw_window
  433. pmap <ESC> pager_close
  434. copypmap <ESC> q Q i <F3>
  435. pmap E edit_file
  436. # ===================================================================
  437. # == Taskview Keybindings
  438. # ===================================================================
  439. # Movement
  440. tmap <up> taskview_move up=1
  441. tmap <down> taskview_move down=1
  442. tmap <home> taskview_move to=0
  443. tmap <end> taskview_move to=-1
  444. tmap <pagedown> taskview_move down=1.0 pages=True
  445. tmap <pageup> taskview_move up=1.0 pages=True
  446. tmap <C-d> taskview_move down=0.5 pages=True
  447. tmap <C-u> taskview_move up=0.5 pages=True
  448. copytmap <UP> k <C-p>
  449. copytmap <DOWN> j <C-n> <CR>
  450. copytmap <HOME> g
  451. copytmap <END> G
  452. copytmap <C-u> u
  453. copytmap <PAGEDOWN> n f <C-F> <Space>
  454. copytmap <PAGEUP> p b <C-B>
  455. # Changing priority and deleting tasks
  456. tmap J eval -q fm.ui.taskview.task_move(-1)
  457. tmap K eval -q fm.ui.taskview.task_move(0)
  458. tmap dd eval -q fm.ui.taskview.task_remove()
  459. tmap <pagedown> eval -q fm.ui.taskview.task_move(-1)
  460. tmap <pageup> eval -q fm.ui.taskview.task_move(0)
  461. tmap <delete> eval -q fm.ui.taskview.task_remove()
  462. # Basic
  463. tmap <C-l> redraw_window
  464. tmap <ESC> taskview_close
  465. copytmap <ESC> q Q w <C-c>