| 1 |
# $LastChangedDate: 2024-05-15 01:34:42 +0200 (Wed, 15 May 2024) $ |
| 2 |
# Contents of the default 'fimrc' file, hardcoded in the fim executable. |
| 3 |
# Read the documentation (man fimrc) to discover how to change this default hardcoded file and how to make your own. |
| 4 |
# Note that usually a ~/.fimrc file is read after these options take effect, so you could reset all of this with ease. |
| 5 |
# Lines beginning with a pound (#) are ignored by fim (they are treated as comments). |
| 6 |
# |
| 7 |
# Internal variables. |
| 8 |
# Some of these variables influence fim's behaviour (input variables), some are set by fim (output variables). |
| 9 |
# It is wise the input variables are set at the beginning of the file, so the bottom may issue commands correctly affected by them. |
| 10 |
if(_cache_control==''){_cache_control='m';} |
| 11 |
if(_debug_commands==''){_debug_commands='';} |
| 12 |
if(_command_expansion==''){_command_expansion=1;} |
| 13 |
if(_display_status==''){_display_status=0;} |
| 14 |
if(_max_cached_images==''){_max_cached_images=5;} |
| 15 |
if(_min_cached_images==''){_min_cached_images=4;} |
| 16 |
if(_max_cached_memory==''){_max_cached_memory=81920;} |
| 17 |
if(_max_iterated_commands==''){_max_iterated_commands=100;} |
| 18 |
if(_want_prefetch==''){_want_prefetch=1;} |
| 19 |
if(_no_external_loader_programs==''){_no_external_loader_programs=0;} |
| 20 |
if(_scale_style==''){_scale_style='b';} |
| 21 |
if(_save_fim_history==''){_save_fim_history=1;} |
| 22 |
if(_load_fim_history==''){_load_fim_history=1;} |
| 23 |
if(_verbose_keys==''){_verbose_keys=0;} |
| 24 |
if(_display_busy==''){_display_busy=1;} |
| 25 |
if(_ignorecase==''){_ignorecase=1;} |
| 26 |
if(_re_search_opts==''){_re_search_opts='biD';} |
| 27 |
if(_console_offset==''){_console_offset=0;} |
| 28 |
if(_console_key==''){_console_key=58;} |
| 29 |
if(_display_as_binary==''){_display_as_binary=0;} |
| 30 |
if(_push_checks==''){_push_checks=1;} |
| 31 |
#if(_want_wm_caption_status==''){_want_wm_caption_status=0;} |
| 32 |
if(_want_exif_orientation==''){_want_exif_orientation=1;} |
| 33 |
if(ascale==''){ascale="1.0";} |
| 34 |
if(_use_mipmaps==''){_use_mipmaps=1;} |
| 35 |
if(_downscale_huge_at_load==''){_downscale_huge_at_load=1;} |
| 36 |
if(_scroll_skip_page_fraction==''){_scroll_skip_page_fraction=0;} |
| 37 |
if(_want_wm_mouse_ctrl==''){_want_wm_mouse_ctrl="'pP+a-=nN";} |
| 38 |
if(_slideshow_sleep_time==''){_slideshow_sleep_time=1;} |
| 39 |
# |
| 40 |
# External variables (not used internally). |
| 41 |
if(allow_round_scroll==''){allow_round_scroll=0;} |
| 42 |
if(console_scroll_n==''){console_scroll_n=3;} |
| 43 |
# |
| 44 |
alias "toggleautoflip" "_autoflip=1-_autoflip" ""; |
| 45 |
alias "toggleautonegate" "_autonegate=1-_autonegate" ""; |
| 46 |
alias "toggleflip" "i:flipped=1-i:flipped" "toggles flipped property on the current image"; |
| 47 |
alias "flip" "toggleflip;redisplay" "flip the current image along the horizontal axis"; |
| 48 |
alias "fliponce" "flip;toggleflip" "flip, but just for one display"; |
| 49 |
alias "toggleautomirror" "_automirror=1-_automirror" ""; |
| 50 |
alias "togglemirror" "i:mirrored=1-i:mirrored" "toggles mirrored property on the current image"; |
| 51 |
alias "mirror" "togglemirror;redisplay" "mirror the image along the vertical axis" ""; |
| 52 |
alias "mirroronce" "mirror;togglemirror" "mirror, but just for one display"; |
| 53 |
alias 'toggleLimitMarked' '__pre_limit_fileindex=_fileindex;_limit_mode=1-_limit_mode; if(_limit_mode==1){limit "!";} else { limit; } if(_filelistlen<1){_limit_mode=0;limit;goto __pre_limit_fileindex;} i:fresh=1;redisplay; ' "toggle between limiting file list to the marked files and the full list"; |
| 54 |
alias "unlimit" "limit;i:fresh=1;reload;redisplay" "calling limit with no arguments restores the original list"; |
| 55 |
#alias 'mark_current_file' '_markedfile=i:_filename'; |
| 56 |
#alias 'goto_marked_file' 'goto "?"._markedfile'; |
| 57 |
alias 'mark_current_file' '_markedfile=_fileindex'; # Note: temporary; _markedfile undocumented. |
| 58 |
alias 'goto_marked_file' 'goto _markedfile'; # Note: temporary. |
| 59 |
# Warning : binding to C-s, C-z and C-c won't make effect, as these |
| 60 |
# codes are get caught by the console driver and will have no effect in fim. |
| 61 |
# Moreover, C-z will crash fim and C-c will terminate it. |
| 62 |
# Some other combinations (e.g.:C-l) may have similar problems in your console. |
| 63 |
bind 'f' "flip"; |
| 64 |
bind 'F' "fliponce"; |
| 65 |
bind 'm' "mirror"; |
| 66 |
bind 'M' "mirroronce"; |
| 67 |
bind 'q' "quit"; |
| 68 |
bind 'Esc' "quit"; |
| 69 |
#bind 'n' "next_file"; |
| 70 |
#bind 'n' "next"; |
| 71 |
bind 'C-h' "help"; |
| 72 |
#bind '?' "help"; # assigned to back-search |
| 73 |
#bind '/' "help"; # assigned to forward-search |
| 74 |
bind '=' "scale '100%'"; |
| 75 |
#bind 'p' "prev_file"; |
| 76 |
#alias 'list_remove_and_reload' "list 'remove';reload"; # once menus commands can support ;, remove this |
| 77 |
bind 'Del' "list 'remove';reload"; # no quit on last file |
| 78 |
#bind 'Del' "list_remove_and_reload"; # no quit on last file |
| 79 |
#bind 'Del' "if(_filelistlen<2)quit;list 'remove';reload;"; # quit if no files left |
| 80 |
#bind 's' "list 'sort'"; |
| 81 |
bind ' ' "scroll 'forward'"; |
| 82 |
###bind 'C-s' "swap;redisplay"; |
| 83 |
bind 'S' "toggleDisplayStatus"; |
| 84 |
bind 'I' "toggleautonegate"; |
| 85 |
bind 'i' "color 'negate';redisplay"; |
| 86 |
bind 'g' "color 'desaturate';redisplay"; |
| 87 |
###bind '[' "color 'colorblind' ; redisplay"; |
| 88 |
###bind ']' "color 'colorblind' 'daltonize'; redisplay"; |
| 89 |
bind '[' 'font_reduce;redisplay'; |
| 90 |
bind ']' 'font_magnify;redisplay'; |
| 91 |
bind '|' 'toggle_font_auto_scale;redisplay'; |
| 92 |
bind '{' 'font "prev";redisplay'; |
| 93 |
bind '}' 'font "next";redisplay'; |
| 94 |
bind 'G' "toggleDesaturate"; |
| 95 |
####bind 'R' "reload"; |
| 96 |
####bind 'R' "redisplay"; |
| 97 |
bind 'r' "rotate90"; |
| 98 |
bind 'R' "rotate270"; |
| 99 |
####bind 'R' "rotate10;display"; |
| 100 |
####bind 'r' "rotate10_ccw;display"; |
| 101 |
####bind 'r' "reload"; |
| 102 |
###bind 'C-d' "display"; |
| 103 |
bind '+' "magnify"; |
| 104 |
####bind 'C-+' "angle=angle+10.0;display"; |
| 105 |
bind 'a' "scale 'a'"; |
| 106 |
bind 'H' "scale 'H'"; |
| 107 |
bind 'Tab' "toggleVerbosity"; |
| 108 |
bind 'Menu' "toggleVerbosity"; |
| 109 |
####bind 'C-k' "_want_wm_caption_status=1-_want_wm_caption_status;status ' '"; |
| 110 |
bind 'v' "toggleDisplayStatus"; |
| 111 |
bind 'A' "A"; |
| 112 |
#bind 'C-m' "list 'mark'"; |
| 113 |
bind 'C-m' "mark_current_file"; |
| 114 |
bind 'C-j' "goto_marked_file"; |
| 115 |
bind 'u' "list 'unmark'"; |
| 116 |
####bind 'Enter' "list 'mark';next"; |
| 117 |
bind 'Enter' "list 'mark';goto _lastgotodirection"; |
| 118 |
bind '-' "reduce"; |
| 119 |
bind "Up" "pan_up"; |
| 120 |
bind 'k' "pan_up"; |
| 121 |
###bind 'k' "pan 'up-'"; |
| 122 |
####bind 'C-k' "pan_up"; |
| 123 |
bind "Right" "pan_right"; |
| 124 |
bind 'l' "pan_right"; |
| 125 |
bind "Down" "pan_down"; |
| 126 |
bind 'j' "pan_down"; |
| 127 |
###bind 'j' "pan 'down+'"; |
| 128 |
bind "Left" "pan_left"; |
| 129 |
bind 'h' "pan_left"; |
| 130 |
####bind ' ' "scroll 'down'"; |
| 131 |
bind 't' "align 'top'"; |
| 132 |
bind 'C-g' "system 'fbgrab' 'fim_'._device_string.'.png'"; # grab a screenshot |
| 133 |
#bind 'C-r' "recording 'start'"; |
| 134 |
bind 'C-r' "reload ''"; |
| 135 |
bind 'Q' "recording 'stop'"; |
| 136 |
bind 'D' "recording 'dump'"; |
| 137 |
bind 'E' "recording 'execute'"; |
| 138 |
bind 'C-e' "recording 'execute'"; |
| 139 |
bind 'C-x' "recording 'execute'"; |
| 140 |
bind '.' "recording 'repeat_last'"; |
| 141 |
bind '`' "toggleLimitMarked"; |
| 142 |
alias "toggleVerbosity" "_display_console=1-_display_console;i:fresh=1;redisplay" ""; |
| 143 |
alias "toggleKeyVerbosity" "_verbose_keys=1-_verbose_keys;redisplay" ""; |
| 144 |
alias "toggleDesaturate" "_autodesaturate=1-_autodesaturate;redisplay" ""; |
| 145 |
alias "idempotent_cmd" "goto ''"; |
| 146 |
# |
| 147 |
# Autocommands examples: |
| 148 |
#autocmd "PostInteractiveCommand" "fim.png" "echo '\\nmatched an interactive command on fim.png\\n'"; |
| 149 |
#autocmd "PostDisplay" ".*png" "echo 'this is a png file'"; |
| 150 |
#autocmd "PostDisplay" ".*jpg" "echo 'this is a jpg file'"; |
| 151 |
###autocmd "PostDisplay" ".*gif" "echo 'this is a gif file'"; |
| 152 |
#autocmd "PostDisplay" "" "echo '\\nthis is a file\\n'"; |
| 153 |
#autocmd "PostGoto" "" "set_interactive_mode"; |
| 154 |
autocmd "PostGoto" "" "reload"; |
| 155 |
###autocmd "PostGoto" "" "load"; |
| 156 |
###autocmd "PostDisplay" "" "i:fresh=1" ; |
| 157 |
###autocmd "PreWindow" "" ""; |
| 158 |
autocmd "PostWindow" "" "i:fresh=1;redisplay;"; |
| 159 |
autocmd "PreRedisplay" "" "i:_will_display=1"; |
| 160 |
autocmd "PreRedisplay" "" "if(_scale_style!='' && i:fresh){i:fresh=0;scale _scale_style ;i:fresh=0;}"; |
| 161 |
autocmd "PostRedisplay" "" "i:_will_display=0"; |
| 162 |
# Display device specific config |
| 163 |
alias "aalib_fix_do" "{if(aascale==''){ascale='2.0';}else{ascale=aascale;} i:fresh=1;display;if(_TERM=~'screen'){echo 'Detected screen+aalib: key bindings may not work as intended.'}}" "See aalib_fix."; |
| 164 |
alias "aalib_fix" "if(_device_string=~'^aa'){aalib_fix_do;scale 'a';}" "When using the aalib (ASCII art) library we face a problem: glyph proportions are seldom square (as pixels are), and are tricky to detect; for this reason, we need to reshape the image with respect to the font ratio, but we have to make a guess in the scaling factor to compensate. If at runtime a better value is known for the terminal font height/with ratio, it may be fed in the 'aascale' variable for an accurate scaling."; |
| 165 |
alias "cacalib_fix_do" "{if(cacascale==''){ascale='1.18';}else{scale=cacascale;} i:fresh=1;display;if(_TERM=~'screen'){echo 'Detected screen+cacalib: key bindings may not work as intended.'}}" "See cacalib_fix."; |
| 166 |
alias "cacalib_fix" "getenv 'DISPLAY';if(_device_string=~'^ca' && ENV_DISPLAY==''){cacalib_fix_do;scale 'a';}" "When using the libcaca (Coloured ASCII art) library we face a problem: glyph proportions are seldom square (as pixels are), and are tricky to detect; for this reason, we need to reshape the image with respect to the font ratio, but we have to make a guess in the scaling factor to compensate. If at runtime a better value is known for the terminal font height/with ratio, it may be fed in the 'cacascale' variable for an accurate scaling."; |
| 167 |
###alias "exif_fix" "i:_orientation=exif_orientation;exif_orientation='';i:mirrored=exif_mirrored;exif_mirrored='';i:flipped=exif_flipped;exif_flipped=''" ""; |
| 168 |
###autocmd "PostReload" "" "aalib_fix;exif_fix"; |
| 169 |
###autocmd "PostLoad" "" "aalib_fix;exif_fix"; |
| 170 |
autocmd "PostReload" "" "aalib_fix"; |
| 171 |
autocmd "PostLoad" "" "aalib_fix"; |
| 172 |
autocmd "PostReload" "" "cacalib_fix"; |
| 173 |
autocmd "PostLoad" "" "cacalib_fix"; |
| 174 |
alias "refresh" "desc 'reload';redisplay;" "reloads and displays image description"; |
| 175 |
bind "F5" "refresh"; |
| 176 |
alias "toggle_fullscreen" "if( (_device_string=~'^sdl' || _device_string=~'^gtk' ) && !_fullscreen){_old_sw=_screen_width;_old_sh=_screen_height;display 'reinit' 'mW0:0';_fullscreen=1;}else if( (_device_string=~'^sdl' || _device_string=~'^gtk' ) && _old_sw*_old_sh*_fullscreen){display 'reinit' 'rwm'._old_sw.':'._old_sh;_fullscreen=0;}_gtk_fullscreen=_fullscreen;" "Toggles full screen. Will show mouse cursor in full screen."; |
| 177 |
alias "_gtk_check_for_toggle_fullscreen" "if( _device_string=~'^gtk' && _gtk_fullscreen != _fullscreen){toggle_fullscreen;}"; |
| 178 |
alias "_gtk_check_for_toggle_gtk_menus" "if(_device_string=~'^gtk'){if(_hide_gtk_menus){display 'reinit' 'b';}else{display 'reinit' 'B';}}"; |
| 179 |
bind "F11" "toggle_fullscreen"; |
| 180 |
|
| 181 |
autocmd "PostReload" "" "i:fresh=1" ; |
| 182 |
autocmd "PostScale" "" "if(0==i:_will_display){i:fresh=1;display;}" ; |
| 183 |
###autocmd "PostScale" "" "{i:fresh=1;display;}" ; |
| 184 |
autocmd "PostPan" "" "{i:fresh=1;display;}" ; |
| 185 |
#autocmd "PostReload" "pdf|ps|djvu|dvi" "scale 'w';align 'top'"; |
| 186 |
autocmd "PostReload" "" "if(i:fresh){redisplay;}"; |
| 187 |
autocmd "PostInteractiveCommand" "" "if(i:fresh){display;i:fresh=0;}"; |
| 188 |
autocmd "PostInteractiveCommand" "" "if(_want_prefetch>0){prefetch;}"; |
| 189 |
autocmd "PostInteractiveCommand" "" "if(_display_console==0 && i:fresh){redisplay;i:fresh=0;}"; |
| 190 |
autocmd "PostInteractiveCommand" "" "idempotent_cmd"; # Bug workaround: without it console scroll is broken. |
| 191 |
autocmd "PostInteractiveCommand" "" "_gtk_check_for_toggle_gtk_menus;_gtk_check_for_toggle_fullscreen"; |
| 192 |
|
| 193 |
#alias "next10" "i=0;while(i<10){i=i+1;next;display;sleep '1';}" "goes forward 10 images"; |
| 194 |
#alias "prev10" "i=0;while(i<10){i=i+1;prev;display;sleep '1';}" "goes backward 10 images"; |
| 195 |
bind 'N' "goto '+1p' '+museum|series|city|category|artist+' '+/S' '+10';" "goto by jump or category or directory or just ahead"; |
| 196 |
bind 'P' "goto '-1p' '-museum|series|city|category|artist+' '-/S' '-10';" "goto by jump or category or directory or just back "; |
| 197 |
bind 'C-n' "goto '+//'"; |
| 198 |
bind 'C-p' "goto '-//'"; |
| 199 |
bind 'C-b' "goto '-//'"; # Warning: many configurations cannot detect C-b. |
| 200 |
bind 'W' "display 'resize'" "if supported, resizes the window to match the current image pixels size"; |
| 201 |
#bind 'C-w' "scale '100%';display 'resize'" "if supported, scales the image to 100% and resizes the window to match its size (if fits)"; |
| 202 |
bind 'C-w' "if(_scale_style!='w'){_scale_style='w';scale 'w';}else{_scale_style='';scale '100%';}" "scale to width"; |
| 203 |
alias "endless_slideshow" "while(1){display;sleep _slideshow_sleep_time;next;}" "performs an automated slideshow, endlessly"; |
| 204 |
alias "bookview" "while(1){display;sleep '2';scroll 'down';}" ""; |
| 205 |
alias "comicview" "while(1){display;sleep '2';scroll 'down';}" ""; |
| 206 |
alias "read" "while(1){display;sleep '2';scroll 'forward';}" ""; |
| 207 |
alias "slowread" "while(_fileindex<=_filelistlen-1){display;sleep '2';scroll 'forward';}" "loop once slowly"; |
| 208 |
alias "fastread" "while(_fileindex<=_filelistlen-1){display;sleep '0.1';scroll 'forward';}" "proceeds like in a book but very fast, once"; |
| 209 |
alias "pornview" "echo 'press any key repeatedly to terminate' ;endless_slideshow" "enters an endless slideshow (alias name from an actual image viewer)"; |
| 210 |
####bind "C-p" "pornview"; |
| 211 |
####bind "C-b" "bookview"; |
| 212 |
autocmd "PreExecutionCycle" "/fbps-" "_display_busy=0;_display_status=0" ; |
| 213 |
autocmd "PreExecutionCycle" "" "i:fresh=1;reload"; |
| 214 |
####autocmd "PreExecutionCycle" "" "redisplay"; |
| 215 |
autocmd "PreExecutionCycle" "/fbps-.*ps001.png" "i:fresh=1;redisplay"; |
| 216 |
####autocmd "PostInteractiveCommand" "" "i:fresh=0"; |
| 217 |
####autocmd "PostInteractiveCommand" "" "prefetch"; |
| 218 |
## Example in imposing a file loader to an extension: |
| 219 |
#autocmd "PreReload" ".*mtx.gz" "_file_loader='MatrixMarket'"; |
| 220 |
#autocmd "PostReload" ".*mtx.gz" "_file_loader=''"; |
| 221 |
###bind '*' "scale '100%'"; |
| 222 |
bind '*' "_display_console=0;toggleVerbosity;echo i:*"; |
| 223 |
bind 'w' "scale 'w'"; |
| 224 |
bind '<' "rotate10_ccw;display"; |
| 225 |
bind '>' "rotate10;display"; |
| 226 |
bind '_' "_scale_style='';scale '100%'"; |
| 227 |
bind ',' "_display_console=1;echo _last_system_output"; |
| 228 |
bind 'C-a' "if(_scale_style!='a'){_scale_style='a';scale 'a';}else{_scale_style='';scale '100%';}" "scale to height"; |
| 229 |
####bind 'h' "scale 'h'"; |
| 230 |
# |
| 231 |
alias "pan_nw" "pan 'nw'" "pans the image to the upper left"; |
| 232 |
alias "pan_ne" "pan 'ne'" "pans the image to the upper right"; |
| 233 |
alias "pan_se" "pan 'se'" "pans the image to the lower left"; |
| 234 |
alias "pan_sw" "pan 'sw'" "pans the image to the lower right"; |
| 235 |
alias "pan_down" "if(_display_console==0){pan 'down';}else{scd;}" "pans the image down / scrolls console down"; |
| 236 |
alias "pan_up" "if(_display_console==0){pan 'up' ;}else{scu;}" "pans the image up / scrolls console up"; |
| 237 |
alias "pan_left" "pan 'left'" "pans the image left"; |
| 238 |
alias "pan_right" "pan 'right'" "pans the image right"; |
| 239 |
alias "diagonal_nw" "pan_nw" "pans the image to the upper left"; |
| 240 |
alias "diagonal_ne" "pan_ne" "pans the image to the upper right"; |
| 241 |
alias "diagonal_se" "pan_se" "pans the image to the lower left"; |
| 242 |
alias "diagonal_sw" "pan_sw" "pans the image to the lower right"; |
| 243 |
bind 'd' "diagonal_nw"; |
| 244 |
bind 'D' "diagonal_se"; |
| 245 |
bind 'x' "diagonal_ne"; |
| 246 |
bind 'X' "diagonal_sw"; |
| 247 |
alias "toggleDisplayStatus" "_display_status=1-_display_status;redisplay" ""; |
| 248 |
alias "toggleDisplayBusy" "_display_busy=1-_display_busy" ""; |
| 249 |
alias "sort" "list 'sort'" "sorts the files list ordered"; |
| 250 |
####toggleVerbosity; |
| 251 |
####bind 'f' "next;display"; |
| 252 |
####bind 'b' "prev;display"; |
| 253 |
bind 'o' "sort"; |
| 254 |
bind 'b' "prev"; |
| 255 |
bind 'B' "toggleDisplayBusy"; |
| 256 |
alias "random_slideshow" "while(1){display;sleep _slideshow_sleep_time; eval 'r=random';goto r;}" "performs a shuffled slideshow, endlessly"; |
| 257 |
alias "rotate90_ccw" "i:_orientation=i:_orientation+3;i:fresh=1;redisplay" "rotate 90 degrees counter clockwise"; |
| 258 |
alias "rotate90_cw" "i:_orientation=i:_orientation+1;i:fresh=1;redisplay" "rotate 90 degrees clockwise"; |
| 259 |
alias "rotate180" "i:_orientation=i:_orientation+2;i:fresh=1;redisplay" "rotate 180 degrees"; |
| 260 |
alias "rotate90" "rotate90_cw;display" "rotate 90 degrees clockwise"; |
| 261 |
alias "rotate270" "rotate90_ccw;display" "rotate 90 degrees counter clockwise"; |
| 262 |
alias "rotate10" "rotate '10';display" "rotate 10 degrees counter clockwise"; |
| 263 |
alias "rotate10_ccw" "rotate -10 ;display" "rotate 10 degrees clockwise"; |
| 264 |
|
| 265 |
#### window related aliases and commands |
| 266 |
###alias "wu" "window 'up'" "selects the window upwards the current"; |
| 267 |
###alias "wd" "window 'down'" "selects the window under the current"; |
| 268 |
###alias "wl" "window 'left'" "selects the window at left of the current"; |
| 269 |
###alias "wr" "window 'right'" "selects the window at right of the current"; |
| 270 |
####bind 'K' "wu"; |
| 271 |
bind 'K' 'if(_display_console==0){echo i:_filename.": ".i:_comment;toggleVerbosity}else{toggleVerbosity;}'; |
| 272 |
bind 'C-k' 'crop' # still experimental |
| 273 |
#### Note : on many consoles C-j is by default equivalent to Enter.. so this may not work :) |
| 274 |
####bind 'C-j' "wd"; |
| 275 |
####bind 'J' "wd"; |
| 276 |
####bind 'H' "wl"; |
| 277 |
####bind 'L' "wr"; |
| 278 |
####alias "split" "window 'split'" "split the current window horizontally"; |
| 279 |
####alias "vsplit" "window 'vsplit'" "split the current window vertically"; |
| 280 |
####alias "swap" "window 'swap'" "swap the enclosing window subwindows"; |
| 281 |
####alias "ws " "window 'swap'" "see swap"; |
| 282 |
####bind 'T' "split;redisplay"; |
| 283 |
#####don't use C-s : it will be usually caught by the console driver, and fim won't get it! |
| 284 |
#####bind 'C-s' "split"; |
| 285 |
####bind 'V' "vsplit;redisplay"; |
| 286 |
####bind 'U' "swap;redisplay"; |
| 287 |
####alias 'venlarge' 'window "venlarge"' ""; |
| 288 |
####alias 'henlarge' 'window "henlarge"' ""; |
| 289 |
####alias 'wnormalize' 'window "normalize"' ""; |
| 290 |
####alias 'wclose' 'window "close"' ""; |
| 291 |
####alias 'wc' 'window "close"' "closes the current window"; |
| 292 |
####bind 'C' "wc;redisplay"; |
| 293 |
|
| 294 |
alias 'cache' 'echo _cache_status' "displays cached images status"; |
| 295 |
###bind 'c' 'cache'; |
| 296 |
bind 'c' 'align "center"'; |
| 297 |
alias 'widen' 'i:ascale=i:ascale*"1.1";*1.0' "widen the current image"; |
| 298 |
alias 'narrow' 'i:ascale=i:ascale/"1.1";*1.0' "narrow the current image"; |
| 299 |
###alias 'contract' 'narrow'; |
| 300 |
bind 'y' "widen" "widen horizontally the image"; |
| 301 |
bind 'Y' "narrow" "shrink horizontally the image"; |
| 302 |
####alias 'scu' 'scroll_console_up' ""; |
| 303 |
####alias 'scd' 'scroll_console_down' ""; |
| 304 |
####alias 'console_scroll_up' 'if(_console_offset<_console_lines){_console_offset=_console_offset+1;}'; |
| 305 |
####alias 'console_scroll_down' 'if(_console_offset>0){_console_offset=_console_offset-1;}'; |
| 306 |
alias 'console_scroll_up' 'if(_console_offset<_console_lines+console_scroll_n-_rows){_console_offset=_console_offset+console_scroll_n;}' "scrolls up the virtual console"; |
| 307 |
alias 'console_scroll_down' 'if(allow_round_scroll || (_console_offset>=console_scroll_n)){_console_offset=_console_offset-console_scroll_n;}' "scrolls down the virtual console"; |
| 308 |
alias 'console_scroll_reset' '{_console_offset=0;}'; |
| 309 |
alias 'scu' 'console_scroll_up' ""; |
| 310 |
alias 'scd' 'console_scroll_down' ""; |
| 311 |
alias 'scz' 'console_scroll_reset' ""; |
| 312 |
alias 'center' 'align "center"'; |
| 313 |
alias 'left' 'align "left"'; |
| 314 |
alias 'right' 'align "right"'; |
| 315 |
alias 'top' 'align "top"'; |
| 316 |
alias 'bottom' 'align "bottom"'; |
| 317 |
alias "font_magnify_auto" "if(_fbfont_as_screen_fraction>1){_fbfont_as_screen_fraction=_fbfont_as_screen_fraction-1;}else{_fbfont_as_screen_fraction=_screen_width/100+_screen_height/100;}" ""; |
| 318 |
alias "font_magnify_manual" "_fbfont_magnify_factor=_fbfont_magnify_factor+1" ""; |
| 319 |
alias "font_reduce_auto" "if(_fbfont_as_screen_fraction>1){_fbfont_as_screen_fraction=_fbfont_as_screen_fraction+1;}" ""; |
| 320 |
alias "font_reduce_manual" "_fbfont_magnify_factor=_fbfont_magnify_factor-1" ""; |
| 321 |
alias "toggle_font_auto_scale" "if(_fbfont_as_screen_fraction<0){_fbfont_as_screen_fraction=0;echo 'Auto font scaling on.';}else{_fbfont_as_screen_fraction=-1;echo 'Auto font scaling off.';}" "toggles between manual and auto font scaling control"; |
| 322 |
alias 'next_file_same_search' "goto '+//';" "go to next file with same search criteria"; |
| 323 |
alias 'next_file_dir_same' "goto '+/s';" "go to next file in same dir"; |
| 324 |
alias 'next_file_dir_other' "goto '+/S';" "go to next file in other dir"; |
| 325 |
alias 'next_file_dir_up' "goto '+/u';" "go to next file up the dir hierarchy"; |
| 326 |
alias 'next_file_dir_down' "goto '+/d';" "go to next file down the dir hierarchy"; |
| 327 |
alias 'next_file_same_basename' "goto '+/b';" "go to next file with same basename"; |
| 328 |
alias 'prev_file_dir_same' "goto '-/s';" "go to prev file in same dir"; |
| 329 |
alias 'prev_file_dir_other' "goto '-/S';" "go to prev file in other dir"; |
| 330 |
alias 'prev_file_dir_up' "goto '-/u';" "go to prev file up the dir hierarchy"; |
| 331 |
alias 'prev_file_dir_down' "goto '-/d';" "go to prev file down the dir hierarchy"; |
| 332 |
alias 'prev_file_same_basename' "goto '-/b';" "go to prev file with same basename"; |
| 333 |
#alias "font_magnify" "if(_fbfont_as_screen_fraction<0) {font_magnify_manual;}else{font_magnify_auto;}" "increase font size (either relative or absolute)"; |
| 334 |
#alias "font_reduce" "if(_fbfont_as_screen_fraction<0) {font_reduce_manual;} else{font_reduce_auto;}" "increase font size (either relative or absolute)"; |
| 335 |
alias "font_magnify" "_fbfont_as_screen_fraction=-1;font_magnify_manual" "increase absolute font size and set manual font control"; |
| 336 |
alias "font_reduce" "_fbfont_as_screen_fraction=-1;font_reduce_manual" "decrease absolute font size and set manual font control"; |
| 337 |
bind "PageUp" "if(_display_console==0){prev;}else{scu;}"; |
| 338 |
bind "PageDown" "if(_display_console==0){next;}else{scd;}"; |
| 339 |
bind "Home" "0;"; |
| 340 |
bind "End" "$;"; |
| 341 |
bind "^" "0;"; |
| 342 |
bind "$" "$;"; |
| 343 |
#bind "Backspace" "prev"; # console code for C-h and Backspace is the same :-) |
| 344 |
bind "'" "goto _lastfileindex.'f'.(_lastpageindex+1).'p'"; |
| 345 |
bind '"' "scale 'shadow';i:fresh=1;redisplay;"; |
| 346 |
bind '(' "goto '^p'"; |
| 347 |
bind ')' "goto '$p'"; |
| 348 |
bind 'Z' "sleep 1"; |
| 349 |
_display_status=1; # lower status line |
| 350 |
_want_wm_caption_status="fim:%N@%p%%%L[%i/%l]"; |
| 351 |
_caption_over_image_fmt="%?_comment?%:_comment:?"; |
| 352 |
_info_fmt_str="%p%% %wx%h%L %i/%l%P %F %T %c"; # lower right line part |
| 353 |
#_display_status_fmt="%N:%k"; # |
| 354 |
_display_status_fmt="%N%?EXIF_DateTimeOriginal?[%:EXIF_DateTimeOriginal:]?%?EXIF_ExposureTime?[%:EXIF_ExposureTime:]?%?EXIF_FNumber?[%:EXIF_FNumber:]?%?EXIF_ApertureValue?[%:EXIF_ApertureValue:]?%?EXIF_ISOSpeedRatings?[ISO%:EXIF_ISOSpeedRatings:]?%?_markedfile?[mark on %:_markedfile:]?:%k"; # lower left line part |
| 355 |
# funny aliases: |
| 356 |
alias "webcam" "pread 'vgrabbj -d /dev/video0';$" "say cheese"; |
| 357 |
alias 'espeak' 'system \'espeak\' i:_filename." ".i:_comment' 'say something'; |
| 358 |
#_fbfont_as_screen_fraction=-1; # disable auto font scaling |
| 359 |
if( _device_string=~'^gtk[^e]*$' ) { |
| 360 |
alias "man_fim" "system 'man' 'fim'; _display_console=0;toggleVerbosity;"; |
| 361 |
alias "man_fimrc" "system 'man' 'fimrc';_display_console=0;toggleVerbosity;"; |
| 362 |
alias '_rebuild_menus' 'display "reinit" "f";'; |
| 363 |
alias '_rebuild_quieter_menus' '_debug_commands=_debug_commands-"m";display "reinit" "fV";'; # remove "m" occurrences from _debug_commands and rebuild |
| 364 |
alias '_rebuild_verboser_menus' '_debug_commands=_debug_commands."m";_rebuild_menus;'; |
| 365 |
alias '_rebuild_verbosest_menus' '_debug_commands=_debug_commands."mm";_rebuild_menus;'; |
| 366 |
alias 'toggle_gtk_menus' 'if(!_hide_gtk_menus){_hide_gtk_menus=1;}else{_hide_gtk_menus=0;}'; |
| 367 |
autocmd "PreInteractiveCommand" "" "if(__internal_state_changed){_rebuild_menus;__internal_state_changed=0;}"; |
| 368 |
autocmd "PostInteractiveCommand" "" "if(__internal_state_changed){_rebuild_menus;__internal_state_changed=0;}"; |
| 369 |
autocmd "PreExecutionCycle" "" "if(__internal_state_changed){_rebuild_menus;__internal_state_changed=0;}"; |
| 370 |
display "menuadd" |
| 371 |
"_File/" |
| 372 |
"_File/_Open file open C-o" |
| 373 |
"_File/Open _directory open_dir " |
| 374 |
"_File/_Next file or page next " |
| 375 |
"_File/_Next file next_file " |
| 376 |
"_File/_Next in other directory next_file_dir_other" |
| 377 |
"_File/_Next in this directory next_file_dir_same" |
| 378 |
# "_File/_Next as last search goto +\/\/ " # Note that slashes are not supported currently. |
| 379 |
"_File/_Next as last search next_file_same_search " |
| 380 |
"_File/_Go back to last file goto _lastfileindex " |
| 381 |
"_File/_Previous in list prev p" |
| 382 |
# "_File/Remove from list list 'pop'" |
| 383 |
# "_File/Remove from list list_remove_and_reload " |
| 384 |
"_File/Remove from list list 'remove';reload " |
| 385 |
"_File/Mark list 'mark'" |
| 386 |
"_File/Unmark list 'unmark'" |
| 387 |
"_File/_Quit quit q" |
| 388 |
"_List/Show list" |
| 389 |
"_List/_Limit FimMenuLimit/" |
| 390 |
"_List/Limit to.../files sized as current one limit '~z'" # TODO: need a test listing effective menu defs |
| 391 |
"_List/Limit to.../files dated as current one limit '~d'" |
| 392 |
"_List/Limit to.../files with duplicate basename limit '~='" |
| 393 |
"_List/_Unlimit list (reset) unlimit u" |
| 394 |
"_List/Reverse list 'reverse' " |
| 395 |
"_List/Sort by name list 'sort' " |
| 396 |
"_List/Sort by size list 'sort_fsize' " |
| 397 |
"_List/Sort by time list 'sort_mtime' " |
| 398 |
"_List/Shuffle randomly list 'random_shuffle' " |
| 399 |
"_List/Mark all list 'markall' " |
| 400 |
"_List/Slideshow/Random random_slideshow " |
| 401 |
"_List/Slideshow/Endless endless_slideshow " |
| 402 |
"_List/Slideshow/Slideshow time: 0 s _slideshow_sleep_time=0 0.5 s _slideshow_sleep_time=0.5 1 s _slideshow_sleep_time=1 2 s _slideshow_sleep_time=2 3 s _slideshow_sleep_time=3 " |
| 403 |
"_List/Slideshow/Stop _stop_slideshow=1 " |
| 404 |
"_List/Slideshow/Slow read slowread " |
| 405 |
"_List/Slideshow/Fast read fastread " |
| 406 |
"_View/ Automirror toggle||_automirror||1||0 " # ' ' as external separator, || as internal separator |
| 407 |
"_View/||Autoflip||toggle.._autoflip..1..0||" # || as external separator, .. as internal separator |
| 408 |
# "_View/Scale: _auto _scale_style=a a Scale: by _hand (manual) _scale_style=m m Scale: by _width _scale_style=w w Scale: by _height _scale_style=h h" |
| 409 |
"_View/**Scale: 1x**_scale_style= ** **Scale: _auto**_scale_style=a**a**Scale: _auto (till 100%)**_scale_style=b**b**Scale: by _hand (manual)**_scale_style=m**m**Scale: by window _width**_scale_style=w**w**Scale: by window _height**_scale_style=h**h" |
| 410 |
"_View/Orientation: normal _orientation=0 Orientation: 90'right _orientation=1 Orientation: upside down _orientation=2 Orientation: 90' left _orientation=3 " |
| 411 |
"_View/Desaturate toggle___autodesaturate__1__0 " |
| 412 |
"_View/Autonegate toggle___autonegate__1__0 " |
| 413 |
"_View/Vertical scroll/** Default steps: auto**_vsteps=****10%**_vsteps=10%****20%**_vsteps=20%****50%**_vsteps=50%****100%**_vsteps=100%**" |
| 414 |
"_View/Vertical scroll/** Skip page fraction if smaller than ...auto**_scroll_skip_page_fraction=****disabled**_scroll_skip_page_fraction=-1****1/8**_scroll_skip_page_fraction=8****1/16**_scroll_skip_page_fraction=16**" |
| 415 |
"_View/Refresh description & co refresh " |
| 416 |
"_View/||Apply EXIF Orientation||toggle.._want_exif_orientation..1..0||" |
| 417 |
"_Image/_Mirror toggle__i:mirrored__1__0 m" |
| 418 |
"_Image/_Flip toggle&&i:flipped&&1&&0 f" # && as internal separator |
| 419 |
# "_Image Extras/_Let's Flip again toggle&&i:flipped&&1&&0 f" # && as internal separator TODO togli |
| 420 |
"_Image/Orientation: normal i:_orientation=0 Orientation: 90'right i:_orientation=1 Orientation: upside down i:_orientation=2 Orientation: 90' left i:_orientation=3 " |
| 421 |
"_Image/EXIF Orientation: normal i:_exif_orientation=0 EXIF Orientation: 90'right i:_exif_orientation=1 EXIF Orientation: upside down i:_exif_orientation=2 EXIF Orientation: 90' left i:_exif_orientation=3 " # previously __exif_orientation but renamed for the double-symbol-separator convention |
| 422 |
"_Window/_Fullscreen toggle**_gtk_fullscreen**1**0 F11" |
| 423 |
"_Window/Hide the menu bar (press mouse button to restore) toggle_gtk_menus" |
| 424 |
# "_Window/Hide menu bar (press mouse button to restore) toggle||_hide_gtk_menus||0||1" # not yet ready to replace toggle_gtk_menus |
| 425 |
"_Window/Resize window to image size display 'resize'" |
| 426 |
"_Window/Text size reduce font_reduce" |
| 427 |
"_Window/Text size magnify font_magnify" |
| 428 |
"_Window/Text font: next font 'next'" |
| 429 |
"_Window/Text font: prev font 'prev'" |
| 430 |
"_Window/Show status line toggle||_display_status||1||0 " |
| 431 |
"_Window/Caption over image: None _caption_over_image=0 Caption over image: No background _caption_over_image=1 Caption over image: Black background _caption_over_image=2 Caption over image: Above image, no overlap _caption_over_image=3 " |
| 432 |
"_Window/Window caption: minimal _want_wm_caption_status=FIM Window caption: reasonable _want_wm_caption_status=fim:[%i/%l] Window caption: rich _want_wm_caption_status=fim:%N@%p%%%L[%i/%l]%?EXIF_DateTimeOriginal?[%:EXIF_DateTimeOriginal:]? " |
| 433 |
"_Window/Mouse click help grid: default _want_wm_mouse_ctrl='pP+a-=nN Mouse click help grid: simplified _want_wm_mouse_ctrl=ppp+a-nnn " |
| 434 |
"_Advanced/Show output console (then hide with Tab) toggleVerbosity v" |
| 435 |
"_Advanced/Verbose keys toggle___verbose_keys__1__0 " |
| 436 |
"_Advanced/Low execution verbosity _debug_commands=0 Intermediate execution verbosity _debug_commands=ackCm High execution verbosity _debug_commands=ackCmmi " |
| 437 |
"_Advanced/Rebuild menus with no verbosity _rebuild_quieter_menus" |
| 438 |
"_Advanced/Rebuild menus with tooltips _rebuild_verboser_menus" |
| 439 |
"_Advanced/Rebuild menus very verbosely _rebuild_verbosest_menus" |
| 440 |
"_Advanced/Verbose menu toggle||_display_busy||1||0" |
| 441 |
"_Advanced/Downscale huge images on load toggle||_downscale_huge_at_load||1||0" |
| 442 |
"_Advanced/Background prefetch _want_prefetch=2 Foreground prefetch _want_prefetch=1 No prefetch _want_prefetch=0 " |
| 443 |
"_Custom actions/_Mark current file mark_current_file" |
| 444 |
"_Custom actions/_Go to marked file goto_marked_file" |
| 445 |
"_Custom actions/Webcam shot (needs vgrabbj) webcam" |
| 446 |
"_Custom actions/Say something (needs espeak) espeak" |
| 447 |
"_Custom actions/Max cached memory: 256MiB _max_cached_memory=262144 unlimited _max_cached_memory=0 very little _max_cached_memory=1 80MiB _max_cached_memory=81920 " |
| 448 |
"_Custom actions/Max cached images: unlimited _max_cached_images=0 5 _max_cached_images=5 10 _max_cached_images=10 100 _max_cached_images=100 " |
| 449 |
"_All actions/_Commands FimMenuCommands/" |
| 450 |
"_All actions/_Aliases FimMenuAliases/" |
| 451 |
"_All actions/_Key Bindings FimMenuKeyBindings/" |
| 452 |
"_All actions/_Variables FimMenuVariables/" |
| 453 |
"_Help/_Commands FimMenuCommandsHelp/" |
| 454 |
"_Help/_Aliases FimMenuAliasesHelp/" |
| 455 |
"_Help/_Key Bindings FimMenuKeyBindingsHelp/" |
| 456 |
"_Help/_Variables FimMenuVariablesHelp/" |
| 457 |
"_Help/_man FIM man_fim" |
| 458 |
"_Help/_man fimrc man_fimrc"; |
| 459 |
#"_Custom actions/scaling: _auto _scale_style=a a scaling: _auto to original _scale_style=b b scaling: manual _scale_style=m m scaling: by _width _scale_style=w w" # copy for demo purposes |
| 460 |
#"_Custom actions/_Toggle flipped flag toggle__i:flipped__1__0 f" |
| 461 |
#"_Custom actions/_Submenu/_Frobnicate unmapped_cmd /" |
| 462 |
#"_Custom actions/_Submenu/_Defrobnicate unmapped_cmd u" |
| 463 |
#"_Custom actions/_Submenu/FimMenuLimit FimMenuLimit/" |
| 464 |
#"_Custom actions/_Submenu/_Do-frobnicate unmapped_cmd *" # bad specification |
| 465 |
#"_Custom actions/_Submenu/_Fribnikate frobnicate unmapped_cmd *" # bad specification |
| 466 |
#"_Custom actions/_Submenu/_Next next *" # bad specification |
| 467 |
#"_Custom actions/_Add menu... menu_dialog" |
| 468 |
#"_Custom actions/_Toggle full screen view toggle _gtk_fullscreen 1 0" |
| 469 |
if (_last_cmd_output!="") quit -1; |
| 470 |
} |
| 471 |
help ''; # WELCOME... |
| 472 |
# More examples: |
| 473 |
#alias "plisten" 'popen "nc -l -p 9999 "' "executes fim commands coming from port 9999 on this computer"; |
| 474 |
#alias "wlisten" "while(1){sleep;plisten;}" "listen to a pipe, endlessly"; |
| 475 |
#alias "musicplay" "system 'mpc' 'play'" ""; |
| 476 |
#alias "musicpause" "system 'mpc' 'pause'" ""; |
| 477 |
#alias "rdjpgcom" 'system "rdjpgcom" i:_filename'; |
| 478 |
# offsetscan usage : need a mechanism for popping all images before. |
| 479 |
#alias "offsetscan" "while(i:width<1){list 'push' 'blob.jpg';stdout _open_offset ;_open_offset=_open_offset+1;reload;}"; |
| 480 |
#alias "webcam_cycle" "while(1){webcam;reload;sleep 1;}"; |
| 481 |
# This is a FIM initialization file. |
| 482 |
# Without it FIM cannot work like it should. |
| 483 |
# Feel free to modify it, but with caution! |