You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

110 lines
3.0 KiB

  1. # /etc/csh.cshrc
  2. #
  3. # This file is sourced by all shells, login and non-login shells.
  4. # Some shells such as scp and rcp don't like any output, so make sure
  5. # this file doesn't display anything, or bad things will happen!
  6. #
  7. # Note that this is the first file the shell reads, hence for login
  8. # shells, the PATH is not yet set!
  9. # Set some variables for interactive shells
  10. if ( $?prompt ) then
  11. # Find out if we should do colours
  12. if ( -r "/etc/DIR_COLORS" ) then
  13. if ( $?TERM ) then
  14. set colour = `"/bin/egrep" "^TERM ${TERM}"'$' "/etc/DIR_COLORS"`
  15. endif
  16. endif
  17. # Set a Gentoo-ish prompt and setup colourful stuff if we have colour
  18. set promptchars = "%#"
  19. if ( $?colour ) then
  20. if ( "$uid" == "0" ) then
  21. set prompt = "%{\033[0;1;34m%}(%{\033[0;1;31m%}%m%{\033[0m%}:%{\033[0;1;34m%}%c3%{\033[0;1;34m%}) %{\033[0;1;31m%}%#%{\033[0m%} "
  22. else
  23. set prompt = "%{\033[0;1;34m%}(%{\033[0;1;32m%}%m%{\033[0m%}:%{\033[0;1;34m%}%c3%{\033[0;1;34m%}) %{\033[0;1;32m%}%n%{\033[0;1;32m%}%#%{\033[0m%} "
  24. endif
  25. # Enable colours for ls, etc. Prefer ~/.dir_colors
  26. if ( -f "${HOME}"/.dir_colors ) then
  27. eval `"/usr/bin/dircolors" -c "${HOME}"/.dir_colors`
  28. else if ( -f "/etc/DIR_COLORS" ) then
  29. eval `"/usr/bin/dircolors" -c "/etc/DIR_COLORS"`
  30. endif
  31. alias ls 'ls --color=auto'
  32. alias grep 'grep --color=auto'
  33. else
  34. if ( "$uid" == "0" ) then
  35. set prompt = "(%m:%c3) %# "
  36. else
  37. set prompt = "(%m:%c3) %n%# "
  38. endif
  39. endif
  40. unset colour
  41. # Change the window title if appropriate
  42. if ( $?TERM ) then
  43. switch ( $TERM )
  44. case xterm*:
  45. case rxvt:
  46. case eterm:
  47. case Eterm:
  48. case screen:
  49. case vt100:
  50. if ( "$uid" == "0" ) then
  51. set prompt = "%{\033]2;# %m:%~\007%}$prompt"
  52. else
  53. set prompt = "%{\033]2;%m:%~\007%}$prompt"
  54. endif
  55. breaksw
  56. endsw
  57. endif
  58. # Handle history
  59. set history = 200
  60. set histdup = erase
  61. # Enable editing in EUC encoding for the languages where this make sense
  62. if ( $?LANG ) then
  63. switch ( ${LANG:r} )
  64. case ja*:
  65. set dspmbyte=euc
  66. breaksw
  67. case ko*:
  68. set dspmbyte=euc
  69. breaksw
  70. case zh_TW*:
  71. set dspmbyte=big5
  72. breaksw
  73. default:
  74. breaksw
  75. endsw
  76. endif
  77. # One can use the "bindkey" facility to redefine the meaning of keys
  78. # on the keyboard. While you should set these preferences in your
  79. # ~/.tcshrc, we include these bindings because many people expect
  80. # them to be this way.
  81. # INSERT : toggles overwrite or insert mode.
  82. bindkey ^[[2~ overwrite-mode
  83. # DELETE : delete char at cursor position.
  84. bindkey ^[[3~ delete-char
  85. # HOME : go to the beginning of the line.
  86. bindkey ^[[1~ beginning-of-line
  87. # END : go to the end of the line.
  88. bindkey ^[[4~ end-of-line
  89. # PAGE UP : search in history backwards for line beginning as current.
  90. bindkey ^[[5~ history-search-backward
  91. # PAGE DOWN : search in history forwards for line beginning as current.
  92. bindkey ^[[6~ history-search-forward
  93. endif
  94. # Setup a default MAIL variable. Note: on Interix, $USER can contain spaces
  95. if ( -f /var/mail/"$USER" ) then
  96. setenv MAIL /var/mail/"$USER"
  97. set mail = "$MAIL"
  98. endif