# Global Complete File # Add or modify these variables in your own ~/.tcshrc.private # # $Id: complete.tcsh,v 1.28 1995/05/06 17:51:58 christos Exp $ # example file using the new completion code # # modified by Jens Elkner onintr - if ($?prompt) then set noglob # add something like this to your ~/.tcshrc.1st : # set hosts = ( hostA hostB hostC ) # cat master/141.44.24.0 master/141.44.21.0 | /usr/xpg4/bin/awk \ # '/^[[:digit:]]+[[:space:]]PTR/ { print substr($3,0,index($3,".")-1) }' \ # | sort -u | xargs if ( ! $?hosts ) then set hosts = ( ad adc alumni antgame apophis aprikose arts atlantis b4 baal barclay baron baron-c berlin birne cia corona cronus crusade crusher day directory docs dommel ecgb edu edub edux edux2 edux3 edux4 eduxb eibe enterprise eule faraweb fate fichte finca forums ftp fuerst fuzzy fuzzy2 fuzzydb graf grex gw hathor helios hermelin herzog herzog2 hippo hoshi i386 id idc idev idev2 iltis indiana isis island iws iws2 iwsdb jira john jones jvm kaiser kauz kgb kiefer knecht knechtFB koenig koenig-c laforge last lics liz loom lore lucas luftwaffe madrid mail mail2 marder monkey nerz np ns ns2 otter p3x-242 p3x-333 p3x-336 paris pdc2 pfirsich pflaume picard pkg prag prinz prinz-c q quitte ra riga riker ro rom sam sbs sdev secret sofia sokar sparc src stuko svn tanne tentacle test2 theo theo2 theodb tpol trex trip2 troi ts uhu wappon wdok wdok2 web2 wien winhome2 worf www yar yu zcs ) endif complete rsh p/1/\$hosts/ c/-/"(l n)"/ \ n/-l/u/ N/-l/c/ n/-/c/ p/2/c/ p/*/f/ complete rlogin p/1/\$hosts/ c/-/"(l e)"/ n/-l/u/ complete telnet p/1/\$hosts/ p/2/x:''/ n/*/n/ complete {ssh,r} p/1/\$hosts/ complete {utgz,uctgz} p/*/f:*.{tgz,tar.gz}/ complete {utbz,uctbz} p/*/f:*.{tbz2,tar.bz2}/ complete cd p/1/d/ # Directories only complete chdir p/1/d/ complete pushd p/1/d/ complete popd p/1/d/ complete complete p/1/X/ # Completions only complete uncomplete n/*/X/ complete set 'c/*=/f/' 'p/1/s/=' 'n/=/f/' complete unset n/*/s/ complete alias p/1/a/ # only aliases are valid complete unalias n/*/a/ complete which n/*/c/ complete where n/*/c/ complete {+,pfexec,exec} p/1/c/ # Commands only complete acroread p/*/f:*.{pdf,PDF}/ complete evince p/*/f:*.{ps,PS}/ complete soffice p/*/f:*.{odt,ods,odp,odg,odc,odf,odi,odm,ott,ots,otp,otg,doc,docm,docx,dot,dotx,dotm,pot,potm,potx,ppt,pptx,xls,xlsm,xlsx,xlt,xltm,xltx}/ complete svn \ 'n@help@(add blame cat checkout cleanup commit copy delete export help \ import info list ls lock log merge mkdir move propdel propedit \ propget proplist propset resolved revert status switch unlock \ update)@' \ 'p@1@(add blame cat checkout cleanup commit copy delete export help \ import info list ls lock log merge mkdir move propdel propedit \ propget proplist propset resolved revert status switch unlock \ update)@' complete trace p/1/c/ complete strace p/1/c/ complete pkill p/1/c/ complete dbx c/-I/d/ n/-/c/ N/-/"(core)"/ p/1/c/ p/2/"(core)"/ complete gdb n/-d/d/ n/*/c/ complete xdvi n/*/f:*.dvi/ # Only files that match *.dvi complete dvips n/*/f:*.dvi/ complete tex n/*/f:*.tex/ # Only files that match *.tex complete latex n/*/f:*.{tex,ltx}/ complete su c/--/"(login fast preserve-environment command shell \ help version)"/ c/-/"(f l m p c s -)"/ \ n/{-c,--command}/c/ \ n@{-s,--shell}@'`cat /etc/shells`'@ n/*/u/ complete cc c/-[IL]/d/ \ c@-l@'`\ls -1 /usr/lib/lib*.a | sed s%^.\*/lib%%\;s%\\.a\$%%`'@ \ c/-/"(o l c g L I D U)"/ n/*/f:*.[coasi]/ complete gcc c/-[IL]/d/ \ c/-f/"(caller-saves cse-follow-jumps delayed-branch \ elide-constructors expensive-optimizations \ float-store force-addr force-mem inline \ inline-functions keep-inline-functions \ memoize-lookups no-default-inline \ no-defer-pop no-function-cse omit-frame-pointer \ rerun-cse-after-loop schedule-insns \ schedule-insns2 strength-reduce \ thread-jumps unroll-all-loops \ unroll-loops syntax-only all-virtual \ cond-mismatch dollars-in-identifiers \ enum-int-equiv no-asm no-builtin \ no-strict-prototype signed-bitfields \ signed-char this-is-variable unsigned-bitfields \ unsigned-char writable-strings call-saved-reg \ call-used-reg fixed-reg no-common \ no-gnu-binutils nonnull-objects \ pcc-struct-return pic PIC shared-data \ short-enums short-double volatile)"/ \ c/-W/"(all aggregate-return cast-align cast-qual \ comment conversion enum-clash error format \ id-clash-len implicit missing-prototypes \ no-parentheses pointer-arith return-type shadow \ strict-prototypes switch uninitialized unused \ write-strings)"/ \ c/-m/"(68000 68020 68881 bitfield fpa nobitfield rtd \ short c68000 c68020 soft-float g gnu unix fpu \ no-epilogue)"/ \ c/-d/"(D M N)"/ \ c/-/"(f W vspec v vpath ansi traditional \ traditional-cpp trigraphs pedantic x o l c g L \ I D U O O2 C E H B b V M MD MM i dynamic \ nodtdlib static nostdinc undef)"/ \ c/-l/f:*.a/ \ n/*/f:*.{c,C,cc,o,a,s,i}/ complete g++ n/*/f:*.{C,cc,o,s,i}/ complete CC n/*/f:*.{C,cc,o,s,i}/ complete rm c/--/"(directory force interactive verbose \ recursive help version)"/ c/-/"(d f i v r R -)"/ n/*/f:*/ complete vi n/*/f:^*.[oa]/ complete bindkey N/-a/b/ N/-c/c/ n/-[ascr]/'x:'/ \ n/-[svedlr]/n/ c/-[vedl]/n/ c/-/"(a s k c v e d l r)"/\ n/-k/"(left right up down)"/ p/2-/b/ \ p/1/'x:'/ complete find n/-fstype/"(nfs 4.2)"/ n/-name/f/ \ n/-type/"(c b d f p l s)"/ n/-user/u/ n/-group/g/ \ n/-exec/c/ n/-ok/c/ n/-cpio/f/ n/-ncpio/f/ n/-newer/f/ \ c/-/"(fstype name perm prune type user nouser \ group nogroup size inum atime mtime ctime exec \ ok print ls cpio ncpio newer xdev depth \ daystart follow maxdepth mindepth noleaf version \ anewer cnewer amin cmin mmin true false uid gid \ ilname iname ipath iregex links lname empty path \ regex used xtype fprint fprint0 fprintf \ print0 printf not a and o or)"/ \ n/*/d/ complete -%* c/%/j/ # fill in the jobs builtin complete {fg,bg,stop} c/%/j/ p/1/"(%)"// complete limit c/-/"(h)"/ n/*/l/ complete unlimit c/-/"(h)"/ n/*/l/ complete -co* p/0/"(compress)"/ # make compress completion not ambiguous complete zcat c/--/"(force help license quiet version)"/ \ c/-/"(f h L q V -)"/ n/*/f:*.{gz,Z,z,zip}/ complete nm n/*/f:^*.{h,C,c,cc}/ complete finger c/*@/\$hosts/ n/*/u/@ complete ping p/1/\$hosts/ complete traceroute c/-/"(I)"/ p/1/\$hosts/ complete talk p/1/'`users | tr " " "\012" | uniq`'/ \ n/*/\`who\ \|\ grep\ \$:1\ \|\ awk\ \'\{\ print\ \$2\ \}\'\`/ complete ftp c/-/"(d i g n v)"/ n/-/\$hosts/ p/1/\$hosts/ n/*/n/ # From Michael Schroeder # This one will rsh to the file to fetch the list of files! complete rcp 'c%*@*:%`set q=$:-0;set q="$q:s/@/ /";set q="$q:s/:/ /";set q=($q " ");rsh $q[2] -l $q[1] ls -dp $q[3]\*`%' 'c%*:%`set q=$:-0;set q="$q:s/:/ /";set q=($q " ");rsh $q[1] ls -dp $q[2]\*`%' 'c%*@%$hosts%:' 'C@[./$~]*@f@' 'n/*/$hosts/:' complete dd c/--/"(help version)"/ c/[io]f=/f/ \ c/conv=*,/"(ascii ebcdic ibm block unblock \ lcase ucase swab noerror sync)"/,\ c/conv=/"(ascii ebcdic ibm block unblock \ lcase ucase swab noerror sync)"/,\ c/*=/x:''/ \ n/*/"(if of conv ibs obs bs cbs files skip file seek count)"/= complete nslookup p/1/x:''/ p/2/\$hosts/ complete ar c/[dmpqrtx]/"(c l o u v a b i)"/ p/1/"(d m p q r t x)"// \ p/2/f:*.a/ p/*/f:*.o/ # these and interrupt handling from Jaap Vermeulen complete rexec \ 'p/1/$hosts/' 'c/-/(l L E)/' 'n/-l/u/' 'n/-L/f/' 'n/-E/e/' 'n/*/c/' complete kill 'c/-/S/' 'c/%/j/' \ 'n/*/`ps -u $LOGNAME | awk '"'"'{print $1}'"'"'`/' # these from E. Jay Berkenbilt complete ./configure 'c/--*=/f/' 'c/--{cache-file,prefix,srcdir}/(=)//' \ 'c/--/(cache-file verbose prefix srcdir)//' complete gs 'c/-sDEVICE=/(x11 cdjmono cdj550 epson eps9high epsonc \ dfaxhigh dfaxlow laserjet ljet4 sparc pbm \ pbmraw pgm pgmraw ppm ppmraw bit)/' \ 'c/-sOutputFile=/f/' 'c/-s/(DEVICE OutputFile)/=' \ 'c/-d/(NODISPLAY NOPLATFONTS NOPAUSE)/' 'n/*/f/' complete perl 'n/-S/c/' complete printenv 'n/*/e/' # complete sccs p/1/"(admin cdc check clean comb deledit delget \ # delta diffs edit enter fix get help info \ # print prs prt rmdel sccsdiff tell unedit unget val what)"/ complete setenv 'p/1/e/' 'c/*:/f/' # these from Tom Warzeka # you may need to set the following variables for your host set _elispdir = /local/usr/share/emacs/site-lisp # lisp directory set _maildir = /var/mail set _domain = "`domainname`" # this one works but is slow and doesn't descend into subdirectories # complete cd C@[./\$~]*@d@ \ # p@1@'`\ls -1F . $cdpath | grep /\$ | sort -u`'@ n@*@n@ complete setenv p@1@e@ n@DISPLAY@\$hosts@: complete unsetenv n/*/e/ if (-r $HOME/.mailrc) then complete mail c/-/"(e i f n s u v)"/ c/*@/\$hosts/ \ c@+@F:$HOME/Mail@ C@[./\$~]@f@ n/-s/x:''/ \ n@-u@T:$_maildir@ n/-f/f/ \ n@*@'`sed -n s/alias//p $HOME/.mailrc | tr -s " " " " | cut -f 2`'@ else complete mail c/-/"(e i f n s u v)"/ c/*@/\$hosts/ \ c@+@F:$HOME/Mail@ C@[./\$~]@f@ n/-s/x:''/ \ n@-u@T:$_maildir@ n/-f/f/ n/*/u/ endif complete man n@1@'`\ls -1 /usr/man/man1 | sed s%\\.1.\*\$%%`'@ \ n@2@'`\ls -1 /usr/man/man2 | sed s%\\.2.\*\$%%`'@ \ n@3@'`\ls -1 /usr/man/man3 | sed s%\\.3.\*\$%%`'@ \ n@4@'`\ls -1 /usr/man/man4 | sed s%\\.4.\*\$%%`'@ \ n@5@'`\ls -1 /usr/man/man5 | sed s%\\.5.\*\$%%`'@ \ n@6@'`\ls -1 /usr/man/man6 | sed s%\\.6.\*\$%%`'@ \ n@7@'`\ls -1 /usr/man/man7 | sed s%\\.7.\*\$%%`'@ \ n@8@'`\ls -1 /usr/man/man8 | sed s%\\.8.\*\$%%`'@ \ n@9@'`[ -r /usr/man/man9 ] && \ls -1 /usr/man/man9 | sed s%\\.9.\*\$%%`'@ \ n@0@'`[ -r /usr/man/man0 ] && \ls -1 /usr/man/man0 | sed s%\\.0.\*\$%%`'@ \ n@new@'`[ -r /usr/man/mann ] && \ls -1 /usr/man/mann | sed s%\\.n.\*\$%%`'@ \ n@old@'`[ -r /usr/man/mano ] && \ls -1 /usr/man/mano | sed s%\\.o.\*\$%%`'@ \ n@local@'`[ -r /usr/man/manl ] && \ls -1 /usr/man/manl | sed s%\\.l.\*\$%%`'@ \ n@public@'`[ -r /usr/man/manp ]&& \ls -1 /usr/man/manp | sed s%\\.p.\*\$%%`'@ \ c/-/"(- f k P s t)"/ n/-f/c/ n/-k/x:''/ n/-P/d/ \ N@-P@'`\ls -1 $:-1/man? | sed s%\\..\*\$%%`'@ n/*/c/ complete ps c/-t/x:''/ c/-/"(a c C e g k l S t u v w x)"/ \ n/-k/x:''/ N/-k/x:''/ n/*/x:''/ complete compress c/-/"(c f v b)"/ n/-b/x:''/ n/*/f:^*.Z/ complete uncompress c/-/"(c f v)"/ n/*/f:*.Z/ complete xhost c/[+-]/\$hosts/ n/*/\$hosts/ # these conform to the latest GNU versions available at press time ... complete emacs c/-/"(batch d f funcall i insert kill l load \ no-init-file nw q t u user)"/ c/+/x:''/ \ n/-d/x:''/ n/-f/x:''/ n/-i/f/ \ n@-l@F:$_elispdir@ n/-t/x:''/ n/-u/u/ n/*/f:^*[\#~]/ complete gzcat c/--/"(force help license quiet version)"/ \ c/-/"(f h L q V -)"/ n/*/f:*.{gz,Z,z,zip}/ complete gzip c/--/"(stdout to-stdout decompress uncompress \ force help list license no-name quiet recurse \ suffix test verbose version fast best)"/ \ c/-/"(c d f h l L n q r S t v V 1 2 3 4 5 6 7 8 9 -)"/\ n/{-S,--suffix}/x:''/ \ n/{-d,--{de,un}compress}/f:*.{gz,Z,z,zip,taz,tgz}/ \ N/{-d,--{de,un}compress}/f:*.{gz,Z,z,zip,taz,tgz}/ \ n/*/f:^*.{gz,Z,z,zip,taz,tgz}/ complete {gunzip,ungzip} c/--/"(stdout to-stdout force help list \ license no-name quiet recurse suffix test verbose version)"/ \ c/-/"(c f h l L n q r S t v V -)"/ \ n/{-S,--suffix}/x:''/ \ n/*/f:*.{gz,Z,z,zip,taz,tgz}/ complete zgrep c/-*A/x:'<#_lines_after>'/ c/-*B/x:'<#_lines_before>'/\ c/-/"(A b B c C e f h i l n s v V w x)"/ \ p/1/x:''/ \ n/-*e/x:''/ n/-*f/f/ n/*/f/ complete zegrep c/-*A/x:'<#_lines_after>'/ c/-*B/x:'<#_lines_before>'/\ c/-/"(A b B c C e f h i l n s v V w x)"/ \ p/1/x:''/ \ n/-*e/x:''/ n/-*f/f/ n/*/f/ complete zfgrep c/-*A/x:'<#_lines_after>'/ c/-*B/x:'<#_lines_before>'/\ c/-/"(A b B c C e f h i l n s v V w x)"/ \ p/1/x:''/ \ n/-*e/x:''/ n/-*f/f/ n/*/f/ complete grep c/-*A/x:'<#_lines_after>'/ c/-*B/x:'<#_lines_before>'/\ c/-/"(A b B c C e f h i l n s v V w x)"/ \ p/1/x:''/ \ n/-*e/x:''/ n/-*f/f/ n/*/f/ complete egrep c/-*A/x:'<#_lines_after>'/ c/-*B/x:'<#_lines_before>'/\ c/-/"(A b B c C e f h i l n s v V w x)"/ \ p/1/x:''/ \ n/-*e/x:''/ n/-*f/f/ n/*/f/ complete fgrep c/-*A/x:'<#_lines_after>'/ c/-*B/x:'<#_lines_before>'/\ c/-/"(A b B c C e f h i l n s v V w x)"/ \ p/1/x:''/ \ n/-*e/x:''/ n/-*f/f/ n/*/f/ complete users c/--/"(help version)"/ p/1/x:''/ complete who c/--/"(heading mesg idle count help message version \ writable)"/ c/-/"(H T w i u m q s -)"/ \ p/1/x:''/ n/am/"(i)"/ n/are/"(you)"/ complete chown c/--/"(changes silent quiet verbose recursive help \ version)"/ c/-/"(c f v R -)"/ C@[./\$~]@f@ c/*[.:]/g/ \ n/-/u/. p/1/u/. n/*/f/ complete chgrp c/--/"(changes silent quiet verbose recursive help \ version)"/ c/-/"(c f v R -)"/ n/-/g/ p/1/g/ n/*/f/ complete cat c/--/"(number-nonblank number squeeze-blank show-all \ show-nonprinting show-ends show-tabs help version)"/ \ c/-/"(b e n s t u v A E T -)"/ n/*/f/ # complete mv c/--/"(backup force interactive update verbose suffix \ # version-control help version)"/ \ # c/-/"(b f i u v S V -)"/ \ # n/{-S,--suffix}/x:''/ \ # n/{-V,--version-control}/"(t numbered nil existing \ # never simple)"/ n/-/f/ N/-/d/ p/1/f/ p/2/d/ n/*/f/ # complete cp c/--/"(archive backup no-dereference force interactive \ # link preserve symbolic-link update verbose parents \ # one-file-system recursive suffix version-control help \ # version)"/ c/-/"(a b d f i l p r s u v x P R S V -)"/ \ # n/-*r/d/ n/{-S,--suffix}/x:''/ \ # n/{-V,--version-control}/"(t numbered nil existing \ # never simple)"/ n/-/f/ N/-/d/ p/1/f/ p/2/d/ n/*/f/ complete ln c/--/"(backup directory force interactive symbolic \ verbose suffix version-control help version)"/ \ c/-/"(b d F f i s v S V -)"/ \ n/{-S,--suffix}/x:''/ \ n/{-V,--version-control}/"(t numbered nil existing never simple)"/ \ n/-/f/ N/-/x:''/ p/1/f/ p/2/x:''/ complete touch c/--/"(date file help time version)"/ \ c/-/"(a c d f m r t -)"/ \ n/{-d,--date}/x:''/ \ c/--time/"(access atime mtime modify use)"/ \ n/{-r,--file}/f/ n/-t/x:''/ n/*/f/ complete mkdir c/--/"(parents help version mode)"/ c/-/"(p m -)"/ \ n/{-m,--mode}/x:''/ n/*/d/ complete rmdir c/--/"(parents help version)"/ c/-/"(p -)"/ n/*/d/ complete tar c/-[Acru]*/"(b B C f F g G h i l L M N o P \ R S T v V w W X z Z)"/ \ c/-[dtx]*/"( B C f F g G i k K m M O p P R s S T v w x X z Z)"/ \ p/1/"(A c d r t u x -A -c -d -r -t -u -x \ --catenate --concatenate --create --diff --compare \ --delete --append --list --update --extract --get)"/ \ c/--/"(catenate concatenate create diff compare \ delete append list update extract get atime-preserve \ block-size read-full-blocks directory checkpoint file \ force-local info-script new-volume-script incremental \ listed-incremental dereference ignore-zeros \ ignore-failed-read keep-old-files starting-file \ one-file-system tape-length modification-time \ multi-volume after-date newer old-archive portability \ to-stdout same-permissions preserve-permissions \ absolute-paths preserve record-number remove-files \ same-order preserve-order same-owner sparse \ files-from null totals verbose label version \ interactive confirmation verify exclude exclude-from \ compress uncompress gzip ungzip use-compress-program \ block-compress)"/ \ c/-/"(b B C f F g G h i k K l L m M N o O p P R s S \ T v V w W X z Z 0 1 2 3 4 5 6 7 -)"/ \ n/-c*f/x:''/ \ n/{-[Adrtux]*f,--file}/f:*.tar/ \ N/{-x*f,--file}/'`tar -tf $:-1`'/ \ n/--use-compress-program/c/ \ n/{-b,--block-size}/x:''/ \ n/{-V,--label}/x:''/ \ n/{-N,--{after-date,newer}}/x:''/ \ n/{-L,--tape-length}/x:''/ \ n/{-C,--directory}/d/ \ N/{-C,--directory}/'`\ls $:-1`'/ \ n/-[0-7]/"(l m h)"/ # BSD 4.3 filesystems # complete mount c/-/"(a h v t r)"/ n/-h/\$hosts/ n/-t/"(4.2 nfs)"/ \ # n@*@'`cut -d " " -f 2 /etc/fstab`'@ # complete umount c/-/"(a h v t)"/ n/-h/\$hosts/ n/-t/"(4.2 nfs)"/ \ # n/*/'`mount | cut -d " " -f 3`'/ # there's no need to clutter the user's shell with these unset _elispdir _maildir _ypdir _domain complete make 'n/-f/f/' 'c/*=/f/' \ 'n@*@`cat -s GNUmakefile Makefile makefile |& sed -n -e "/No such file/d" -e "/^[^ #].*:/s/:.*//p"`@' if ( -f /etc/printcap ) then set printers=(`sed -n -e "/^[^ #].*:/s/:.*//p" /etc/printcap`) complete lpr 'c/-P/$printers/' complete lpq 'c/-P/$printers/' complete lprm 'c/-P/$printers/' complete lpquota 'p/1/(-Qprlogger)/' 'c/-P/$printers/' complete dvips 'c/-P/$printers/' 'n/-o/f:*.{ps,PS}/' 'n/*/f:*.dvi/' endif unset noglob endif onintr