dotfiles

My personal shell configs and stuff
git clone git://git.alex.balgavy.eu/dotfiles.git
Log | Files | Refs | Submodules | README | LICENSE

rc.conf (18786B)


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