]> git.phdru.name Git - dotfiles.git/blob - .mc/menu
.mc/menu: Change gvim hotkey
[dotfiles.git] / .mc / menu
1 shell_patterns=0
2
3 # This is necessary to overcome a bug in mc - without this
4 # mc makes default wrong item
5 :  NOOP
6    :
7
8 @  Do something on all of the file(s) at once
9    CMD=%{Enter command}
10    exec $CMD %s
11
12 + t t
13 @  Do something on the tagged files one by one
14    CMD=%{Enter command}
15    for f in %t; do
16      $CMD "$f"
17    done
18
19 + t r
20 p  View the file in a pager
21    exec ${PAGER:-more} %f
22
23 + t r
24 g  Edit the file in gvim
25    gvim %f &
26
27 + t r
28 b  View the file in a browser
29    exec webbrowser file://%d/%f
30
31 + t r
32 w  View the file in a new browser window
33    exec webbrowser -n file://%d/%f
34
35 + t r
36 = f \.(htm(l?)|txt)$
37 t  View the file in a new browser tab
38    exec webbrowser -t file://%d/%f
39
40 += f \.fb2(\.bz2|\.gz|\.zip)?$ | f \.(chm|epub|htm(l?)|txt|rtf)$ & t r
41 f  View fb2/chm/epub with fbreader
42    fbreader %f &
43
44 + t r & f \.fb2(\.bz2|\.gz|\.zip)$
45 H  fb2html
46    case %f in
47      *.fb2.bz2) A="bunzip2 -c" ;;
48      *.fb2.gz) A="gunzip -c" ;;
49      *.fb2.zip) A="unzip -p" ;;
50      *.fb2) A="cat" ;;
51    esac
52    $A %f | xsltproc /usr/local/src/FictionBook/FB2_2_html_ru.xsl - | webstdin -t
53
54 + t r & f \.fb2(\.bz2|\.gz|\.zip)$
55 T  fb2txt
56    case %f in
57      *.fb2.bz2) A="bunzip2 -c" ;;
58      *.fb2.gz) A="gunzip -c" ;;
59      *.fb2.zip) A="unzip -p" ;;
60      *.fb2) A="cat" ;;
61    esac
62    $A %f | xsltproc /usr/local/src/FictionBook/FB2_2_txt_ru.xsl - | webstdin -e txt -t
63
64 += t r & f \.(pdf|PDF|ps|PS)(\.bz2|\.gz)?$
65 e  View pdf/ps
66    qpdfview %f &
67
68 += t r & f \.djvu(\.bz2|\.gz)?$
69 e  View djvu
70    djview %f &
71
72 += t r & f \.(odt|ott|sxw|stw|ods|ots|sxc|stc|odp|otp|sxi|sti|odg|otg|sxd|std|odb|odf|sxm|odm|sxg)$
73 o  View OpenDoc with odt2txt
74    odt2txt %f | ${PAGER:-more}
75
76 + t r & f \.(odt|ott|sxw|stw|ods|ots|sxc|stc|odp|otp|sxi|sti|odg|otg|sxd|std|odb|odf|sxm|odm|sxg)$
77 e  Edit OpenDoc with libreoffice
78    libreoffice %f &
79
80 += t r & f \.(doc|DOC|rtf)$
81 d  View doc with catdoc
82    catdoc %f | ${PAGER:-more}
83
84 + t r & f \.(doc|DOC|rtf)$
85 e  Edit doc with libreoffice
86    libreoffice %f &
87
88 += t r & f \.(docx|DOCX)$
89 d  View docx with docx2txt
90    docx2txt %f - | iconv.py -f utf-8 | ${PAGER:-more}
91
92 + t r & f \.(docx|DOCX)$
93 e  Edit docx with libreoffice
94    libreoffice %f &
95
96 += t r & f \.(xls|XLS)$
97 x  View xls with xls2csv
98    xls2csv %f | ${PAGER:-more}
99
100 + t r & f \.(bmp|BMP|gif|GIF|jpg|JPG|jpeg|JPEG|pbm|PBM|ppm|PPM|png|PNG|xbm|xpm)$ | t t
101 = t r & f \.(bmp|BMP|gif|GIF|jpg|JPG|jpeg|JPEG|pbm|PBM|ppm|PPM|png|PNG|xbm|xpm)$
102 i  View image(s) scaled
103    xli -title "`echo %s | sed 's/ /_/g'`" -zoom auto %s &
104
105 + t r & f \.(bmp|BMP|gif|GIF|jpg|JPG|jpeg|JPEG|pbm|PBM|ppm|PPM|png|PNG|xbm|xpm)$ | t t
106 I  View image(s) full size
107    xli -title "`echo %s | sed 's/ /_/g'`" %s &
108
109 + t r & f \.(ico|jp2|tif|TIF|tiff|TIFF)$ | t t
110 = t r & f \.(ico|jp2|tif|TIF|tiff|TIFF)$
111 I  View icon, JPEG-2000 or TIFF image
112    display %s &
113
114 + t r & f \.(aac|ac3|ape|cue|dts|flac|m3u|mka|mp3|MP3|ogg|OGG|pls|WAV|wav|wv)$ | t t
115 a  Add the audiofile(s) or playlist(s)
116    #if [ "`audtool --get-volume`" -eq 0 ]; then cgmem_nice 500 audacious & sleep 3; fi
117    #for f in %s; do
118    #   audtool --playlist-addurl "$f"
119    #done
120    #smplayer -add-to-playlist %s &
121    deadbeef --queue %s &
122
123 + t r & f \.(aac|ac3|ape|cue|dts|flac|m3u|mka|mp3|MP3|ogg|OGG|pls|WAV|wav|wv)$ | t t
124 = t r & f \.(aac|ac3|ape|cue|dts|flac|m3u|mka|mp3|MP3|ogg|OGG|pls|WAV|wav|wv)$
125 p  Load the audiofile(s) or playlist(s)
126    #if [ "`audtool --get-volume`" -eq 0 ]; then cgmem_nice 500 audacious & sleep 3; fi
127    #audtool --playlist-clear
128    #for f in %s; do
129    #   audtool --playlist-addurl "$f"
130    #done
131    #smplayer -send-action pl_remove_all
132    #smplayer -add-to-playlist %s &
133    deadbeef --queue %s &
134
135 + t r & f \.(aac|ac3|ape|cue|dts|flac|m3u|mka|mp3|MP3|ogg|OGG|pls|WAV|wav|wv)$ | t t
136 P  Play the audiofile(s) or playlist(s)
137    #if [ "`audtool --get-volume`" -eq 0 ]; then cgmem_nice 500 audacious & sleep 3; fi
138    #audtool --playlist-clear
139    #for f in %s; do
140    #   audtool --playlist-addurl "$f"
141    #done
142    #exec audtool --playback-play
143    #mplayer -playlist %f &
144    #smplayer %s &
145    deadbeef %s &
146    #exec mediaplayer_open %f
147
148 + t r & f \.m3u
149 R  Play the playlist in random order
150    "$HOME"/admin/prog/audio-cdr-video/audio/shuffle-playlist.py %f random-playlist-tmp.m3u
151    #if [ "`audtool --get-volume`" -eq 0 ]; then cgmem_nice 500 audacious & sleep 3; fi
152    #audtool --playlist-clear
153    #audtool --playlist-addurl random-playlist-tmp.m3u
154    #audtool --playback-play
155    #mplayer -playlist random-playlist-tmp.m3u &
156    #smplayer random-playlist-tmp.m3u &
157    #smplayer -actions pl_shuffle %f &
158    deadbeef --queue random-playlist-tmp.m3u & deadbeef --play
159    #mediaplayer_open random-playlist-tmp.m3u
160    (sleep 5; exec rm random-playlist-tmp.m3u) &
161
162 + f \.(aac|ac3|ape|cue|dts|flac|m3u|mp3|MP3|ogg|OGG|pls|WAV|wav|wv|avi|AVI|flv|iso|m2ts|m4v|mka|mkv|MKV|mov|MOV|mp4|MP4|mpg|MPG|vob|VOB|wma|wmv)$ | t d | t t
163 s  Play audio/video file(s) or directory with smplayer
164    smplayer %s &
165
166 + t d & f (video_ts|VIDEO_TS)$
167 c  Play the current directory with smplayer
168    smplayer . &
169
170 + t r & f \.(m3u|mp3|MP3|cue|aac|ac3|ape|dts|flac|ogg|OGG|pls|WAV|wav|wv|avi|AVI|flv|m2ts|m4v|mka|mkv|MKV|mov|MOV|mp4|MP4|mpg|MPG|vob|VOB|wma|wmv)$
171 i  Audio/video info
172    exec "$HOME"/.config/mpv/mpv_identify.sh %f
173
174 + t d & f (video_ts|VIDEO_TS)$
175 i  DVD info
176    exec "$HOME"/.config/mpv/mpv_identify.sh .
177
178 + f \.(aac|ac3|ape|cue|dts|flac|m3u|mp3|MP3|ogg|OGG|pls|WAV|wav|wv|avi|AVI|flv|iso|m2ts|m4v|mka|mkv|MKV|mov|MOV|mp4|MP4|mpg|MPG|vob|VOB|wma|wmv)$ | t d | t t
179 = f \.(aac|ac3|ape|cue|dts|flac|m3u|mp3|MP3|ogg|OGG|pls|WAV|wav|wv|avi|AVI|flv|iso|m2ts|m4v|mka|mkv|MKV|mov|MOV|mp4|MP4|mpg|MPG|vob|VOB|wma|wmv)$
180 m  Play video file(s) with mplayer
181    mplayer %s &
182
183 + f \.(m3u|mp3|MP3|cue|aac|ac3|ape|dts|flac|ogg|OGG|pls|WAV|wav|wv|avi|AVI|flv|m2ts|m4v|mka|mkv|MKV|mov|MOV|mp4|MP4|mpg|MPG|vob|VOB|wma|wmv)$ | t t
184 M  Play audio/video with gmplayer
185    gmplayer %s &
186
187 += t d & f (video_ts|VIDEO_TS)$
188 d  Play DVD directory with mplayer
189    mplayer -dvd-device . dvd:// &
190
191 + t d & f (video_ts|VIDEO_TS)$
192 D  Play DVD directory with gmplayer
193    gmplayer -dvd-device . dvd:// &
194
195 + t d & f (video_ts|VIDEO_TS)$
196 t  Play DVD title with mplayer
197    title=%{Enter title}
198    mplayer -dvd-device . dvd://"$title" &
199
200 + t d & f (video_ts|VIDEO_TS)$
201 T  Play DVD title with gmplayer
202    title=%{Enter title}
203    gmplayer -dvd-device . dvd://"$title" &
204
205 + t d
206 p  Play directory with mplayer
207    mplayer %f/* &
208
209 + t d
210 P  Play directory with gmplayer
211    gmplayer %f/* &
212
213 + t d & f ^\.\.$
214 b  Compress the current subdirectory to tar.bz2
215    Pwd="`basename %d /`"
216    echo -n "Name of the distribution file (without extension) [$Pwd]: "
217    read tar
218    if [ "$tar"x = x ]; then tar="$Pwd"; fi
219    cd .. && tar cvf - "$Pwd" | bzip2 -f9 > "$tar".tar.bz2 &&
220    echo ../"$tar".tar.bz2 created.
221
222 + t d & f ^\.\.$
223 g  Compress the current subdirectory to tar.gz
224    Pwd="`basename %d /`"
225    echo -n "Name of the distribution file (without extension) [$Pwd]: "
226    read tar
227    if [ "$tar"x = x ]; then tar="$Pwd"; fi
228    cd .. && tar cvf - "$Pwd" | gzip -f9 > "$tar".tar.gz &&
229    echo ../"$tar".tar.gz created.
230
231 + t d & f ^\.\.$
232 l  Compress the current subdirectory to tar.lzma
233    Pwd="`basename %d /`"
234    echo -n "Name of the distribution file (without extension) [$Pwd]: "
235    read tar
236    if [ "$tar"x = x ]; then tar="$Pwd"; fi
237    cd .. && tar cvf - "$Pwd" | lzma -f9 > "$tar".tar.lzma &&
238    echo ../"$tar".tar.lzma created.
239
240 + t d & f ^\.\.$
241 x  Compress the current subdirectory to tar.xz
242    Pwd="`basename %d /`"
243    echo -n "Name of the distribution file (without extension) [$Pwd]: "
244    read tar
245    if [ "$tar"x = x ]; then tar="$Pwd"; fi
246    cd .. && tar cvf - "$Pwd" | xz -f9 > "$tar".tar.xz &&
247    echo ../"$tar".tar.xz created.
248
249 + t d & f ^\.\.$
250 t  Compress the current subdirectory to tar
251    Pwd="`basename %d /`"
252    echo -n "Name of the distribution file (without extension) [$Pwd]: "
253    read tar
254    if [ "$tar"x = x ]; then tar="$Pwd"; fi
255    cd .. && tar cvf - "$Pwd" > "$tar".tar &&
256    echo ../"$tar".tar created.
257
258 + t d & f ^\.\.$
259 z  Compress the current subdirectory to zip
260    Pwd="`basename %d /`"
261    echo -n "Name of the distribution file (without extension) [$Pwd]: "
262    read zip
263    if [ "$zip"x = x ]; then zip="$Pwd"; fi
264    cd .. && zip -r9 "$zip".zip "$Pwd" &&
265    echo ../"$zip".zip created.
266
267 + t d & f ^\.\.$
268 y  Compress the current subdirectory to zip with recoded filenames
269    Pwd="`basename %d /`"
270    echo -n "Name of the distribution file (without extension) [$Pwd]: "
271    read zip
272    if [ "$zip"x = x ]; then zip="$Pwd"; fi
273    cd .. && zip.py "$zip".zip "$Pwd" &&
274    echo ../"$zip".zip created.
275
276 + t d & f ^\.\.$
277 7  Compress the current subdirectory to 7z
278    Pwd="`basename %d /`"
279    echo -n "Name of the distribution file (without extension) [$Pwd]: "
280    read ar
281    if [ "$ar"x = x ]; then ar="$Pwd"; fi
282    cd .. && 7zr a "$ar".7z "$Pwd" &&
283    echo ../"$ar".7z created.
284
285 + ! f \.(bz2|gz|lz|lzma|7z|xz|zip|ZIP)$ & t r
286 z  bzip2 the file
287    exec bzip2 -9 %f
288
289 + ! f \.(z|Z|bz2|gz|lz|lzma)|(tbz2|tgz|tz|zip|ZIP|rar|RAR|xz|7z)$ & t r
290 z  gzip the file
291    exec gzip -9 %f
292
293 + ! f \.(z|Z|bz2|gz|lz|lzma)|(tbz2|tgz|tz|zip|ZIP|rar|RAR|xz|7z)$ & t r
294 z  lzip the file
295    exec lzip -9 %f
296
297 + ! f \.(z|Z|bz2|gz|lz|lzma)|(tbz2|tgz|tz|zip|ZIP|rar|RAR|xz|7z)$ & t r
298 z  lzma the file
299    exec lzma -9 %f
300
301 + ! f \.(z|Z|bz2|gz|lz|lzma)|(tbz2|tgz|tz|zip|ZIP|rar|RAR|xz|7z)$ & t r
302 z  7z the file/directory
303    exec 7zr a %f.7z %f
304
305 + ! f \.(z|Z|bz2|gz|lz|lzma)|(tbz2|tgz|tz|zip|ZIP|rar|RAR|xz|7z)$ & t r
306 z  xz the file
307    exec xz -9 %f
308
309 + ! f \.(z|Z|bz2|gz|lz|lzma)|(tbz2|tgz|tz|zip|ZIP|rar|RAR|xz|7z)$ & t r
310 z  zip the file/directory
311    exec zip -r9 %f.zip %f
312
313 + ! f \.(z|Z|bz2|gz|lz|lzma)|(tbz2|tgz|tz|zip|ZIP|rar|RAR|xz|7z)$ & t r
314 y  zip the file/directory with recoded filename(s)
315    exec zip.py %f.zip %f
316
317 + t t
318 Z  zip these files/directories
319    ZIP=%{Enter zip name}
320    exec zip -r9 "$ZIP" %s
321
322 + t t
323 Y  zip these files/directories with recoded filenames
324    ZIP=%{Enter zip name}
325    exec zip.py "$ZIP" %s
326
327 + f \.(tar\.(z|Z|bz2|gz|lz|lzma))|(tbz2|tgz|tz|zip|ZIP|rar|RAR|xz|7z)$ & t r
328 n  Create a directory for this archive
329    case %f in
330      *.tar.Z)    D="`basename %f .tar.Z`";;
331      *.tar.bz2)  D="`basename %f .tar.bz2`";;
332      *.tar.gz)   D="`basename %f .tar.gz`";;
333      *.tbz2)     D="`basename %f .tbz2`";;
334      *.tgz)      D="`basename %f .tgz`";;
335      *.tz)       D="`basename %f .tz`";;
336      *.tar.lz)   D="`basename %f .tar.lz`";;
337      *.tar.lzma) D="`basename %f .tar.lzma`";;
338      *.tar.7z)   D="`basename %f .tar.7z`";;
339      *.zip)      D="`basename %f .zip`";;
340      *.ZIP)      D="`basename %f .ZIP`";;
341      *.rar)      D="`basename %f .rar`";;
342      *.RAR)      D="`basename %f .RAR`";;
343      *.xz)       D="`basename %f .xz`";;
344      *.7z)       D="`basename %f .7z`";;
345    esac
346    exec mkdir "$D"
347
348 + F \.(tar\.(z|Z|bz2|gz|lz|lzma))|(tbz2|tgz|tz|zip|ZIP|rar|RAR|xz|7z)$ & T r
349 N  Create a directory for the other archive
350    case %D/%F in
351      *.tar.Z)    D="`basename %F .tar.Z`";;
352      *.tar.bz2)  D="`basename %F .tar.bz2`";;
353      *.tar.gz)   D="`basename %F .tar.gz`";;
354      *.tbz2)     D="`basename %F .tbz2`";;
355      *.tgz)      D="`basename %F .tgz`";;
356      *.tz)       D="`basename %F .tz`";;
357      *.tar.lz)   D="`basename %F .tar.lz`";;
358      *.tar.lzma) D="`basename %F .tar.lzma`";;
359      *.tar.7z)   D="`basename %F .tar.7z`";;
360      *.zip)      D="`basename %F .zip`";;
361      *.ZIP)      D="`basename %F .ZIP`";;
362      *.rar)      D="`basename %F .rar`";;
363      *.RAR)      D="`basename %F .RAR`";;
364      *.xz)       D="`basename %F .xz`";;
365      *.7z)       D="`basename %F .7z`";;
366    esac
367    exec mkdir "$D"
368
369 + f \.(tar\.(z|Z|bz2|gz|lz|lzma|7z|xz))|(tbz2|tgz|tz)$ & t r
370 x  Extract the contents of a compressed tar file
371    unset PRG
372    case %f in
373       *.tar.bz2|*.tbz2)
374          PRG="bunzip2 -c"
375       ;;
376       *.tar.gz|*.tar.z|*.tgz|*.tz|*.tar.Z)
377          PRG="gzip -dc"
378       ;;
379       *.tar.lz)
380          PRG="lzip -dc"
381       ;;
382       *.tar.lzma)
383          PRG="lzma -dc"
384       ;;
385       *.tar.7z)
386          PRG="7zr e -so"
387       ;;
388       *.tar.xz)
389          PRG="xz -dc"
390       ;;
391       *)
392       exit 1
393       ;;
394    esac
395    $PRG %f | tar xvpf -
396
397 + F \.(tar\.(z|Z|bz2|gz|lz|lzma|7z|xz))|(tbz2|tgz|tz)$ & T r
398 X  Extract the contents of an other compressed tar file
399    unset PRG
400    case %F in
401       *.tar.bz2|*.tbz2)
402          PRG="bunzip2 -c"
403       ;;
404       *.tar.gz|*.tar.z|*.tgz|*.tz|*.tar.Z)
405          PRG="gzip -dc"
406       ;;
407       *.tar.lz)
408          PRG="lzip -dc"
409       ;;
410       *.tar.lzma)
411          PRG="lzma -dc"
412       ;;
413       *.tar.7z)
414          PRG="7zr e -so"
415       ;;
416       *.tar.xz)
417          PRG="xz -dc"
418       ;;
419       *)
420       exit 1
421       ;;
422    esac
423    $PRG %D/%F | tar xvpf -
424
425 + f \.(bz2|egg|gz|lz|lzma|7z|xz|tar|whl|zip|ZIP|rar|RAR)$ & t r
426 x  Extract a compressed file
427    case %f in
428      *.bz2)  P="bzip2 -d";;
429      *.gz)   P="gzip -d";;
430      *.lz)   P="lzip -d";;
431      *.lzma) P="lzma -d";;
432      *.7z)   P="7zr x";;
433      *.xz)   P="xz -d";;
434      *.tar)  P="tar xvpf";;
435      *.egg|*.whl|*.zip|*.ZIP) P="unzip";;
436      *.rar|*.RAR) P="unrar x -y";;
437    esac
438    exec $P %f
439
440 + F \.(bz2|egg|gz|lz|lzma|7z|xz|tar|whl|zip|ZIP|rar|RAR)$ & T r
441 X  Extract another compressed file
442    case %F in
443      *.bz2)  P="bzip2 -d";;
444      *.gz)   P="gzip -d";;
445      *.lz)   P="lzip -d";;
446      *.lzma) P="lzma -d";;
447      *.7z)   P="7zr x";;
448      *.xz)   P="xz -d";;
449      *.tar)  P="tar xvpf";;
450      *.egg|*.whl|*.zip|*.ZIP) P="unzip";;
451      *.rar|*.RAR) P="unrar x -y";;
452    esac
453    exec $P %D/%F
454
455 + t r & f \.(zip|ZIP)$
456 y  Extract from zip with recoded filenames
457    exec unzip.py %f
458
459 + T r & F \.(zip|ZIP)$
460 Y  Extract from other zip with recoded filenames
461    exec unzip.py %D/%F
462
463 + t r
464 v  View via mailcap
465    exec see %f
466
467 + t r
468 c  Compare the file
469    exec cmp %D/%f %f
470
471 + t r & T r
472 C  Compare these files
473    exec cmp %D/%F %f
474
475 + t r
476 d  Diff the file
477    exec diff -u --speed-large-files %D/%f %f
478
479 + t r & T r
480 D  Diff these files
481    exec diff -u --speed-large-files %D/%F %f
482
483 + t r
484 v  vimdiff the file
485    exec vim -d %D/%f %f
486
487 + t r & T r
488 V  vimdiff these files
489    exec vim -d %D/%F %f
490
491 + t d & ! f ^\.\.$
492 d  Diff the directory
493    exec diff -ru --speed-large-files \
494       -x CVS -x .git -x .hg -x .svn -x '*.py[co]' -x __pycache__ %D/%f %f
495
496 + t d & T d & ! F ^\.\.$
497 D  Diff these directories
498    exec diff -ru --speed-large-files \
499       -x CVS -x .git -x .hg -x .svn -x '*.py[co]' -x __pycache__ %D/%F %f
500
501 += f \.(asc|sig(n)?)$ & t r
502 v  Verify signature
503    exec gpg --verify %f
504
505 += f \.[1-8]$ | f \.man$ & t r
506 1  Display the file with roff -man
507    %view nroff -man %f
508
509 m  View a manual page
510    MAN=%{Enter manual name}
511    %view man -P cat $MAN
512
513 + t r | t d | t t
514 r  rsync the file(s) there
515    rsync -ahPv --del %s %D