1# Here are some example (t)csh options and configurations that you may find interesting 2# 3# $FreeBSD$ 4# 5 6# Sets SSH_AUTH_SOCK to the user's ssh-agent socket path if running 7if (${?SSH_AUTH_SOCK} != "1") then 8 setenv SSH_AUTH_SOCK `sockstat | grep "${USER}" | cut -d ' ' -f 6` 9endif 10 11# Change only root's prompt 12if (`id -g` == 0) 13 set prompt="root@%m# " 14endif 15 16# This maps the "Delete" key to do the right thing 17# Pressing CTRL-v followed by the key of interest will print the shell's 18# mapping for the key 19bindkey "^[[3~" delete-char-or-list-or-eof 20 21# Make the Ins key work 22bindkey "\e[2~" overwrite-mode 23 24# Aliases used for completions 25alias _PKGS_PkGs_PoRtS_ 'awk -F\| \{sub\(\"\/usr\/ports\/\"\,\"\"\,\$2\)\;print\ \$2\} /usr/ports/INDEX-name -r | cut -d . -f 1' 26alias _PKGS_PkGs_PoRtS_ 'awk -F\| \{sub\(\"\/usr\/ports\/\"\,\"\"\,\$2\)\;print\ \$2\} /usr/ports/INDEX-`uname -r | cut -d . -f 1`&& pkg_info -E \*' 27 28# Some common completions 29complete chown 'p/1/u/' 30complete dd 'c/[io]f=/f/ n/*/"(if of ibs obs bs skip seek count)"/=' 31complete kill 'c/-/S/' 'c/%/j/' 'n/*/`ps -ax | awk '"'"'{print $1}'"'"'`/' 32complete killall 'c/-/S/' 'c/%/j/' 'n/*/`ps -ax | awk '"'"'{print $5}'"'"'`/' 33complete kldunload 'n@*@`kldstat | awk \{sub\(\/\.ko\/,\"\",\$NF\)\;print\ \$NF\} | grep -v Name` @' 34complete make 'n@*@`make -pn | sed -n -E "/^[#_.\/[:blank:]]+/d; /=/d; s/[[:blank:]]*:.*//gp;"`@' 35complete man 'C/*/c/' 36complete pkg_delete 'c/-/(i v D n p d f G x X r)/' 'n@*@`ls /var/db/pkg`@' 37complete pkg_info 'c/-/(a b v p q Q c d D f g i I j k K r R m L s o G O x X e E l t V P)/' 'n@*@`\ls -1 /var/db/pkg | sed s%/var/db/pkg/%%`@' 38complete portmaster 'c/--/(always-fetch check-depends check-port-dbdir clean-distfiles \ 39 clean-packages delete-build-only delete-packages force-config help \ 40 index index-first index-only list-origins local-packagedir no-confirm \ 41 no-index-fetch no-term-title packages packages-build packages-if-newer \ 42 packages-local packages-only show-work update-if-newer version)/' \ 43 'c/-/(a b B C d D e f F g G h H i l L m n o p r R s t u v w x)/' \ 44 'n@*@`_PKGS_PkGs_PoRtS_`@' 45complete service 'c/-/(e l r v)/' 'p/1/`service -l`/' 'n/*/(start stop reload restart status rcvar onestart onestop)/' 46complete sysctl 'n/*/`sysctl -Na`/' 47 48# Alternate prompts 49set prompt = '#' 50set prompt = '%B%m%b%# ' 51set prompt = '%B%m%b:%c03:%# ' 52set prompt = '%{\033]0;%n@%m:%/\007%}%B%m%b:%c03:%# ' 53set prompt = "%n@%m %c04%m%# " 54set prompt = "%n@%m:%c04 %# " 55set prompt = "[%n@%m]%c04%# " 56set ellipsis 57 58# Color ls 59alias ll ls -lAhG 60alias ls ls -G 61 62# Color on many system utilities 63setenv CLICOLOR 1 64 65# other autolist options 66set autolist = TAB 67