tcshを使うときに、使いやすくするための設定をします。
設定ファイルについて
さくらのレンタルサーバーのデフォルトのシェルはcshです。
Macは10.2まではtcshがデフォルトだったのですが、10.3からbashに変わりました。
今のFreeBSDでは、cshはtcshと同じです。ハードリンクです。
デフォルトシェルをtcshにする場合、Macでは下記の様にします。
% chsh -s /bin/tcsh
または、
% chfn -s /bin/tcsh
ホームディレクトリの.tcshrcを編集して、tcshを使いやすくします。
.tcshrc
~/.tcshrc
# ------------------------------------------------------------------------------
## same login name, develop in each directory
# set product = nobody_wants_to_buy
# ------------------------------------------------------------------------------
## history
## if you must use shared login name, and develop in each directory
# set histfile = /home/${product}/users/foo/.tcsh_history
## if you had an account.
set histfile = ~/.tcsh_history
set history = 8192
set savehist = (65536 merge)
# ------------------------------------------------------------------------------
## vi
## if you must use shared login name, and develop in each directory
# alias vi '/usr/local/vim -u /home/${product}/users/foo/.vimrc'
## if Mac, to use vim 8 by brew.
alias vi '/usr/local/bin/vim'
## if you had an account.
# alias vi '/usr/bin/vim'
# ------------------------------------------------------------------------------
## ctags
## if Mac, to use ctags by brew.
alias ctags '/usr/local/bin/ctags'
# ------------------------------------------------------------------------------
## cscope
# setenv CSCOPE_DB /git/project_x/cscope.out
# ------------------------------------------------------------------------------
## to use Ctrl-q Crtl-s in vi
## make XON/XOFF invalid on UART
# stty stop undef
# stty start undef
# ------------------------------------------------------------------------------
# path : executables (csh)
# PATH : executables (bash (& csh))
# LIBRARY_PATH : static libraries
# LD_LIBRARY_PATH : shared libraries
# CPATH : include files
# ------------------------------------------------------------------------------
set path = ( /usr/local/bin $path )
set path = ( /usr/bin /usr/sbin $path )
set path = ( /usr/X11R6/bin $path )
# ------------------------------------------------------------------------------
## for *.so
if ( ! $?LD_LIBRARY_PATH ) then
setenv LD_LIBRARY_PATH /usr/lib64/lib:/usr/local/lib
else
setenv LD_LIBRARY_PATH ${LD_LIBRARY_PATH}:/usr/lib64/lib:/usr/local/lib
endif
# ------------------------------------------------------------------------------
# setenv PATH "$HOME/bin:$PATH"
# setenv LIBRARY_PATH "$HOME/lib:$LIBRARY_PATH"
# setenv LD_LIBRARY_PATH "$HOME/lib:$LD_LIBRARY_PATH"
# setenv CPATH "$HOME/include:$CPATH"
# ------------------------------------------------------------------------------
## LANG
## C : English
# setenv LANG C
setenv LANG ja_JP.UTF-8
setenv LC_TIME C
# ------------------------------------------------------------------------------
## cd aaa & cd eee
## ~/manual/aaa
## /bbb
## /ccc
## ~/project/python/3.4/tools/script/git/ddd
## /eee
# set cdpath = (~/manual ~/project/python/3.4/tools/script/git)
# ------------------------------------------------------------------------------
## touch & mkdir
umask 002 # chmod 664
# ------------------------------------------------------------------------------
alias ls '\ls -F'
alias ll '\ls -FAlh'
alias la '\ls -FA'
# ------------------------------------------------------------------------------
alias grep 'grep -E -n'
alias gr grep
# ------------------------------------------------------------------------------
## for df & du
setenv BLOCKSIZE K
# setenv BLOCKSIZE M
# ------------------------------------------------------------------------------
## just notify job complete
set notify
# ------------------------------------------------------------------------------
## Ctrl + d -> not exit
set ignoreeof
# ------------------------------------------------------------------------------
## cat tmp_1 tmp_2 > out (if out exists, not rewrite)
## to rewrite -> comment out
set noclobber
# ------------------------------------------------------------------------------
## Tab -> list
set autolist
# ------------------------------------------------------------------------------
## no more beep
set nobeep
# ------------------------------------------------------------------------------
## history search (tcsh)
bindkey -k up history-search-backward
bindkey -k down history-search-forward
# ------------------------------------------------------------------------------
limit coredumpsize 0
# ------------------------------------------------------------------------------
## set autologout = 60 # auto logout after 60 min
unset autologout
# ------------------------------------------------------------------------------
## 34m ... m : change color to blue(=34)
## \e[34m ... \e[m : \e[ ... \e[
## %{\e[34m ... \e[m%} : %{ ... %}
## %/ : current directory with path
## %c : current directory
## \e[ = 033[
## color(= color in html/css) and background color(= background-color in html/css)
## ex. 31 - color red
## ex. 42 - background color green
## 0 - black
## 1 - red
## 2 - green
## 3 - yellow
## 4 - blue
## 5 - magenta
## 6 - cyan
## 7 - white
set prompt = "[ %/ ]\n%# "
# ------------------------------------------------------------------------------
$?LD_LIBRARY_PATHは、先にset LD_LIBRARY_PATHされているかの判定です。
man cshで分かりやすく書かれています。
広告
IT開発関連書とビジネス書が豊富な翔泳社の通販『SEshop』さくらのレンタルサーバ
ムームードメイン
Oisix(おいしっくす)
らでぃっしゅぼーや
珈琲きゃろっと
エプソムソルト