rc.conf 24 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762
  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 w3m
  103. set preview_images_method ueberzug
  104. # Delay in seconds before displaying an image with the w3m method.
  105. # Increase it in case of experiencing display corruption.
  106. set w3m_delay 0.02
  107. # Manually adjust the w3mimg offset when using a terminal which needs this
  108. set w3m_offset 0
  109. # Default iTerm2 font size (see: preview_images_method: iterm2)
  110. set iterm2_font_width 8
  111. set iterm2_font_height 11
  112. # Use a unicode "..." character to mark cut-off filenames?
  113. set unicode_ellipsis false
  114. # BIDI support - try to properly display file names in RTL languages (Hebrew, Arabic).
  115. # Requires the python-bidi pip package
  116. set bidi_support false
  117. # Show dotfiles in the bookmark preview box?
  118. set show_hidden_bookmarks true
  119. # Which colorscheme to use? These colorschemes are available by default:
  120. # default, jungle, snow, solarized
  121. set colorscheme default
  122. # Preview files on the rightmost column?
  123. # And collapse (shrink) the last column if there is nothing to preview?
  124. set preview_files true
  125. set preview_directories true
  126. set collapse_preview true
  127. # Wrap long lines in plain text previews?
  128. set wrap_plaintext_previews false
  129. # Save the console history on exit?
  130. set save_console_history true
  131. # Draw the status bar on top of the browser window (default: bottom)
  132. set status_bar_on_top false
  133. # Draw a progress bar in the status bar which displays the average state of all
  134. # currently running tasks which support progress bars?
  135. set draw_progress_bar_in_status_bar true
  136. # Draw borders around columns? (separators, outline, both, or none)
  137. # Separators are vertical lines between columns.
  138. # Outline draws a box around all the columns.
  139. # Both combines the two.
  140. set draw_borders both
  141. # Display the directory name in tabs?
  142. set dirname_in_tabs false
  143. # Enable the mouse support?
  144. set mouse_enabled true
  145. # Display the file size in the main column or status bar?
  146. set display_size_in_main_column true
  147. set display_size_in_status_bar true
  148. # Display the free disk space in the status bar?
  149. set display_free_space_in_status_bar true
  150. # Display files tags in all columns or only in main column?
  151. set display_tags_in_all_columns true
  152. # Set a title for the window? Updates both `WM_NAME` and `WM_ICON_NAME`
  153. set update_title false
  154. # Set the tmux/screen window-name to "ranger"?
  155. set update_tmux_title true
  156. # Shorten the title if it gets long? The number defines how many
  157. # directories are displayed at once, 0 turns off this feature.
  158. set shorten_title 3
  159. # Show hostname in titlebar?
  160. set hostname_in_titlebar true
  161. # Abbreviate $HOME with ~ in the titlebar (first line) of ranger?
  162. set tilde_in_titlebar false
  163. # How many directory-changes or console-commands should be kept in history?
  164. set max_history_size 20
  165. set max_console_history_size 50
  166. # Try to keep so much space between the top/bottom border when scrolling:
  167. set scroll_offset 8
  168. # Flush the input after each key hit? (Noticeable when ranger lags)
  169. set flushinput true
  170. # Padding on the right when there's no preview?
  171. # This allows you to click into the space to run the file.
  172. set padding_right true
  173. # Save bookmarks (used with mX and `X) instantly?
  174. # This helps to synchronize bookmarks between multiple ranger
  175. # instances but leads to *slight* performance loss.
  176. # When false, bookmarks are saved when ranger is exited.
  177. set autosave_bookmarks true
  178. # Save the "`" bookmark to disk. This can be used to switch to the last
  179. # directory by typing "``".
  180. set save_backtick_bookmark true
  181. # You can display the "real" cumulative size of directories by using the
  182. # command :get_cumulative_size or typing "dc". The size is expensive to
  183. # calculate and will not be updated automatically. You can choose
  184. # to update it automatically though by turning on this option:
  185. set autoupdate_cumulative_size false
  186. # Turning this on makes sense for screen readers:
  187. set show_cursor false
  188. # One of: size, natural, basename, atime, ctime, mtime, type, random
  189. set sort natural
  190. # Additional sorting options
  191. set sort_reverse false
  192. set sort_case_insensitive true
  193. set sort_directories_first true
  194. set sort_unicode false
  195. # Enable this if key combinations with the Alt Key don't work for you.
  196. # (Especially on xterm)
  197. set xterm_alt_key false
  198. # Whether to include bookmarks in cd command
  199. set cd_bookmarks true
  200. # Changes case sensitivity for the cd command tab completion
  201. set cd_tab_case sensitive
  202. # Use fuzzy tab completion with the "cd" command. For example,
  203. # ":cd /u/lo/b<tab>" expands to ":cd /usr/local/bin".
  204. set cd_tab_fuzzy false
  205. # Avoid previewing files larger than this size, in bytes. Use a value of 0 to
  206. # disable this feature.
  207. set preview_max_size 0
  208. # The key hint lists up to this size have their sublists expanded.
  209. # Otherwise the submaps are replaced with "...".
  210. set hint_collapse_threshold 10
  211. # Add the highlighted file to the path in the titlebar
  212. set show_selection_in_titlebar true
  213. # The delay that ranger idly waits for user input, in milliseconds, with a
  214. # resolution of 100ms. Lower delay reduces lag between directory updates but
  215. # increases CPU load.
  216. set idle_delay 2000
  217. # When the metadata manager module looks for metadata, should it only look for
  218. # a ".metadata.json" file in the current directory, or do a deep search and
  219. # check all directories above the current one as well?
  220. set metadata_deep_search false
  221. # Clear all existing filters when leaving a directory
  222. set clear_filters_on_dir_change false
  223. # Disable displaying line numbers in main column.
  224. # Possible values: false, absolute, relative.
  225. set line_numbers relative
  226. # When line_numbers=relative show the absolute line number in the
  227. # current line.
  228. set relative_current_zero false
  229. # Start line numbers from 1 instead of 0
  230. set one_indexed true
  231. # Save tabs on exit
  232. set save_tabs_on_exit false
  233. # Enable scroll wrapping - moving down while on the last item will wrap around to
  234. # the top and vice versa.
  235. set wrap_scroll false
  236. # Set the global_inode_type_filter to nothing. Possible options: d, f and l for
  237. # directories, files and symlinks respectively.
  238. set global_inode_type_filter
  239. # This setting allows to freeze the list of files to save I/O bandwidth. It
  240. # should be 'false' during start-up, but you can toggle it by pressing F.
  241. set freeze_files false
  242. # Print file sizes in bytes instead of the default human-readable format.
  243. set size_in_bytes false
  244. # Warn at startup if RANGER_LEVEL env var is greater than 0, in other words
  245. # give a warning when you nest ranger in a subshell started by ranger.
  246. # Special value "error" makes the warning more visible.
  247. set nested_ranger_warning true
  248. # ===================================================================
  249. # == Local Options
  250. # ===================================================================
  251. # You can set local options that only affect a single directory.
  252. # Examples:
  253. # setlocal path=~/downloads sort mtime
  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%space
  296. map @ console -p6 shell %%s
  297. map # console shell -p%space
  298. map s console shell%space
  299. map r chain draw_possible_programs; console open_with%space
  300. map f console find%space
  301. map cd console cd%space
  302. map <C-p> chain console; eval fm.ui.console.history_move(-1)
  303. # Change the line mode
  304. map Mf linemode filename
  305. map Mi linemode fileinfo
  306. map Mm linemode mtime
  307. map Mh linemode humanreadablemtime
  308. map Mp linemode permissions
  309. map Ms linemode sizemtime
  310. map MH linemode sizehumanreadablemtime
  311. map Mt linemode metatitle
  312. # Tagging / Marking
  313. map t tag_toggle
  314. map ut tag_remove
  315. map "<any> tag_toggle tag=%any
  316. map <Space> mark_files toggle=True
  317. map v mark_files all=True toggle=True
  318. map uv mark_files all=True val=False
  319. map V toggle_visual_mode
  320. map uV toggle_visual_mode reverse=True
  321. # For the nostalgics: Midnight Commander bindings
  322. map <F1> help
  323. map <F2> rename_append
  324. map <F3> display_file
  325. map <F4> edit
  326. map <F5> copy
  327. map <F6> cut
  328. map <F7> console mkdir%space
  329. map <F8> console delete
  330. #map <F8> console trash
  331. map <F10> exit
  332. # In case you work on a keyboard with dvorak layout
  333. map <UP> move up=1
  334. map <DOWN> move down=1
  335. map <LEFT> move left=1
  336. map <RIGHT> move right=1
  337. map <HOME> move to=0
  338. map <END> move to=-1
  339. map <PAGEDOWN> move down=1 pages=True
  340. map <PAGEUP> move up=1 pages=True
  341. map <CR> move right=1
  342. #map <DELETE> console delete
  343. map <INSERT> console touch%space
  344. # VIM-like
  345. copymap <UP> k
  346. copymap <DOWN> j
  347. copymap <LEFT> h
  348. copymap <RIGHT> l
  349. copymap <HOME> gg
  350. copymap <END> G
  351. copymap <PAGEDOWN> <C-F>
  352. copymap <PAGEUP> <C-B>
  353. map J move down=0.5 pages=True
  354. map K move up=0.5 pages=True
  355. copymap J <C-D>
  356. copymap K <C-U>
  357. # Jumping around
  358. map H history_go -1
  359. map L history_go 1
  360. map ] move_parent 1
  361. map [ move_parent -1
  362. map } traverse
  363. map { traverse_backwards
  364. map ) jump_non
  365. map gh cd ~
  366. map ge cd /etc
  367. map gu cd /usr
  368. map gd cd /dev
  369. map gl cd -r .
  370. map gL cd -r %f
  371. map go cd /opt
  372. map gv cd /var
  373. map gm cd /media
  374. map gi eval fm.cd('/run/media/' + os.getenv('USER'))
  375. map gM cd /mnt
  376. map gs cd /srv
  377. map gp cd /tmp
  378. map gr cd /
  379. map gR eval fm.cd(ranger.RANGERDIR)
  380. map g/ cd /
  381. map g? cd /usr/share/doc/ranger
  382. # External Programs
  383. map E edit
  384. map du shell -p du --max-depth=1 -h --apparent-size
  385. map dU shell -p du --max-depth=1 -h --apparent-size | sort -rh
  386. map yp yank path
  387. map yd yank dir
  388. map yn yank name
  389. map y. yank name_without_extension
  390. # Filesystem Operations
  391. map = chmod
  392. map cw console rename%space
  393. map a rename_append
  394. map A eval fm.open_console('rename ' + fm.thisfile.relative_path.replace("%", "%%"))
  395. map I eval fm.open_console('rename ' + fm.thisfile.relative_path.replace("%", "%%"), position=7)
  396. map pp paste
  397. map po paste overwrite=True
  398. map pP paste append=True
  399. map pO paste overwrite=True append=True
  400. map pl paste_symlink relative=False
  401. map pL paste_symlink relative=True
  402. map phl paste_hardlink
  403. map pht paste_hardlinked_subtree
  404. map pd console paste dest=
  405. map p`<any> paste dest=%any_path
  406. map p'<any> paste dest=%any_path
  407. map dD console delete
  408. map dT console trash
  409. map dd cut
  410. map ud uncut
  411. map da cut mode=add
  412. map dr cut mode=remove
  413. map dt cut mode=toggle
  414. map yy copy
  415. map uy uncut
  416. map ya copy mode=add
  417. map yr copy mode=remove
  418. map yt copy mode=toggle
  419. # Temporary workarounds
  420. map dgg eval fm.cut(dirarg=dict(to=0), narg=quantifier)
  421. map dG eval fm.cut(dirarg=dict(to=-1), narg=quantifier)
  422. map dj eval fm.cut(dirarg=dict(down=1), narg=quantifier)
  423. map dk eval fm.cut(dirarg=dict(up=1), narg=quantifier)
  424. map ygg eval fm.copy(dirarg=dict(to=0), narg=quantifier)
  425. map yG eval fm.copy(dirarg=dict(to=-1), narg=quantifier)
  426. map yj eval fm.copy(dirarg=dict(down=1), narg=quantifier)
  427. map yk eval fm.copy(dirarg=dict(up=1), narg=quantifier)
  428. # Searching
  429. map / console search%space
  430. map n search_next
  431. map N search_next forward=False
  432. map ct search_next order=tag
  433. map cs search_next order=size
  434. map ci search_next order=mimetype
  435. map cc search_next order=ctime
  436. map cm search_next order=mtime
  437. map ca search_next order=atime
  438. # Tabs
  439. map <C-n> tab_new
  440. map <C-w> tab_close
  441. map <TAB> tab_move 1
  442. map <S-TAB> tab_move -1
  443. map <A-Right> tab_move 1
  444. map <A-Left> tab_move -1
  445. map gt tab_move 1
  446. map gT tab_move -1
  447. map gn tab_new
  448. map gc tab_close
  449. map uq tab_restore
  450. map <a-1> tab_open 1
  451. map <a-2> tab_open 2
  452. map <a-3> tab_open 3
  453. map <a-4> tab_open 4
  454. map <a-5> tab_open 5
  455. map <a-6> tab_open 6
  456. map <a-7> tab_open 7
  457. map <a-8> tab_open 8
  458. map <a-9> tab_open 9
  459. map <a-r> tab_shift 1
  460. map <a-l> tab_shift -1
  461. # Sorting
  462. map or set sort_reverse!
  463. map oz set sort=random
  464. map os chain set sort=size; set sort_reverse=False
  465. map ob chain set sort=basename; set sort_reverse=False
  466. map on chain set sort=natural; set sort_reverse=False
  467. map om chain set sort=mtime; set sort_reverse=False
  468. map oc chain set sort=ctime; set sort_reverse=False
  469. map oa chain set sort=atime; set sort_reverse=False
  470. map ot chain set sort=type; set sort_reverse=False
  471. map oe chain set sort=extension; set sort_reverse=False
  472. map oS chain set sort=size; set sort_reverse=True
  473. map oB chain set sort=basename; set sort_reverse=True
  474. map oN chain set sort=natural; set sort_reverse=True
  475. map oM chain set sort=mtime; set sort_reverse=True
  476. map oC chain set sort=ctime; set sort_reverse=True
  477. map oA chain set sort=atime; set sort_reverse=True
  478. map oT chain set sort=type; set sort_reverse=True
  479. map oE chain set sort=extension; set sort_reverse=True
  480. map dc get_cumulative_size
  481. # Settings
  482. map zc set collapse_preview!
  483. map zd set sort_directories_first!
  484. map zh set show_hidden!
  485. map <C-h> set show_hidden!
  486. copymap <C-h> <backspace>
  487. copymap <backspace> <backspace2>
  488. map zI set flushinput!
  489. map zi set preview_images!
  490. map zm set mouse_enabled!
  491. map zp set preview_files!
  492. map zP set preview_directories!
  493. map zs set sort_case_insensitive!
  494. map zu set autoupdate_cumulative_size!
  495. map zv set use_preview_script!
  496. map zf console filter%space
  497. copymap zf zz
  498. # Filter stack
  499. map .d filter_stack add type d
  500. map .f filter_stack add type f
  501. map .l filter_stack add type l
  502. map .m console filter_stack add mime%space
  503. map .n console filter_stack add name%space
  504. map .# console filter_stack add hash%space
  505. map ." filter_stack add duplicate
  506. map .' filter_stack add unique
  507. map .| filter_stack add or
  508. map .& filter_stack add and
  509. map .! filter_stack add not
  510. map .r filter_stack rotate
  511. map .c filter_stack clear
  512. map .* filter_stack decompose
  513. map .p filter_stack pop
  514. map .. filter_stack show
  515. # Bookmarks
  516. map `<any> enter_bookmark %any
  517. map '<any> enter_bookmark %any
  518. map m<any> set_bookmark %any
  519. map um<any> unset_bookmark %any
  520. map m<bg> draw_bookmarks
  521. copymap m<bg> um<bg> `<bg> '<bg>
  522. # Generate all the chmod bindings with some python help:
  523. eval for arg in "rwxXst": cmd("map +u{0} shell -f chmod u+{0} %s".format(arg))
  524. eval for arg in "rwxXst": cmd("map +g{0} shell -f chmod g+{0} %s".format(arg))
  525. eval for arg in "rwxXst": cmd("map +o{0} shell -f chmod o+{0} %s".format(arg))
  526. eval for arg in "rwxXst": cmd("map +a{0} shell -f chmod a+{0} %s".format(arg))
  527. eval for arg in "rwxXst": cmd("map +{0} shell -f chmod u+{0} %s".format(arg))
  528. eval for arg in "rwxXst": cmd("map -u{0} shell -f chmod u-{0} %s".format(arg))
  529. eval for arg in "rwxXst": cmd("map -g{0} shell -f chmod g-{0} %s".format(arg))
  530. eval for arg in "rwxXst": cmd("map -o{0} shell -f chmod o-{0} %s".format(arg))
  531. eval for arg in "rwxXst": cmd("map -a{0} shell -f chmod a-{0} %s".format(arg))
  532. eval for arg in "rwxXst": cmd("map -{0} shell -f chmod u-{0} %s".format(arg))
  533. # ===================================================================
  534. # == Define keys for the console
  535. # ===================================================================
  536. # Note: Unmapped keys are passed directly to the console.
  537. # Basic
  538. cmap <tab> eval fm.ui.console.tab()
  539. cmap <s-tab> eval fm.ui.console.tab(-1)
  540. cmap <ESC> eval fm.ui.console.close()
  541. cmap <CR> eval fm.ui.console.execute()
  542. cmap <C-l> redraw_window
  543. copycmap <ESC> <C-c>
  544. copycmap <CR> <C-j>
  545. # Move around
  546. cmap <up> eval fm.ui.console.history_move(-1)
  547. cmap <down> eval fm.ui.console.history_move(1)
  548. cmap <left> eval fm.ui.console.move(left=1)
  549. cmap <right> eval fm.ui.console.move(right=1)
  550. cmap <home> eval fm.ui.console.move(right=0, absolute=True)
  551. cmap <end> eval fm.ui.console.move(right=-1, absolute=True)
  552. cmap <a-b> eval fm.ui.console.move_word(left=1)
  553. cmap <a-f> eval fm.ui.console.move_word(right=1)
  554. copycmap <a-b> <a-left>
  555. copycmap <a-f> <a-right>
  556. # Line Editing
  557. cmap <backspace> eval fm.ui.console.delete(-1)
  558. cmap <delete> eval fm.ui.console.delete(0)
  559. cmap <C-w> eval fm.ui.console.delete_word()
  560. cmap <A-d> eval fm.ui.console.delete_word(backward=False)
  561. cmap <C-k> eval fm.ui.console.delete_rest(1)
  562. cmap <C-u> eval fm.ui.console.delete_rest(-1)
  563. cmap <C-y> eval fm.ui.console.paste()
  564. # And of course the emacs way
  565. copycmap <ESC> <C-g>
  566. copycmap <up> <C-p>
  567. copycmap <down> <C-n>
  568. copycmap <left> <C-b>
  569. copycmap <right> <C-f>
  570. copycmap <home> <C-a>
  571. copycmap <end> <C-e>
  572. copycmap <delete> <C-d>
  573. copycmap <backspace> <C-h>
  574. # Note: There are multiple ways to express backspaces. <backspace> (code 263)
  575. # and <backspace2> (code 127). To be sure, use both.
  576. copycmap <backspace> <backspace2>
  577. # This special expression allows typing in numerals:
  578. cmap <allow_quantifiers> false
  579. # ===================================================================
  580. # == Pager Keybindings
  581. # ===================================================================
  582. # Movement
  583. pmap <down> pager_move down=1
  584. pmap <up> pager_move up=1
  585. pmap <left> pager_move left=4
  586. pmap <right> pager_move right=4
  587. pmap <home> pager_move to=0
  588. pmap <end> pager_move to=-1
  589. pmap <pagedown> pager_move down=1.0 pages=True
  590. pmap <pageup> pager_move up=1.0 pages=True
  591. pmap <C-d> pager_move down=0.5 pages=True
  592. pmap <C-u> pager_move up=0.5 pages=True
  593. copypmap <UP> k <C-p>
  594. copypmap <DOWN> j <C-n> <CR>
  595. copypmap <LEFT> h
  596. copypmap <RIGHT> l
  597. copypmap <HOME> g
  598. copypmap <END> G
  599. copypmap <C-d> d
  600. copypmap <C-u> u
  601. copypmap <PAGEDOWN> n f <C-F> <Space>
  602. copypmap <PAGEUP> p b <C-B>
  603. # Basic
  604. pmap <C-l> redraw_window
  605. pmap <ESC> pager_close
  606. copypmap <ESC> q Q i <F3>
  607. pmap E edit_file
  608. # ===================================================================
  609. # == Taskview Keybindings
  610. # ===================================================================
  611. # Movement
  612. tmap <up> taskview_move up=1
  613. tmap <down> taskview_move down=1
  614. tmap <home> taskview_move to=0
  615. tmap <end> taskview_move to=-1
  616. tmap <pagedown> taskview_move down=1.0 pages=True
  617. tmap <pageup> taskview_move up=1.0 pages=True
  618. tmap <C-d> taskview_move down=0.5 pages=True
  619. tmap <C-u> taskview_move up=0.5 pages=True
  620. copytmap <UP> k <C-p>
  621. copytmap <DOWN> j <C-n> <CR>
  622. copytmap <HOME> g
  623. copytmap <END> G
  624. copytmap <C-u> u
  625. copytmap <PAGEDOWN> n f <C-F> <Space>
  626. copytmap <PAGEUP> p b <C-B>
  627. # Changing priority and deleting tasks
  628. tmap J eval -q fm.ui.taskview.task_move(-1)
  629. tmap K eval -q fm.ui.taskview.task_move(0)
  630. tmap dd eval -q fm.ui.taskview.task_remove()
  631. tmap <pagedown> eval -q fm.ui.taskview.task_move(-1)
  632. tmap <pageup> eval -q fm.ui.taskview.task_move(0)
  633. tmap <delete> eval -q fm.ui.taskview.task_remove()
  634. # Basic
  635. tmap <C-l> redraw_window
  636. tmap <ESC> taskview_close
  637. copytmap <ESC> q Q w <C-c>
  638. default_linemode devicons