-
Notifications
You must be signed in to change notification settings - Fork 1
/
.tcshrc
92 lines (89 loc) · 2.99 KB
/
.tcshrc
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
# .tcshrc on macOS
# made by hiropy
# sep 1996
# last modified in mar 2021
# '.' must be included for use of directory completion without 'cd'.
set path=(/bin /usr/bin /usr/local/bin /opt/X11/bin /sbin /usr/sbin .)
umask 022
if(! $?prompt)then
exit 0
endif
if($uid == 0)then
# Root user
set prompt="%{[31m%}%B[%~]%b%{[m%} "
set prompt2="%{[31m%}%R%B?%b%{[m%} "
set prompt3="%{[31m%}%BCorrect>%b%{[m%}%{[31m%}%b%R%B(y|n|e|a)?%b%{[m%} "
#set rprompt="%{[31m%}%B[%m]%b%{[m%}"
else
if(! $?REMOTEHOST)then
# other users
set prompt="%{[34m%}%B[%~]%b%{[m%} "
set prompt2="%{[34m%}%R%B?%b%{[m%} "
set prompt3="%{[34m%}%BCorrect>%b%{[m%}%{[34m%}%b%R%B(y|n|e|a)?%b%{[m%} "
#set rprompt="%{[34m%}%B[%m]%b%{[m%}"
else
# remote host
set prompt="%B[%m: %~]%b "
set prompt2="%R%B?%b "
set prompt3="%BCorrect>%b%R%B(y|n|e|a)?%b "
endif
endif
set history=256
set savehist=(256 merge)
set histdup=erase
set noclobber
set autolist
set autoexpand
set listlinks
set correct=cmd
set autocorrect
set color
set implicitcd
set matchbeep
set rmstar
set time=(1 "elapsed time %E CPU usage %P")
set pushdtohome
set pushdsilent
set wordchars="*?_[]"
unset autologout
setenv LC_ALL ja_JP.UTF-8
setenv LANG ja # For history-search working well.
setenv PERL_BADLANG 0 # For not printing Perl warning.
setenv BLOCKSIZE M
setenv CLICOLOR # To colorize ls
setenv CLICOLOR_FORCE 1 # To colorize ls redirection output
setenv LSCOLORS "Axfxxxxxbxhehebxbxbxbx"
setenv LS_COLORS "no=00:fi=00:di=01:ln=35:pi=00:so=00:bd=37;40:cd=37;44:ex=31"
# For node.brew
setenv NODEBREW_HOME /usr/local/var/nodebrew/current
setenv NODEBREW_ROOT /usr/local/var/nodebrew
setenv PATH ${PATH}:${NODEBREW_HOME}/bin
switch($TERM)
case "xterm*":
setenv XMODIFIERS "@im=_XWNMO" # For XIM
# setenv TERM ${TERM}-color # To colorize ls
alias cwdcmd 'echo -n "]0;`hostname -s`"'
cd .
breaksw
endsw
bindkey ^? backward-delete-word
bindkey ^[[A history-search-backward
bindkey ^[[B history-search-forward
bindkey ^P history-search-backward
bindkey ^N history-search-forward
complete cd 'p/1/d/'
complete emacs 'p/*/t/'
complete git 'p/1/(clone init add mv reset rm bisect grep log show status branch checkout commit diff merge rebase tag fetch pull push help)/'
complete docker 'p/1/(start restart pause unpause stats rm rmi ps logs images exec build run volume network version compose tag scan)/'
alias mv 'mv -i'
alias cp 'cp -i'
alias cd 'pushd \!*'
alias dirs 'dirs -v'
if($OSTYPE == "darwin")then
# macOS
alias ll 'ls -AGlt \!* | more -R'
else
alias ls 'ls --color=auto'
alias ll 'ls -Alt --time-style=long-iso --color=auto'
alias grep 'grep --color=auto'
endif