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