view rc/cshrc @ 451:abb434518e1f

Always start editing git commit message from line 1.
author Edho Arief <edho@myconan.net>
date Fri, 08 Feb 2013 00:20:40 +0700
parents c01d272af466
children 072662ced8b8
line wrap: on
line source

#!/usr/bin/env tcsh

# Ensures it's tcsh
if ( ! $?tcsh ) then
  exit
endif

# Ensures this script is running on terminal. Otherwise exit immediately.
if ( ! $?prompt ) then
  exit
endif

# Ensures we're not loading this script again.
if ( ! $?ecos_tcsh_loaded ) then
  set ecos_tcsh_loaded="yes"
else
  exit
endif

test -f "${HOME}/.ecos_tcsh.before" && source "${HOME}/.ecos_tcsh.before"
umask 22
limit coredumpsize 0

set prompt="[%B%n@%m %~%b]%# "
set path=({,/usr}/{bin,sbin} "${HOME}"/{,.ecos_}bin)
set history=1000
set savehist=1000
set nobeep
set filec

setenv EDITOR vi
setenv PAGER less
setenv LESS '-MRXgij15$nsz-2'
setenv BLOCKSIZE K
setenv LC_COLLATE C
setenv LANG en_US.UTF-8
setenv LSCOLORS "gxfxcxdxbxegedabagacad"

unset autologout
unset autoexpand
unset autolist
unset ignoreeof

unalias \*
alias rd "rdesktop -g 1280x700 -K -a 16 -z -P -r sound:off -r clipboard:CLIPBOARD -5"
alias h history 25
alias j jobs -l
alias la ls -A
alias ll ls -lA
alias ls ls -F
alias rm rm -i

if ($?prompt) then
  set gnuls_opts="--color=auto --group-directories-first -F"
  set iscolor=0
  switch (${TERM})
    case xterm*:
    case dtterm:
    case screen*:
      setenv CLICOLOR 
      set myhost=`hostname | cut -d '.' -f 1`
      set prompt="[%{\033[0;33m%}%n%{\033[0m%}@%{\033[0;32m%}%m%{\033[0m%} %{\033[0;36m%}%c%{\033[0m%}]%# "
      alias mypwd 'printf "%s\n" "${PWD}" | sed -e "s#^${HOME}#~#"'
      alias precmd 'printf "\033]0;${USER}@${myhost}: %s\007" "`mypwd`"'
      set iscolor=1
    breaksw
  endsw

  if ("$TERM" == "screen") then
    bindkey '\e[1~' beginning-of-line
    bindkey '\e[3~' delete-char
    bindkey '\e[4~' end-of-line
    bindkey '\e[5~' history-search-backward
    bindkey '\e[6~' history-search-forward
    bindkey '\eOD' backward-word
    bindkey '\eOC' forward-word
    bindkey '\e\e[D' backward-word
    bindkey '\e\e[C' forward-word
  endif
  bindkey "^W" backward-delete-word
  bindkey -k up history-search-backward
  bindkey -k down history-search-forward
endif

switch (`uname -s`)
  case FreeBSD:
    set path=(${path} /usr/local/{bin,sbin})
    alias ls ls -FG
    ( which gnuls ) > /dev/null && alias ls gnuls ${gnuls_opts}
    alias man man -o
    alias rm rm -I
    alias top top -P
  breaksw
  case NetBSD:
    set path=(${path} /usr/pkg/{bin,sbin})
    breaksw
  case OpenBSD:
    set path=(${path} /usr/local/{bin,sbin})
    test "${iscolor}" -eq 1 && setenv TERM xterm-256color
    ( which colorls ) > /dev/null && alias ls colorls -FG
  breaksw
  case DragonFly:
    set path=(${path} /usr/pkg/{bin,sbin})
    alias ls ls -FG
  breaksw
  case SunOS:
    set path=(${path} /usr/{gnu,csw,xpg4}/{bin,sbin})
    test -x /usr/gnu/bin/ls && alias ls /usr/gnu/bin/ls ${gnuls_opts}
  breaksw
  case Linux:
    alias ls ls ${gnuls_opts}
    alias grep grep --color=auto
  breaksw
endsw
unset gnuls_opts

( which vim ) > /dev/null && alias vi vim && setenv EDITOR vim

test -f "${HOME}/.ecos_tcsh.after" && source "${HOME}/.ecos_tcsh.after"

test -x "/usr/games/fortune" && "/usr/games/fortune"