Browse Source

add useful completions to default profile

master
parent
commit
194f71b993
  1. 45
      bash/profile

45
bash/profile

@ -18,7 +18,7 @@ export TMOUT=3600
# environment permissions
umask 022
ulimit -c 16384
if expr $- : ".*i.*" >/dev/null; then
if [ ".$PS1" != . ]; then
mesg y
fi
@ -33,6 +33,49 @@ export TMPDIR=/tmp
export TEMPDIR=$TMPDIR
export BLOCKSIZE=1024
# turn on extended globbing
shopt -s extglob no_empty_cmd_completion
# make directory commands see only directories
complete -d cd mkdir rmdir pushd
# make file commands see only (their) files
complete -f cat less more ln strip
complete -f -X '*.bz2' bzip2
complete -f -X '!*.bz2' bunzip2
complete -f -X '!*.zip' unzip
complete -f -X '*.gz' gzip
complete -f -X '*.Z' compress
complete -f -X '!*.+(Z|gz|tgz|Gz)' gunzip zcat zmore
complete -f -X '!*.Z' uncompress zmore zcat
complete -f -X '!*.+(gif|jpg|jpeg|GIF|JPG|bmp)' xv display
complete -f -X '!*.+(ps|PS|ps.gz)' gv gs mgv
complete -f -X '!*.+(dvi|DVI)' dvips xdvi
complete -f -X '!*.+(pdf|PDF)' acroread xpdf
complete -f -X '!*.texi*' makeinfo texi2dvi texi2html
complete -f -X '!*.+(tex|TEX)' tex latex
complete -f -X '!*.+(c|cc|C|h|hh|H)' cc gcc
# make signal and job commands see only signals/jobs
complete -A signal kill -P '%'
complete -A stopped -P '%' bg
complete -j -P '%' fg jobs
# make user/group commands see only users/groups
complete -u passwd su finger
complete -u passwd
# make network commands see only hostnames
complete -A hostname ssh rsh telnet rlogin ftp ping host traceroute nslookup dig
# make internal commands see only their possibilities
complete -v export local readonly unset
complete -A setopt set
complete -A shopt shopt
complete -A helptopic help
complete -a unalias
complete -A binding bind
# convinient root priviledge switching
root () {
if [ $# -eq 0 -o ".$1" = ".-i" ]; then

Loading…
Cancel
Save