rc.conf 26 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832
  1. # ===================================================================
  2. # This file contains the default startup commands for ranger.
  3. # To change them, it is recommended to create either /etc/ranger/rc.conf
  4. # (system-wide) or ~/.config/ranger/rc.conf (per user) and add your custom
  5. # commands there.
  6. #
  7. # If you copy this whole file there, you may want to set the environment
  8. # variable RANGER_LOAD_DEFAULT_RC to FALSE to avoid loading it twice.
  9. #
  10. # The purpose of this file is mainly to define keybindings and settings.
  11. # For running more complex python code, please create a plugin in "plugins/" or
  12. # a command in "commands.py".
  13. #
  14. # Each line is a command that will be run before the user interface
  15. # is initialized. As a result, you can not use commands which rely
  16. # on the UI such as :delete or :mark.
  17. # ===================================================================
  18. # ===================================================================
  19. # == Options
  20. # ===================================================================
  21. # Which viewmode should be used? Possible values are:
  22. # miller: Use miller columns which show multiple levels of the hierarchy
  23. # multipane: Midnight-commander like multipane view showing all tabs next
  24. # to each other
  25. set viewmode miller
  26. #set viewmode multipane
  27. # How many columns are there, and what are their relative widths?
  28. set column_ratios 1,3,4
  29. # Which files should be hidden? (regular expression)
  30. set hidden_filter ^\.|\.(?:pyc|pyo|bak|swp)$|^lost\+found$|^__(py)?cache__$
  31. # Show hidden files? You can toggle this by typing 'zh'
  32. set show_hidden false
  33. # Ask for a confirmation when running the "delete" command?
  34. # Valid values are "always", "never", "multiple" (default)
  35. # With "multiple", ranger will ask only if you delete multiple files at once.
  36. set confirm_on_delete multiple
  37. # Use non-default path for file preview script?
  38. # ranger ships with scope.sh, a script that calls external programs (see
  39. # README.md for dependencies) to preview images, archives, etc.
  40. set preview_script ~/.config/ranger/scope.sh
  41. # Use the external preview script or display simple plain text or image previews?
  42. set use_preview_script true
  43. # Automatically count files in the directory, even before entering them?
  44. set automatically_count_files true
  45. # Open all images in this directory when running certain image viewers
  46. # like feh or sxiv? You can still open selected files by marking them.
  47. set open_all_images true
  48. # Be aware of version control systems and display information.
  49. set vcs_aware false
  50. # State of the four backends git, hg, bzr, svn. The possible states are
  51. # disabled, local (only show local info), enabled (show local and remote
  52. # information).
  53. set vcs_backend_git enabled
  54. set vcs_backend_hg disabled
  55. set vcs_backend_bzr disabled
  56. set vcs_backend_svn disabled
  57. # Truncate the long commit messages to this length when shown in the statusbar.
  58. set vcs_msg_length 50
  59. # Use one of the supported image preview protocols
  60. set preview_images true
  61. # Set the preview image method. Supported methods:
  62. #
  63. # * w3m (default):
  64. # Preview images in full color with the external command "w3mimgpreview"?
  65. # This requires the console web browser "w3m" and a supported terminal.
  66. # It has been successfully tested with "xterm" and "urxvt" without tmux.
  67. #
  68. # * iterm2:
  69. # Preview images in full color using iTerm2 image previews
  70. # (http://iterm2.com/images.html). This requires using iTerm2 compiled
  71. # with image preview support.
  72. #
  73. # This feature relies on the dimensions of the terminal's font. By default, a
  74. # width of 8 and height of 11 are used. To use other values, set the options
  75. # iterm2_font_width and iterm2_font_height to the desired values.
  76. #
  77. # * terminology:
  78. # Previews images in full color in the terminology terminal emulator.
  79. # Supports a wide variety of formats, even vector graphics like svg.
  80. #
  81. # * urxvt:
  82. # Preview images in full color using urxvt image backgrounds. This
  83. # requires using urxvt compiled with pixbuf support.
  84. #
  85. # * urxvt-full:
  86. # The same as urxvt but utilizing not only the preview pane but the
  87. # whole terminal window.
  88. #
  89. # * kitty:
  90. # Preview images in full color using kitty image protocol.
  91. # Requires python PIL or pillow library.
  92. # If ranger does not share the local filesystem with kitty
  93. # the transfer method is changed to encode the whole image;
  94. # while slower, this allows remote previews,
  95. # for example during an ssh session.
  96. # Tmux is unsupported.
  97. #
  98. # * ueberzug:
  99. # Preview images in full color with the external command "ueberzug".
  100. # Images are shown by using a child window.
  101. # Only for users who run X11 in GNU/Linux.
  102. set preview_images_method ueberzug
  103. # Delay in seconds before displaying an image with the w3m method.
  104. # Increase it in case of experiencing display corruption.
  105. set w3m_delay 0.02
  106. # Manually adjust the w3mimg offset when using a terminal which needs this
  107. set w3m_offset 0
  108. # Default iTerm2 font size (see: preview_images_method: iterm2)
  109. set iterm2_font_width 8
  110. set iterm2_font_height 11
  111. # Use a unicode "..." character to mark cut-off filenames?
  112. set unicode_ellipsis false
  113. # BIDI support - try to properly display file names in RTL languages (Hebrew, Arabic).
  114. # Requires the python-bidi pip package
  115. set bidi_support false
  116. # Show dotfiles in the bookmark preview box?
  117. set show_hidden_bookmarks true
  118. # Which colorscheme to use? These colorschemes are available by default:
  119. # default, jungle, snow, solarized
  120. set colorscheme default
  121. # Preview files on the rightmost column?
  122. # And collapse (shrink) the last column if there is nothing to preview?
  123. set preview_files false
  124. set preview_directories true
  125. set collapse_preview true
  126. # Wrap long lines in plain text previews?
  127. set wrap_plaintext_previews false
  128. # Save the console history on exit?
  129. set save_console_history true
  130. # Draw the status bar on top of the browser window (default: bottom)
  131. set status_bar_on_top false
  132. # Draw a progress bar in the status bar which displays the average state of all
  133. # currently running tasks which support progress bars?
  134. set draw_progress_bar_in_status_bar true
  135. # Draw borders around columns? (separators, outline, both, or none)
  136. # Separators are vertical lines between columns.
  137. # Outline draws a box around all the columns.
  138. # Both combines the two.
  139. set draw_borders false
  140. # Display the directory name in tabs?
  141. set dirname_in_tabs true
  142. # Enable the mouse support?
  143. set mouse_enabled true
  144. # Display the file size in the main column or status bar?
  145. set display_size_in_main_column true
  146. set display_size_in_status_bar true
  147. # Display the free disk space in the status bar?
  148. set display_free_space_in_status_bar true
  149. # Display files tags in all columns or only in main column?
  150. set display_tags_in_all_columns true
  151. # Set a title for the window? Updates both `WM_NAME` and `WM_ICON_NAME`
  152. set update_title false
  153. # Set the tmux/screen window-name to "ranger"?
  154. set update_tmux_title true
  155. # Shorten the title if it gets long? The number defines how many
  156. # directories are displayed at once, 0 turns off this feature.
  157. set shorten_title 3
  158. # Show hostname in titlebar?
  159. set hostname_in_titlebar true
  160. # Abbreviate $HOME with ~ in the titlebar (first line) of ranger?
  161. set tilde_in_titlebar true
  162. # How many directory-changes or console-commands should be kept in history?
  163. set max_history_size 20
  164. set max_console_history_size 50
  165. # Try to keep so much space between the top/bottom border when scrolling:
  166. set scroll_offset 8
  167. # Flush the input after each key hit? (Noticeable when ranger lags)
  168. set flushinput true
  169. # Padding on the right when there's no preview?
  170. # This allows you to click into the space to run the file.
  171. set padding_right true
  172. # Save bookmarks (used with mX and `X) instantly?
  173. # This helps to synchronize bookmarks between multiple ranger
  174. # instances but leads to *slight* performance loss.
  175. # When false, bookmarks are saved when ranger is exited.
  176. set autosave_bookmarks true
  177. # Save the "`" bookmark to disk. This can be used to switch to the last
  178. # directory by typing "``".
  179. set save_backtick_bookmark true
  180. # You can display the "real" cumulative size of directories by using the
  181. # command :get_cumulative_size or typing "dc". The size is expensive to
  182. # calculate and will not be updated automatically. You can choose
  183. # to update it automatically though by turning on this option:
  184. set autoupdate_cumulative_size false
  185. # Turning this on makes sense for screen readers:
  186. set show_cursor false
  187. # One of: size, natural, basename, atime, ctime, mtime, type, random
  188. set sort natural
  189. # Additional sorting options
  190. set sort_reverse false
  191. set sort_case_insensitive true
  192. set sort_directories_first true
  193. set sort_unicode false
  194. # Enable this if key combinations with the Alt Key don't work for you.
  195. # (Especially on xterm)
  196. set xterm_alt_key false
  197. # Whether to include bookmarks in cd command
  198. set cd_bookmarks true
  199. # Changes case sensitivity for the cd command tab completion
  200. set cd_tab_case sensitive
  201. # Use fuzzy tab completion with the "cd" command. For example,
  202. # ":cd /u/lo/b<tab>" expands to ":cd /usr/local/bin".
  203. set cd_tab_fuzzy false
  204. # Avoid previewing files larger than this size, in bytes. Use a value of 0 to
  205. # disable this feature.
  206. set preview_max_size 0
  207. # The key hint lists up to this size have their sublists expanded.
  208. # Otherwise the submaps are replaced with "...".
  209. set hint_collapse_threshold 10
  210. # Add the highlighted file to the path in the titlebar
  211. set show_selection_in_titlebar true
  212. # The delay that ranger idly waits for user input, in milliseconds, with a
  213. # resolution of 100ms. Lower delay reduces lag between directory updates but
  214. # increases CPU load.
  215. set idle_delay 2000
  216. # When the metadata manager module looks for metadata, should it only look for
  217. # a ".metadata.json" file in the current directory, or do a deep search and
  218. # check all directories above the current one as well?
  219. set metadata_deep_search false
  220. # Clear all existing filters when leaving a directory
  221. set clear_filters_on_dir_change false
  222. # Disable displaying line numbers in main column.
  223. # Possible values: false, absolute, relative.
  224. set line_numbers false
  225. # When line_numbers=relative show the absolute line number in the
  226. # current line.
  227. set relative_current_zero false
  228. # Start line numbers from 1 instead of 0
  229. set one_indexed false
  230. # Save tabs on exit
  231. set save_tabs_on_exit false
  232. # Enable scroll wrapping - moving down while on the last item will wrap around to
  233. # the top and vice versa.
  234. set wrap_scroll true
  235. # Set the global_inode_type_filter to nothing. Possible options: d, f and l for
  236. # directories, files and symlinks respectively.
  237. set global_inode_type_filter
  238. # This setting allows to freeze the list of files to save I/O bandwidth. It
  239. # should be 'false' during start-up, but you can toggle it by pressing F.
  240. set freeze_files false
  241. # Print file sizes in bytes instead of the default human-readable format.
  242. set size_in_bytes false
  243. # Warn at startup if RANGER_LEVEL env var is greater than 0, in other words
  244. # give a warning when you nest ranger in a subshell started by ranger.
  245. # Special value "error" makes the warning more visible.
  246. set nested_ranger_warning true
  247. # ===================================================================
  248. # == Local Options
  249. # ===================================================================
  250. # You can set local options that only affect a single directory.
  251. # Examples:
  252. # setlocal path=~/downloads sort mtime
  253. setlocal path=~/Downloads sort type
  254. # ===================================================================
  255. # == Command Aliases in the Console
  256. # ===================================================================
  257. alias e edit
  258. alias q quit
  259. alias q! quit!
  260. alias qa quitall
  261. alias qa! quitall!
  262. alias qall quitall
  263. alias qall! quitall!
  264. alias setl setlocal
  265. alias filter scout -prts
  266. alias find scout -aets
  267. alias mark scout -mr
  268. alias unmark scout -Mr
  269. alias search scout -rs
  270. alias search_inc scout -rts
  271. alias travel scout -aefklst
  272. # ===================================================================
  273. # == Define keys for the browser
  274. # ===================================================================
  275. # Basic
  276. map Q quitall
  277. map q quit
  278. # copymap q ZZ ZQ
  279. map R reload_cwd
  280. map F set freeze_files!
  281. map <C-r> reset
  282. map <C-l> redraw_window
  283. map <C-c> abort
  284. map <esc> change_mode normal
  285. map ~ set viewmode!
  286. map i display_file
  287. map <A-j> scroll_preview 1
  288. map <A-k> scroll_preview -1
  289. map ? help
  290. map W display_log
  291. map w taskview_open
  292. map S shell $SHELL
  293. map : console
  294. map ; console
  295. map ! console shell -p%space
  296. map s console shell%space
  297. # map ! console shell%space
  298. # map s console shell%space
  299. map @ console -p6 shell %%s
  300. map # console shell%space
  301. map r chain draw_possible_programs; console open_with%space
  302. map f console find%space
  303. map cd console cd%space
  304. map <C-p> chain console; eval fm.ui.console.history_move(-1)
  305. # Change the line mode
  306. map Mf linemode filename
  307. map Mi linemode fileinfo
  308. map Mm linemode mtime
  309. map Mh linemode humanreadablemtime
  310. map Mp linemode permissions
  311. map Ms linemode sizemtime
  312. map MH linemode sizehumanreadablemtime
  313. map Mt linemode metatitle
  314. # Tagging / Marking
  315. map t tag_toggle
  316. map ut tag_remove
  317. map "<any> tag_toggle tag=%any
  318. map <Space> mark_files toggle=True
  319. map v mark_files all=True toggle=True
  320. map uv mark_files all=True val=False
  321. map V toggle_visual_mode
  322. map uV toggle_visual_mode reverse=True
  323. # For the nostalgics: Midnight Commander bindings
  324. map <F1> help
  325. map <F2> rename_append
  326. map <F3> display_file
  327. map <F4> edit
  328. map <F5> copy
  329. map <F6> cut
  330. map <F7> console mkdir%space
  331. map <F8> console delete
  332. #map <F8> console trash
  333. map <F10> exit
  334. # In case you work on a keyboard with dvorak layout
  335. map <UP> move up=1
  336. map <DOWN> move down=1
  337. map <LEFT> move left=1
  338. map <RIGHT> move right=1
  339. map <HOME> move to=0
  340. map <END> move to=-1
  341. map <PAGEDOWN> move down=1 pages=True
  342. map <PAGEUP> move up=1 pages=True
  343. map <CR> move right=1
  344. #map <DELETE> console delete
  345. map <INSERT> console touch%space
  346. # VIM-like
  347. copymap <UP> k
  348. copymap <DOWN> j
  349. copymap <LEFT> h
  350. copymap <RIGHT> l
  351. copymap <HOME> gg
  352. copymap <END> G
  353. copymap <PAGEDOWN> <C-F>
  354. copymap <PAGEUP> <C-B>
  355. map J move down=0.5 pages=True
  356. map K move up=0.5 pages=True
  357. copymap J <C-D>
  358. copymap K <C-U>
  359. # Jumping around
  360. map H history_go -1
  361. map L history_go 1
  362. map ] move_parent 1
  363. map [ move_parent -1
  364. map } traverse
  365. map { traverse_backwards
  366. map ) jump_non
  367. map g~ cd ~
  368. map t~ tab_new ~
  369. map gy cd ~/.cache/yay/
  370. map ty tab_new ~/.cache/yay/
  371. map gk cd ~/OS/Linux/backup/Drivers/NVidia/GeForce9600GT/WorksOnLinuxKernel419/Kernel419/
  372. map tk tab_new ~/OS/Linux/backup/Drivers/NVidia/GeForce9600GT/WorksOnLinuxKernel419/Kernel419/
  373. map gp cd ~/Projects
  374. map tp tab_new ~/Projects
  375. map ga cd ~/Programs/AppImageApplications
  376. map ta tab_new ~/Programs/AppImageApplications
  377. map gb cd ~/OS/Linux/+backup
  378. map tb tab_new ~/OS/Linux/+backup
  379. map gc cd ~/.config
  380. map tc tab_new ~/.config
  381. map gr cd ~/.config/ranger
  382. map tr tab_new ~/.config/ranger
  383. map gl cd ~/.local/share/applications
  384. map tl tab_new ~/.local/share/applications
  385. map gs cd ~/.myScripts
  386. map ts tab_new ~/.myScripts
  387. map gt cd ~/.local/share/Trash/files/
  388. map tt tab_new ~/.local/share/Trash/files/
  389. map gw cd ~/Загрузки
  390. map tw tab_new ~/Загрузки
  391. map g/ cd /
  392. map t/ tab_new /
  393. map gE cd /etc
  394. map tE tab_new /etc
  395. map gM cd /run/media
  396. map tM tab_new /run/media
  397. map gC cd /var/cache/pacman/pkg
  398. map tC tab_new /var/cache/pacman/pkg
  399. map gP cd /usr/lib/python3.10/site-packages
  400. map tP tab_new /usr/lib/python3.10/site-packages
  401. map gS cd /usr/share
  402. map tS tab_new /usr/share
  403. map gT cd /tmp
  404. map tT tab_new /tmp
  405. map gi eval fm.cd('/run/media/' + os.getenv('USER'))
  406. # map gd cd /dev
  407. # map gl cd -r .
  408. # map gL cd -r %f
  409. # map go cd /opt
  410. # map gv cd /var
  411. # map gr cd /
  412. # map gM cd /mnt
  413. # map gp cd /tmp
  414. map gR eval fm.cd(ranger.RANGERDIR)
  415. map g? cd /usr/share/doc/ranger
  416. # External Programs
  417. map E edit
  418. map du shell -p du --max-depth=1 -h --apparent-size
  419. map dU shell -p du --max-depth=1 -h --apparent-size | sort -rh
  420. map yp yank path
  421. map yd yank dir
  422. map yn yank name
  423. map y. yank name_without_extension
  424. # Filesystem Operations
  425. map = chmod
  426. map cw console rename%space
  427. map a rename_append
  428. map A eval fm.open_console('rename ' + fm.thisfile.relative_path.replace("%", "%%"))
  429. map I eval fm.open_console('rename ' + fm.thisfile.relative_path.replace("%", "%%"), position=7)
  430. map pp paste
  431. map po paste overwrite=True
  432. map pP paste append=True
  433. map pO paste overwrite=True append=True
  434. map pl paste_symlink relative=False
  435. map pL paste_symlink relative=True
  436. map phl paste_hardlink
  437. map pht paste_hardlinked_subtree
  438. map pd console paste dest=
  439. map p`<any> paste dest=%any_path
  440. map p'<any> paste dest=%any_path
  441. map dD console delete
  442. # map dT console trash
  443. map dT shell gio trash %s
  444. map Te shell gio trash --empty
  445. map Tr shell gio trash --restore trash:///%s
  446. map dd cut
  447. map ud uncut
  448. map da cut mode=add
  449. map dr cut mode=remove
  450. map dt cut mode=toggle
  451. map yy copy
  452. map uy uncut
  453. map ya copy mode=add
  454. map yr copy mode=remove
  455. map yt copy mode=toggle
  456. # Temporary workarounds
  457. map dgg eval fm.cut(dirarg=dict(to=0), narg=quantifier)
  458. map dG eval fm.cut(dirarg=dict(to=-1), narg=quantifier)
  459. map dj eval fm.cut(dirarg=dict(down=1), narg=quantifier)
  460. map dk eval fm.cut(dirarg=dict(up=1), narg=quantifier)
  461. map ygg eval fm.copy(dirarg=dict(to=0), narg=quantifier)
  462. map yG eval fm.copy(dirarg=dict(to=-1), narg=quantifier)
  463. map yj eval fm.copy(dirarg=dict(down=1), narg=quantifier)
  464. map yk eval fm.copy(dirarg=dict(up=1), narg=quantifier)
  465. # Searching
  466. map / console search%space
  467. map n search_next
  468. map N search_next forward=False
  469. map ct search_next order=tag
  470. map cs search_next order=size
  471. map ci search_next order=mimetype
  472. map cc search_next order=ctime
  473. map cm search_next order=mtime
  474. map ca search_next order=atime
  475. # Tabs
  476. map <C-n> tab_new
  477. map gn tab_new
  478. map <C-w> tab_close
  479. # map gc tab_close
  480. map <TAB> tab_move 1
  481. map <A-Right> tab_move 1
  482. # map gt tab_move 1
  483. map <S-TAB> tab_move -1
  484. map <A-Left> tab_move -1
  485. # map gT tab_move -1
  486. map uq tab_restore
  487. map <a-1> tab_open 1
  488. map <a-2> tab_open 2
  489. map <a-3> tab_open 3
  490. map <a-4> tab_open 4
  491. map <a-5> tab_open 5
  492. map <a-6> tab_open 6
  493. map <a-7> tab_open 7
  494. map <a-8> tab_open 8
  495. map <a-9> tab_open 9
  496. map <a-r> tab_shift 1
  497. map <a-l> tab_shift -1
  498. # Sorting
  499. map or set sort_reverse!
  500. map oz set sort=random
  501. map os chain set sort=size; set sort_reverse=False
  502. map ob chain set sort=basename; set sort_reverse=False
  503. map on chain set sort=natural; set sort_reverse=False
  504. map om chain set sort=mtime; set sort_reverse=False
  505. map oc chain set sort=ctime; set sort_reverse=False
  506. map oa chain set sort=atime; set sort_reverse=False
  507. map ot chain set sort=type; set sort_reverse=False
  508. map oe chain set sort=extension; set sort_reverse=False
  509. map oS chain set sort=size; set sort_reverse=True
  510. map oB chain set sort=basename; set sort_reverse=True
  511. map oN chain set sort=natural; set sort_reverse=True
  512. map oM chain set sort=mtime; set sort_reverse=True
  513. map oC chain set sort=ctime; set sort_reverse=True
  514. map oA chain set sort=atime; set sort_reverse=True
  515. map oT chain set sort=type; set sort_reverse=True
  516. map oE chain set sort=extension; set sort_reverse=True
  517. map dc get_cumulative_size
  518. # Settings
  519. map zc set collapse_preview!
  520. map zd set sort_directories_first!
  521. map zh set show_hidden!
  522. map <C-h> set show_hidden!
  523. copymap <C-h> <backspace>
  524. copymap <backspace> <backspace2>
  525. map zI set flushinput!
  526. map zi set preview_images!
  527. map zm set mouse_enabled!
  528. map zp set preview_files!
  529. map zP set preview_directories!
  530. map zs set sort_case_insensitive!
  531. map zu set autoupdate_cumulative_size!
  532. map zv set use_preview_script!
  533. map zf console filter%space
  534. copymap zf zz
  535. # Filter stack
  536. map .d filter_stack add type d
  537. map .f filter_stack add type f
  538. map .l filter_stack add type l
  539. map .m console filter_stack add mime%space
  540. map .n console filter_stack add name%space
  541. map .# console filter_stack add hash%space
  542. map ." filter_stack add duplicate
  543. map .' filter_stack add unique
  544. map .| filter_stack add or
  545. map .& filter_stack add and
  546. map .! filter_stack add not
  547. map .r filter_stack rotate
  548. map .c filter_stack clear
  549. map .* filter_stack decompose
  550. map .p filter_stack pop
  551. map .. filter_stack show
  552. # Bookmarks
  553. map `<any> enter_bookmark %any
  554. map '<any> enter_bookmark %any
  555. map m<any> set_bookmark %any
  556. map um<any> unset_bookmark %any
  557. map m<bg> draw_bookmarks
  558. copymap m<bg> um<bg> `<bg> '<bg>
  559. # Generate all the chmod bindings with some python help:
  560. eval for arg in "rwxXst": cmd("map +u{0} shell -f chmod u+{0} %s".format(arg))
  561. eval for arg in "rwxXst": cmd("map +g{0} shell -f chmod g+{0} %s".format(arg))
  562. eval for arg in "rwxXst": cmd("map +o{0} shell -f chmod o+{0} %s".format(arg))
  563. eval for arg in "rwxXst": cmd("map +a{0} shell -f chmod a+{0} %s".format(arg))
  564. eval for arg in "rwxXst": cmd("map +{0} shell -f chmod u+{0} %s".format(arg))
  565. eval for arg in "rwxXst": cmd("map -u{0} shell -f chmod u-{0} %s".format(arg))
  566. eval for arg in "rwxXst": cmd("map -g{0} shell -f chmod g-{0} %s".format(arg))
  567. eval for arg in "rwxXst": cmd("map -o{0} shell -f chmod o-{0} %s".format(arg))
  568. eval for arg in "rwxXst": cmd("map -a{0} shell -f chmod a-{0} %s".format(arg))
  569. eval for arg in "rwxXst": cmd("map -{0} shell -f chmod u-{0} %s".format(arg))
  570. # ===================================================================
  571. # == Define keys for the console
  572. # ===================================================================
  573. # Note: Unmapped keys are passed directly to the console.
  574. # Basic
  575. cmap <tab> eval fm.ui.console.tab()
  576. cmap <s-tab> eval fm.ui.console.tab(-1)
  577. cmap <ESC> eval fm.ui.console.close()
  578. cmap <CR> eval fm.ui.console.execute()
  579. cmap <C-l> redraw_window
  580. copycmap <ESC> <C-c>
  581. copycmap <CR> <C-j>
  582. # Move around
  583. cmap <up> eval fm.ui.console.history_move(-1)
  584. cmap <down> eval fm.ui.console.history_move(1)
  585. cmap <left> eval fm.ui.console.move(left=1)
  586. cmap <right> eval fm.ui.console.move(right=1)
  587. cmap <home> eval fm.ui.console.move(right=0, absolute=True)
  588. cmap <end> eval fm.ui.console.move(right=-1, absolute=True)
  589. cmap <a-b> eval fm.ui.console.move_word(left=1)
  590. cmap <a-f> eval fm.ui.console.move_word(right=1)
  591. copycmap <a-b> <a-left>
  592. copycmap <a-f> <a-right>
  593. # Line Editing
  594. cmap <backspace> eval fm.ui.console.delete(-1)
  595. cmap <delete> eval fm.ui.console.delete(0)
  596. cmap <C-w> eval fm.ui.console.delete_word()
  597. cmap <A-d> eval fm.ui.console.delete_word(backward=False)
  598. cmap <C-k> eval fm.ui.console.delete_rest(1)
  599. cmap <C-u> eval fm.ui.console.delete_rest(-1)
  600. cmap <C-y> eval fm.ui.console.paste()
  601. # And of course the emacs way
  602. copycmap <ESC> <C-g>
  603. copycmap <up> <C-p>
  604. copycmap <down> <C-n>
  605. copycmap <left> <C-b>
  606. copycmap <right> <C-f>
  607. copycmap <home> <C-a>
  608. copycmap <end> <C-e>
  609. copycmap <delete> <C-d>
  610. copycmap <backspace> <C-h>
  611. # Note: There are multiple ways to express backspaces. <backspace> (code 263)
  612. # and <backspace2> (code 127). To be sure, use both.
  613. copycmap <backspace> <backspace2>
  614. # This special expression allows typing in numerals:
  615. cmap <allow_quantifiers> false
  616. # ===================================================================
  617. # == Pager Keybindings
  618. # ===================================================================
  619. # Movement
  620. pmap <down> pager_move down=1
  621. pmap <up> pager_move up=1
  622. pmap <left> pager_move left=4
  623. pmap <right> pager_move right=4
  624. pmap <home> pager_move to=0
  625. pmap <end> pager_move to=-1
  626. pmap <pagedown> pager_move down=1.0 pages=True
  627. pmap <pageup> pager_move up=1.0 pages=True
  628. pmap <C-d> pager_move down=0.5 pages=True
  629. pmap <C-u> pager_move up=0.5 pages=True
  630. copypmap <UP> k <C-p>
  631. copypmap <DOWN> j <C-n> <CR>
  632. copypmap <LEFT> h
  633. copypmap <RIGHT> l
  634. copypmap <HOME> g
  635. copypmap <END> G
  636. copypmap <C-d> d
  637. copypmap <C-u> u
  638. copypmap <PAGEDOWN> n f <C-F> <Space>
  639. copypmap <PAGEUP> p b <C-B>
  640. # Basic
  641. pmap <C-l> redraw_window
  642. pmap <ESC> pager_close
  643. copypmap <ESC> q Q i <F3>
  644. pmap E edit_file
  645. # ===================================================================
  646. # == Taskview Keybindings
  647. # ===================================================================
  648. # Movement
  649. tmap <up> taskview_move up=1
  650. tmap <down> taskview_move down=1
  651. tmap <home> taskview_move to=0
  652. tmap <end> taskview_move to=-1
  653. tmap <pagedown> taskview_move down=1.0 pages=True
  654. tmap <pageup> taskview_move up=1.0 pages=True
  655. tmap <C-d> taskview_move down=0.5 pages=True
  656. tmap <C-u> taskview_move up=0.5 pages=True
  657. copytmap <UP> k <C-p>
  658. copytmap <DOWN> j <C-n> <CR>
  659. copytmap <HOME> g
  660. copytmap <END> G
  661. copytmap <C-u> u
  662. copytmap <PAGEDOWN> n f <C-F> <Space>
  663. copytmap <PAGEUP> p b <C-B>
  664. # Changing priority and deleting tasks
  665. tmap J eval -q fm.ui.taskview.task_move(-1)
  666. tmap K eval -q fm.ui.taskview.task_move(0)
  667. tmap dd eval -q fm.ui.taskview.task_remove()
  668. tmap <pagedown> eval -q fm.ui.taskview.task_move(-1)
  669. tmap <pageup> eval -q fm.ui.taskview.task_move(0)
  670. tmap <delete> eval -q fm.ui.taskview.task_remove()
  671. # Basic
  672. tmap <C-l> redraw_window
  673. tmap <ESC> taskview_close
  674. copytmap <ESC> q Q w <C-c>
  675. # ===================================================================
  676. # == Plugins
  677. # ===================================================================
  678. # Icons for files
  679. default_linemode devicons
  680. # default_linemode unicode_icons
  681. # ===================================================================
  682. # == Archive
  683. # ===================================================================
  684. map Cz shell zip -9 -r %f.zip %s
  685. map Xz shell unzip %s
  686. map Ct shell tar -czf %f.tar.gz %s
  687. map Xt shell tar -xzf %s
  688. # ===================================================================
  689. # == Mount/Unmount windows disks: /dev/sda1 (C) and /dev/sda2 (D)
  690. # ===================================================================
  691. # map wmc shell udisksctl mount -b /dev/sda1
  692. # map wmd shell udisksctl mount -b /dev/sda2
  693. # map wuc shell udisksctl unmount -b /dev/sda1
  694. # map wud shell udisksctl unmount -b /dev/sda2
  695. map Mc shell ~/.myScripts/winC_mount.sh
  696. map Md shell ~/.myScripts/winD_mount.sh
  697. map Uc shell ~/.myScripts/winC_unmount.sh
  698. map Ud shell ~/.myScripts/winD_unmount.sh