xref: /freebsd/share/examples/csh/dot.cshrc (revision 3ef51c5fb9163f2aafb1c14729e06a8bf0c4d113)
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# Some common completions
25complete chown          'p/1/u/'
26complete man            'C/*/c/'
27complete service        'n/*/`service -l`/'
28complete service  	'c/-/(e l r v)/' 'p/1/`service -l`/' 'n/*/(start stop reload restart status rcvar onestart onestop)/'
29complete kldunload	'n@*@`kldstat | awk \{sub\(\/\.ko\/,\"\",\$NF\)\;print\ \$NF\} | grep -v Name` @'
30complete make           'n@*@`make -pn | sed -n -E "/^[#_.\/[:blank:]]+/d; /=/d; s/[[:blank:]]*:.*//gp;"`@'
31complete pkg_delete     'c/-/(i v D n p d f G x X r)/' 'n@*@`ls /var/db/pkg`@'
32complete 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 svar/db/pkg/%%`@"
33complete kill		'c/-/S/' 'c/%/j/' 'n/*/`ps -ax | awk '"'"'{print $1}'"'"'`/'
34complete killall	'c/-/S/' 'c/%/j/' 'n/*/`ps -ax | awk '"'"'{print $5}'"'"'`/'
35complete dd		'c/[io]f=/f/ n/*/"(if of ibs obs bs skip seek count)"/='
36alias _PKGS_PkGs_PoRtS_ 'awk -F\| \{sub\(\"\/usr\/ports\/\"\,\"\"\,\$2\)\;print\ \$2\} /usr/ports/INDEX-name -r | cut -d . -f 1A
37alias _PKGS_PkGs_PoRtS_ 'awk -F\| \{sub\(\"\/usr\/ports\/\"\,\"\"\,\$2\)\;print\ \$2\} /usr/ports/INDEX-`uname -r | cut -d . -f 1`&& pkg_info -E \*'
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_`@'
45
46# Alternate prompts
47set prompt = '#'
48set prompt = '%B%m%b%# '
49set prompt = '%B%m%b:%c03:%# '
50set prompt = '%{\033]0;%n@%m:%/\007%}%B%m%b:%c03:%# '
51set prompt = "%n@%m %c04%m%# "
52set prompt = "%n@%m:%c04 %# "
53set prompt = "[%n@%m]%c04%# "
54set ellipsis
55
56# Color ls
57alias ll	ls -lAhG
58alias ls	ls -G
59
60# Color on many system utilities
61setenv CLICOLOR 1
62
63# other autolist options
64set		autolist = TAB
65