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