]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - contrib/tcsh/dot.tcshrc
unbound: Vendor import 1.14.0
[FreeBSD/FreeBSD.git] / contrib / tcsh / dot.tcshrc
1 #
2 # ~/.tcshrc - Setup user shell environment
3 #
4 # See also tcsh(1), environ(7).
5 #
6
7 unalias *
8
9 alias   h       'history \!* 20'
10 alias   j       'jobs -l'
11 alias   ll      'ls -lAF'
12 alias   md      mkdir
13 alias   rd      rmdir
14
15 #
16 # The following commands are only for interactive shells.
17 #
18
19 if ( $?prompt ) then
20   set \
21     autocorrect \
22     autoexpand \
23     autolist=ambiguous \
24     correct=cmd \
25     ellipsis \
26     filec \
27     history=1000 \
28     killdup=erase \
29     listjobs=long \
30     listlinks \
31     listmax=100 \
32     nobeep \
33     prompt='%N@%m:%B%c02%b%# ' \
34     rmstar \
35     savehist=(1000 merge) \
36
37   unset promptchars
38
39   if ( $?tcsh ) then
40     bindkey -e
41
42     bindkey " " magic-space
43     bindkey ^W backward-delete-word
44     bindkey ^Z run-fg-editor
45     bindkey ^[^W kill-region
46
47     #
48     # Setup $hosts from ~/.hosts, ~/.rhosts, ~/.ssh/known_hosts
49     #
50
51     if ( ! $?hosts ) then
52       set hosts=()
53       foreach f ( ~/.{,r,ssh/known_}hosts )
54         if ( -r "$f" ) then
55           set hosts=( \
56             $hosts \
57             `sed \
58               -e 's/#.*//' \
59               -e '/^|/d' \
60               -e '/^[+-]@/d' \
61               -e 's/^[+-]//' \
62               -e 's/[[:space:]].*$//' \
63               -e 's/,/\n/g' \
64               "$f" \
65             | sed \
66               -e 's/:[[:digit:]]*$//' \
67               -e 's/^\[\([^]]*\)\]$/\1/' \
68               -e '/^[.:[:xdigit:][:space:]]*$/d' \
69             ` \
70           )
71         endif
72       end
73       unset f
74     endif
75
76     uncomplete *
77
78     #
79     # Copy from complete.tcsh
80     #
81     if ( -r ~/.complete ) source ~/.complete
82
83     uncomplete rcp rsh
84   endif
85
86   #
87   # Set status to ^G in order to keep using ^T for transpose-char.
88   #
89
90   switch ( "$OSTYPE" )
91   case bsd44:
92   case darwin:
93   case FreeBSD:
94   case NetBSD:
95     stty status ^G
96     if ( $?tcsh ) bindkey ^G stuff-char
97     breaksw
98   endsw
99
100   #
101   # We don't want to create a root-owned files in our home.
102   #
103
104   if ( $uid == 0 ) then
105     unset savehist
106     setenv LESSHISTFILE -
107     setenv VIMINIT ':set viminfo='
108   endif
109
110 endif