#!/usr/bin/perl
($rc::VNAME, $rc::VERSION, $rc::REQUIRE) = qw(vshnurc 1.0500 1.0500);
&addversions($rc::VNAME, $rc::VERSION);
&err("loaded $rc::VNAME $rc::VERSION requires $cfg::VNAME $rc::REQUIRE",
"($cfg::VERSION)") if $rc::REQUIRE != $cfg::VERSION;
$mailbox = undef;
`tcsh -f /dev/null`;
$shell = 'tcsh' unless $?;
$stty_cooked = '-istrip';
sub hostr { local $_ = shift; s/^ukinzler\b.*/$ENV{UH}/is; $_ }
if ($color && getpwnam('kinzler')) {
$co_decor = ($user eq 'kinzler') ? 'on_blue' :
($ENV{'SU_CLASS'} eq 'other') ? 'on_magenta' :
'black on_green' if $>;
delete $co_user{$user}, @co_user{'kinzler', 'oracle', 'uoracle'} =
('blue', 'magenta', 'magenta');
}
$disksgvfs = 1;
$dotdotdot = "\267";
$getch = "\cX" if $scr->{ROWS} <= 5;
%nobag = ('' => 'keymapcmd($_, "\u$key")');
&mapset('typemap_', '', 'run -s= $cfg::editor', 0);
$rc::Ext_mbox = (grep(/mbox/, @typemap_do))[0];
$rc::Ext__mbox = '/(^|\/)#?_(|[^_].*\.)mbox$/';
$rc::probmbox = '/(^|\/)_problems.mbox$/';
&mapset('typemap_do', $rc::Ext_mbox,
['run -s_ "$cfg::mailer -f"', 'run the mailer on this mbox file']);
&mapadd('typemap_', $rc::Ext__mbox, &mapget('typemap_do', $rc::Ext_mbox));
&mapadd('typemap_do', $rc::Ext__mbox, &mapget('typemap_', ''), $rc::Ext_mbox);
&mapadd('typemap_', $rc::probmbox,
['run -s_ "$cfg::mailer -f"; point("-\$"), run("-X", "qq") if ! -s',
'run the mailer on this problems mailbox'], $rc::Ext__mbox);
&mapadd('typemap_do', $rc::probmbox,
['run "catrm $_q >> ~/l/mail/_problems2.mbox"; typemap "*do"',
'backburner this problems mailbox'], $rc::Ext__mbox);
$rc::zzext = '(\.([gl]?z|bz2))?';
&mapadd('typemap_', '/(^|\/)_comics_[^\/]*\.html?$/',
['sh "$ENV{HTMLVIEW} < $_q"; remove $_; win',
'browse and remove this HTML file']);
&mapadd('typemap_', 'ext bmp gif ico jpe?g p[bgnp]m pcx png svg tiff?',
['run -g "(img2txt -W " . ($scr->{COLS} - 1) . " -- $_q;"
. " identify -verbose -- $_q)"',
'view information about this image file']);
&mapadd('typemap_', 'ext do[ct]' . $rc::zzext,
['run -p "zzcat $_q | doc2txt -"',
'view a text version of this Word file']);
&mapadd('typemap_', 'ext docx' . $rc::zzext,
['run -p "zzcat $_q | docx2txt - -"',
'view a text version of this Word-X file']);
&mapadd('typemap_', 'ext msg',
['run -p "msgconvert --outfile - $_q | tr -d \\r"',
'view a text version of this Outlook email file']);
&mapadd('typemap_', 'ext o[dt]t ods',
['run -_p "odt2txt"',
'view a text version of this OpenDocument file']);
&mapadd('typemap_', 'ext xls' . $rc::zzext,
['run -p "zzcat $_q | xls2tsv"',
'view a text version of this Excel file']);
&mapadd('typemap_', 'ext xls[xm]' . $rc::zzext,
['run -pr "zzcat $_q | ' .
'ssconvert -T Gnumeric_stf:stf_csv fd://0 fd://1"',
'view a text version of this Excel-X file']);
${&mapget('typemap_do', '-d _', 0)}[0] .= ', ifopt("C", "--color")';
&mapadd('typemap_do', 'ext mp3',
[[${$typemap_do{(grep(/ asf /, @typemap_do))[0]}}[0],
'play this MP3 file', 'pP', 'play'],
['run -s=r "eyeD3", "-v"',
'show the ID3 tags of this MP3 file', 'iI', 'info'],
['run -x_ "easytag"',
'edit the ID3 tags of this MP3 file', 'tT', 'edit tags'],
['run -x_ "audacity"',
'edit the audio of this MP3 file', 'aAeE', 'edit audio'],
['run -_r "mp32ogg"',
'convert this MP3 file to Ogg', 'oOcC', 'to ogg']],
(grep(/ asf /, @typemap_do))[0]);
&mapadd('typemap_do', 'ext mp4',
[[${$typemap_do{(grep(/ asf /, @typemap_do))[0]}}[0],
'play this MP4 file', 'pP', 'play'],
['run -_R "mp42mp3"',
'extract MP3 audio from this MP4 file', 'xX3', 'to mp3']],
(grep(/ asf /, @typemap_do))[0]);
${&mapget('typemap_do', (grep(/ bmp /, @typemap_do))[0])}[0] = 'run -x_ "xv"';
&mapset('typemap_do', (grep(/ csv /, @typemap_do))[0],
['run -x_ "office"', 'load this file into Office']);
&mapadd('typemap_do', 'ext cbr cbz',
['run -x= "comix"', 'display this comics file'], 'Ext crl');
&mapset('typemap_do', 'ext e?ps', sub { my $c =
['run -x= "evince"',
'display this PostScript file', 'vVgG', 'view'];
&cfg::onecmd() ? $c : [$c,
['run -s_r "lpr", "-h", "-P$ENV{PRINTER1}"',
'print this PostScript file', 'pPlL', 'print'],
['run -s_r "lpr", "-h", "-P$ENV{PRINTER2}"',
'print this PostScript file duplex', 'd', 'print duplex'],
['run -s_r "lpr", "-h", "-P$ENV{PRINTERT}"',
'print this PostScript file tumble', 't', 'print tumble'],
['run -s_r "lpr", "-h", "-P$ENV{PRINTERC}"',
'print this PostScript file color', 'c', 'print color'],
['run -sr "psnup -n 2 $_q | lpr -h -P$ENV{PRINTER1}"',
'print this PostScript file 2-up', '2rRnN', 'print 2-up'],
['run -sr "psnup -n 2 $_q | lpr -h -P$ENV{PRINTER2}"',
'print this PostScript file duplex 2-up', 'D', 'print duplex 2-up'],
['run -sr "psnup -n 2 $_q | lpr -h -P$ENV{PRINTERT}"',
'print this PostScript file tumble 2-up', 'T', 'print tumble 2-up'],
['run -sr "psnup -n 2 $_q | lpr -h -P$ENV{PRINTERC}"',
'print this PostScript file color 2-up', 'C', 'print color']]
});
&mapadd('typemap_do', 'ext epub fb2',
['run -x_ "fbreader"', 'display this ebook file'], 'Ext fig');
&mapadd('typemap_do', 'Ext err',
['run -s_ $cfg::editor, "-q"',
'quickfix edit based on this error file'], 'Ext fig');
&mapadd('typemap_do', 'ext html?',
['run -s_w "$ENV{HTMLVIEW} <"',
'browse this HTML file'], 'ext iso');
&mapadd('typemap_do', 'Ext ics',
['run -x= "evolution"', 'display this calendar file'], 'ext iso');
&mapadd('typemap_do', 'ext pdb',
[['run -=p "+palm; txt2pdbdoc -d"',
'read this Palm Doc file', 'rRtT', 'read'],
['run -_p "+palm; pdbdump"',
'view a dump of this Palm file', 'vVfF', 'view'],
['run -_R "+palm; exec pilot-xfer -i"',
'download this file to a Palm', 'dDxX', 'download']], '>Ext o');
&mapadd('typemap_do', 'ext prc pqa',
[@{&mapget('typemap_do', 'ext pdb')}[0, 1]], '>Ext o');
&mapset('typemap_do', 'Ext rpm', [@{&mapget('typemap_do', 'Ext rpm')},
['run -s=r "alien", "-i"',
'install this RPM package as a Debian package',
'dD', 'install deb'],
['run -sR "rpm2cpio $_q | cpio -idmv"',
'extract this RPM package', 'xXeE', 'extract']]);
&mapadd('typemap_do', 'Ext url?',
['run -s_w "xrshio - webrowse -mw <"',
'browse this URL file marked up'], 'Ext uu');
&mapadd('typemap_do', '/(^|\/)known_hosts$/',
['run -s_2p "ssh-keygen -lvf"',
'view the fingerprints of these keys'], '/(^|\/)Imakefile$/');
${&mapget('typemap_do', '/[Mm]akefile/')}[0] =~ s/"make /"mak /;
${&mapget('typemap_do', 'Ext Z' )}[0] =~ s/P/p/;
${&mapget('typemap_do', 'Ext bz2' )}[0] =~ s/P/p/;
${&mapget('typemap_do', 'Ext g?z' )}[0] =~ s/P/p/;
&mapset('typemap_do', '',
[['run -s= $pager',
'view this file', 'vV', 'view'],
['run -s_ "$cfg::mailer -f"',
'run the mailer on this mailbox', 'mM', 'view mailbox'],
['run -s_R "sendfile"',
'mail this message file', 'sS', 'send mail'],
['run -sR "$rc::enscript -p- -- $_q | lpr -h -P$ENV{PRINTER1}"',
'print this text file', 'pl', 'print'],
['run -sR "$rc::enscript -p- -- $_q | lpr -h -P$ENV{PRINTER2}"',
'print this text file duplex', 'd', 'print duplex'],
['run -sR "$rc::enscript -p- -- $_q | lpr -h -P$ENV{PRINTERT}"',
'print this text file tumble', 't', 'print tumble'],
['run -sR "$rc::enscript -p- -- $_q | lpr -h -P$ENV{PRINTERC}"',
'print this text file color', 't', 'print color'],
['run -sR "$rc::enscript -2r -p- -- $_q | lpr -h -P$ENV{PRINTER1}"',
'print this text file 2-up', '2rn', 'print 2-up'],
['run -sR "$rc::enscript -2r -p- -- $_q | lpr -h -P$ENV{PRINTER2}"',
'print this text file duplex 2-up', 'D', 'print duplex 2-up'],
['run -sR "$rc::enscript -2r -p- -- $_q | lpr -h -P$ENV{PRINTERT}"',
'print this text file tumble 2-up', 'T', 'print tumble 2-up'],
['run -sR "$rc::enscript -2r -p- -- $_q | lpr -h -P$ENV{PRINTERC}"',
'print this text file color 2-up', 'T', 'print color 2-up'],
['run -s=R "mailp", "-from", "-noburstpage"',
'print this mail file', 'PL', 'print mail'],
['run -s=R "mailp", "-from", "-landscape", "-noburstpage"',
'print this mail file 2-up', 'RN', 'print mail 2-up']]);
&mapadd('typemap_do', join(' ', 'Ext', map { "$_(|[-._].*)" }
qw/crl cer crt pem csr key prm/),
['run -s_2p "certinfo -t"', 'view this certificate file'], 'Ext crl');
&mapdel('typemap_do', 'Ext crl');
&mapdel('typemap_do', 'Ext cer crt pem');
&mapdel('typemap_do', 'Ext csr');
&mapdel('typemap_do', 'Ext key');
&mapdel('typemap_do', 'Ext prm');
$rc::enscript = 'enscript' . ($ENV{'ENSCRARGS'} ? " $ENV{'ENSCRARGS'}" : '');
$cfg::quemarkmsg = '';
@rc::ring = ('cd "~/tmp"; win',
(! grep($ENV{'HOST'} eq $_, @ENV{'SH', 'MH'})) ? () :
('cd "/l/picons/ftp/incoming"; win',
'cd("~oracle/post") ? longls("-win", 1) : win'),
'cd "~/work"; win');
$rc::prefaves = 'cd /media && make -s';
@rc::faves = ('/etc/systemd/system',
</media/*>, </mnt/*>, </run/user/*/*/*:*>);
&mapadd('keymap_', "\cK",
['setcomplete \&rc::edtags;'
. ' run "-s/", $cfg::editor, "-t", get "Tag:"',
'edit in the file for the given tag'], "\cL");
$keymap_{"\cL"}[0] = 'point "-\$"; winch';
unshift(@{$keymap_{"\cQ"}},
['do $vshnurc; err $@; win', 'reload just the personal rc file '
. '($vshnurc)', "rR\cR", 'load $vshnurc'])
unless $keymap_{"\cQ"}[0][2] =~ /r/i;
&mapadd('keymap_', "\cS",
[['run -ru "gnu cp -axi --", quote(@choose), "."',
'copy the chosen set to the current directory',
'.', 'cp chosen .'],
['run -r "$ENV{RCPCMD} -r --", quote(split(/\n/, cfg::xpaste)), "."',
'remote copy X cut buffer $cfg::xcb lines to the current directory',
'x', 'rcp Xcutbuf$cfg::xcb .'],
['run -ru "$ENV{RCPCMD} -r --", quote(@choose, cfg::xpaste)',
'remote copy the chosen set to X cut buffer $cfg::xcb',
'X', 'rcp chosen Xcutbuf$cfg::xcb'],
['run -ru "$ENV{RCPCMD} -r --", quote($point, cfg::xpaste)',
'remote copy the point file to X cut buffer $cfg::xcb',
'>', 'rcp point Xcutbuf$cfg::xcb']], "\cT");
&mapadd('keymap_', "\cX",
['altls \@rc::empty, ""; win',
'switch to/from an empty display'], "\cW");
&mapadd('keymap_', ",",
['evalnext \@rc::ring', 'cycle to monitored directories'], "-");
&mapadd('keymap_', "7",
['system $rc::prefaves; altls \@rc::faves, "Favorites"; win',
'switch to/from the favorites display'], "8");
&mapadd('keymap_', "@",
['run -p "(atls -#; crontab -l)"',
'view the scheduled at and cron jobs'], "B");
&mapadd('keymap_', "A",
['cfg::longls2 ["lsacl"], ["ls", ifopt("L"), "-d --scontext --"]',
'long list files with their ACL info or security context'], "B");
&mapadd('keymap_', "C",
['run -sL "chmod +r *"', 'run `chmod +r *`'], ">B");
&mapadd('keymap_', "D",
[['run -s2P "fdupes", "-S", "-n", ifopt("L", "-s"), "."',
'find duplicate files in the current directory',
'.*', 'non-recursive'],
['run -s2P "fdupes", "-S", "-n", ifopt("L", "-s"), "-r", "."',
'find duplicate files in the current directory recursively',
'rR', 'recursive']], ">C");
&mapadd('keymap_', "G",
[['run getcmd "go"',
'browse the URL guessed from the given piece(s)',
'gG', 'url pieces'],
['run -s "go", "url:" . gets "Go URL:"',
'browse the given URL',
'uUkK', 'url'],
['run -s "go", "proxy:" . gets "Go Proxy URL:"',
'browse the given URL via a proxy',
'x', 'url proxy (Google proxy)'],
['run -s "go", "info:" . gets "Go Info URL:"',
'browse the information about the given URL',
'iI', 'url info (Google Info)'],
['run -s "go", "cache:" . gets "Go Cache URL:"',
'browse the cached version of the given URL',
'c', 'url cache (Google cache)'],
['run -s "go", "arc:" . gets "Go Archive URL:"',
'browse historical versions of the given URL',
'vV', 'url versions (Wayback)'],
['run -s "auth", "-b", gets "Go Site:"',
'browse the results for the given login site query',
'lL', 'login'],
['run -s "grepbm", "-b", "-i", "--", gets "Go Regexp:"',
'browse the matched browser bookmarks',
'bB', 'bookmarks'],
['run -s "go", "search:" . gets "Go Search:"',
'browse the results for the given web search query',
's', 'search (Google)'],
['run -s "go", "priv:" . gets "Go Private:"',
'browse the results for the given private web search query',
'S', 'private (DuckDuckGo)'],
['run -s "go", "image:" . gets "Go Image:"',
'browse the results for the given web image search query',
'@', 'image (Google Images)'],
['run -s "go", "video:" . gets "Go Video:"',
'browse the results for the given web video search query',
'%', 'video (Google Video)'],
['run -s "go", "map:" . gets "Go Map:"',
'browse the results for the given map location query',
'^', 'map (Google Maps)'],
['run -s "go", "dir:" . gets "Go Directions:"',
'browse the results for the given map directions query',
'_', 'directions (Google Maps)'],
['run -s "go", "news:" . gets "Go News:"',
'browse the results for the given usenet search query',
'nN', 'news (Google Groups)'],
['run -s "go", "ask:" . gets "Go Ask:"',
'browse the matches for the given question',
'?', 'ask (Ask)'],
['run -s "go", "topic:" . gets "Go Topic:"',
'browse the matches for the given topic',
'tT', 'topic (Yahoo)'],
['run -s "go", "encyc:" . gets "Go Encyclopedia:"',
'browse the results for the given encyclopedia query',
'eE', 'encyclopedia (Wikipedia)'],
['run -s "go", "word:" . gets "Go Word:"',
'browse the results for the given dictionary query',
'wW', 'word (Dictionary)'],
['run -s "go", "en:" . gets "Go English:"',
'browse the results for the given English translation',
'<', 'english (Google Translate)'],
['run -s "go", "es:" . gets "Go Spanish:"',
'browse the results for the given Spanish translation',
'>', 'spanish (Google Translate)'],
['run -s "go", "perl:" . gets "Go Perl:"',
'browse the results for the given perl documentation query',
'p', 'perl (Perldoc)'],
['run -s "go", "cpan:" . gets "Go CPAN:"',
'browse the results for the given CPAN module query',
'P', 'cpan'],
['run -s "go", "user:" . gets "Go User:"',
'browse the results for the given user directory query',
'hH', 'user (U-M Directory)'],
['run -s "go", "phone:" . gets "Go Phonebook:"',
'browse the results for the given phonebook query',
'#', 'phone (Google PhoneBook)'],
['run -s "go", "city:" . gets "Go City:"',
'browse the results for the given city map query',
'C', 'city (City-Data)'],
['run -s "go", "book:" . gets "Go Book:"',
'browse the results for the given bookstore query',
'zZ', 'book (Amazon)'],
['run -s "go", "movie:" . gets "Go Movie:"',
'browse the results for the given movie database query',
'mM', 'movie (Netflix)'],
['run -s "go", do{ $cwd =~ /.*\/([^\/]+)\/([^\/]*)/; "cover:$1 $2" }',
'browse the results for the cover art database query'
. ' for this directory',
'[]', 'cover (Albumart)'],
['run -s "go", "soft:" . gets "Go Software:"',
'browse the results for the given software archive query',
'X', 'software (Freecode)'],
['run -s "go", "-a", "app:" . gets "Go Application:"',
'browse the results for the given application query',
'a', 'application (UM-HITS PlatServ)'],
['run -s "go", "and:" . gets "Go App:"',
'browse the results for the given Android app query',
'A', 'app (Android Market)'],
['run -s "go", "prod:" . gets "Go Product:"',
'browse the results for the given product search query',
'$', 'product (Google Products)'],
['run -s "go", "auct:" . gets "Go Auction:"',
'browse the results for the given auction search query',
'4', 'auction (eBay)'],
['run -s "webrowse", "-w", getfile("Go File (.):") || $cwd',
'browse the given file or directory (default current directory)',
'fF', 'file (default current directory)'],
['run -s "go", "kinzler", "me/daily.html"',
'browse my dailypage',
'/.'],
['run -s "webdaily", "-v"', 'browse my daily web pages',
'D'],
['run -s "webdaily", "ALL", "-v"', 'browse all my daily web pages',
'*8'],
['run -s "webdaily", "Mon", "-v"', 'browse my weekly web pages',
'd']], ">F");
&mapadd('keymap_', "H",
[['run -sr "dailyh"', 'update my home directory', 'hHdD', 'dailyh'],
['run -sr "dailyh -P"', 'push back mboxes', 'pPmM#', 'dailyh -P']],
">G");
&mapadd('keymap_', "J",
[['run -s2p "snaps -u"',
"list the user's current processes", 'ujJ','user'],
['run -s2p "snaps -s -l"',
'list all system processes', 's', 'system'],
['run -s2p "pstree -alp $user"',
"pstree list the user's current processes", 'U','user pstree'],
['run -s2p "pstree -alp"',
'pstree list all system processes', 'S','system pstree'],
['run -s2p "proctree -aTu $user"',
"proctree list the user's current processes",'V','user proctree'],
['run -s2p "proctree -aT"',
'proctree list all system processes', 'T','system proctree']],
">H");
&mapadd('keymap_', "K",
['run -sr "make";'
. ' $cwd eq untilde("~oracle/post") && longls("-win", 1)',
'run `make`'], ">J");
$keymap_{"M"}[0] =~ s/"make"/"mak"/;
&mapadd('keymap_', "N", $keymap_{"\cI"}, ">M");
$keymap_{"P"} =
['longls "-win", "whichpkg"',
'long list files with their owning package'];
$keymap_{"Q"} =
[['longls "-win", q(CERTINFO_OPENSSL_ARGS="-passin pass:dunno" )
. "certinfo -s \@_ 2>&1"',
'long list files with a summary of their certificate information',
'cCsS', 'certinfo'],
['longls "-win", q(CERTINFO_OPENSSL_ARGS="-passin pass:dunno" )
. "certinfo -K 2>&1"',
'long list files with the beginning of their certificate key',
'kK', 'certinfo key'],
[@{$keymap_{"Q"}}, '? ', 'prompt']];
$keymap_{"T"} =
[['run "top"', 'monitor system processes', 'tTpP', 'top'],
['run "htop"', 'interact with system processes', 'hH', 'htop'],
['run "iotop"', 'monitor system I/O', 'iIoO', 'i/o']];
&mapadd('keymap_', "W",
['cd($> && $user ne "kinzler" ? "~$user" : "~/work");'
. ' point "-\$"; win',
"cd to the user's working directory"], "X");
$keymap_{"Y"}[0] .= '; $cwd eq untilde("~/work") && msg filecount';
$keymap_{"`"}[0] =~ s/r "cal -3/g "today/;
&mapadd('keymap_choose', "<",
['run -s+ruk "pushmime"',
'explode the chosen mail messages/folders into directories'], ">;");
$keymap_choose{"D"} =
[['run -#buk "rm -r"',
'recursively remove the chosen files/directories (background)',
'dDrR', 'recursive remove'],
['run -#buk "srm -rs"', '1-pass'
. ' recursively remove the chosen files/directories (background)',
'1', '1-pass recursive remove'],
['run -#buk "srm -rE"', '3-pass'
. ' recursively remove the chosen files/directories (background)',
'3', '3-pass recursive remove'],
['run -#buk "srm -rD"', '7-pass'
. ' recursively remove the chosen files/directories (background)',
'7', '7-pass recursive remove'],
['run -#buk "srm -r"', '35-pass'
. ' recursively remove the chosen files/directories (background)',
'sS', '35-pass recursive remove']];
$keymap_choose{"E"}[0] = 'run -s#uk $cfg::editor';
$keymap_choose{"I"}[0] = 'run -x+uk "xv"';
&mapadd('keymap_choose', "J",
['run -sruk "push", "--", @choose, getfile "Directory:"',
'push the chosen files into the given directory'], ">I");
&mapadd('keymap_choose', "K",
['run -s#ruk "pop"', 'pop files out of the chosen directories'],">J");
&mapadd('keymap_choose', "M",
[['run -puk "exiftool -a -u -g1", quote(@choose),'
. ' q(| sed "s/^==*/########/")',
'list the metadata of the chosen files',
'lLmM', 'list metadata'],
['run -+ruk qw(exiftool -geotag= -P -overwrite_original)',
'erase the geotag metadata of the chosen files',
'gG', 'erase geotags'],
['run -+ruk qw(exiftool -all= -P -overwrite_original)',
'erase all the metadata of the chosen files',
'eE', 'erase metadata']], ">K");
&mapadd('keymap_choose', "P",
[[&cfg::mapchoose('run "-sn", "mount", absfile $_'),
'mount the chosen directories', 'mM', 'mount'],
[&cfg::mapchoose('run "-sn", "sshfs", "-o", "idmap=user",'
. ' gets("Ssh Directory:"), absfile $_'),
'ssh mount the chosen directories', 'sS', 'ssh mount'],
['run "-s", "google-drive-ocamlfuse"',
'initialize google mounting', 'iI', 'google init'],
[&cfg::mapchoose('run "-sn", "google-drive-ocamlfuse", absfile $_'),
'google mount the chosen directories', 'gG', 'google mount'],
[&cfg::mapchoose('run "-sn", "unmount", absfile $_'),
'unmount the chosen directories', 'uU', 'unmount'],
[&cfg::mapchoose('run "-sn", "fusermount", "-u", absfile $_'),
'fuse unmount the chosen directories', 'fF', 'fuse unmount'],
[&cfg::mapchoose('run "-sn", "eject", absfile $_'),
'eject the chosen directories', 'eE', 'eject']], "R");
&mapadd('keymap_choose', "Z",
['run -#buk "z"', '(un)tar and (de)feather the chosen files'
. ' and directories (background)'], ">R");
&mapadd('keymap_choose', "_",
['run -+uk "_"', 'rename the chosen files without whitespace'], "`");
&mapset('mousemap_', 'user',
[[@{$keymap_{"~"}}, &mev2c('1u')],
[@{$keymap_{"W"}}, &mev2c('3u')],
[@{$keymap_{","}}, &mev2c('Wd')],
[@{$keymap_{","}}, &mev2c('Wu')]]);
sub cfg::onecmd { $ch eq 'mous' }
sub rccolorlong {
local $_ = join('', @_);
return &colorlongline($_, $co_msg)
if $long =~ /\b(whichpkg|certinfo)\b/
&& /n[o'](t| path) (owned|found)/i;
return &colorlongline($_, $co_error)
if $long =~ /\bcertinfo\b/ && /^\S*certinfo:/;
my $rwx = '[-r][-w][-x]';
s/\b(?:(d)(:))?([ugmo]):(?:(\w*)(:))?($rwx)(?:(#)($rwx))?/
&color($1, $co_sbits) . $2 .
&color($3, $co_ftype) . ':' .
&color($4, $co_user{$4} || $co_user{''}) . $5 .
&color($6, $co_perms) . $7 .
&color($8, $co_myper)/ge ||
s/([^\\\s]+) (r?l?i?d?w?k?a?)(, |\\|$)/
&color($1, $co_user{$1} || $co_user{''}) . ' ' .
&color($2, $co_perms) . $3
/ge if $long =~ /^\s*lsacl\b/;
$_;
}
sub rc::edtags {
my %tags = ();
foreach my $tags ('tags', 'etc/tags', "$ENV{HOME}/etc/tags") {
next unless open(TAGS, $tags);
while (<TAGS>) {
next if /^!_TAG_/;
chomp; s/\t.*//; $tags{$_}++;
}
close TAGS;
}
sort keys %tags;
}
1;