.cshrc

From Rohidekar

Revision as of 01:19, 8 November 2016 by Sarnobat (Talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

Deprecated

#===============================================================================
#                                                                             
# DESCRIPTION                                                                 
#   Sridhar Sarnobat's .cshrc file                                             
#                                                                             
# DATE                                                                        
#   09 Nov 07                                                                 
#                                                                             
# WARNING                                                                     
#   If you source other scripts, do not let them print anything, otherwise    
#   'less' won't show file contents                                          
#
# NOTES
#   (-) It's impossible to make a note of all the useful syntax in this file
#       alone. Some has to be got from .cshrc_oracle
#
# CONTACT                                                                     
#   Sridhar Sarnobat
#
#===============================================================================


#echo "Executing .cshrc_public"

#-------------------------------------------------------------------------------
# Can't include this otherwise autolist doesn't work
#
#   source ~/complete.tcsh
#-------------------------------------------------------------------------------

setenv CDPATH ${HOME}

# SSARNOBA TODO - Brian said this is the answer to that xterm problem
# xsession: (a shell script)
# This loads your Xresources file I think
# xrdb -load $HOME/.Xresources
source $HOME/bin/xterm_fix

#===============================================================================
#                                 ALL
#===============================================================================

# SSARNOBA: Get rid of the ls decorator with a '*'

setenv LS_OPTIONS "--ignore-backups"

set nobeep

#-------------------------------------------------------------------------------
#                                PROMPT
#-------------------------------------------------------------------------------

set prompt="%n@%m %c%# "

#-------------------------------------------------------------------------------
#                                 PATH
#-------------------------------------------------------------------------------

setenv PATH ${PATH}:/home/ssarnoba
setenv PATH ${PATH}:/home/ssarnoba/apache/bin
setenv PATH ${PATH}:/home/ssarnoba/bin
setenv PATH ${PATH}:/home/ssarnoba/bin/tkmerge
setenv PATH ${PATH}:/home/ssarnoba/bin/tcl
setenv PATH ${PATH}:/home/ssarnoba/ice/bin
setenv PATH ${PATH}:/sbin/
setenv PATH ${PATH}:/egodev/ego/tools/bin


setenv SQLPATH ~

#===============================================================================
#                            TAB COMPLETION
#===============================================================================

# NOTE: Do not put spaces after commas or it won't work

# If the autolist shell variable is set, the shell lists the remaining 
# choices (if any) whenever completion fails
set autolist

set fignore = ( \~ )

# SSARNOBA - set tab with nothing typed to show all files

# Only list directories when completing the first word after the command 'cd'
# complete {cd, pushd} 'p/1/d/ '

# Complete options for find command
complete find 'c/-/(user group type name print exec mtime fstype perm size)/'

# Never include '.' or '..' as completion candidates
# complete * 'p/1/d:^{..,.}/'

# SSARNOBA: set listmax to limit the size of a list output from tab completion

#===============================================================================
#                             KEY BINDINGS
#===============================================================================

#-------------------------------------------------------------------------------
# Use emacs key bindings
#               -e  Binds all keys to the standard GNU Emacs-like bindings.
#               -v  Binds all keys to the standard vi(1)-like bindings.
#-------------------------------------------------------------------------------

bindkey -e

# SSARNOBA TODO : You can't switch _ and -
#bindkey -s \\137 '-'
#bindkey -s \\055 '_'

# See 
#  http://www.kitebird.com/csh-tcsh-book/bindings.html
# 
# for the decrypted documentation
#

#-------------------------------------------------------------------------------
# ^  = CTRL
# ^[ = ESC  or  ALT+
# ^? = DEL
#
#-------------------------------------------------------------------------------

# Alt x
# xemacs
bindkey -s -b M-x 'xemacs '

# Alt p
# print working directory
bindkey -s -b M-p 'pwd\n'

# Alt k
# Kill line
bindkey    -b M-k 'kill-line'

# Alt n
# find file by name
bindkey -s -b M-n 'find -type f -name ""'

#-------------------------------------------------------------------------------
#                           Command History
#-------------------------------------------------------------------------------

# ALT up
bindkey '^[[1;3A'       history-search-backward

# Page Up
bindkey '^[[5~'        history-search-backward

# Page Down
bindkey '^[[6~'         history-search-forward

# ALT down
bindkey '^[[1;3B'       history-search-forward

#-------------------------------------------------------------------------------
#                           Cursor movement
#-------------------------------------------------------------------------------

# CTRL right
bindkey '^[[1;5C'       forward-word

# CTRL left
#bindkey '\e[1;5D'       backward-word
bindkey '^[[1;5D'       backward-word

#-------------------------------------------------------------------------------
#                               Deletion
#-------------------------------------------------------------------------------

# ALT BS - backward delete line  (just like Outlook Express - sometimes!)
#backward-kill-line
#          Cut from beginning of line to cursor - save in cut buffer
# " CTRL U"           ->  kill-whole-line


# ALT K - forward delete line

# Ctrl-BS
# Delete word
bindkey ^?       backward-delete-word

bindkey '^[[3;5~'      delete-word

#-------------------------------------------------------------------------------
#                              Characters
#-------------------------------------------------------------------------------

# Alt-u
# to Upper case

# Alt-l
# to lower case

#-------------------------------------------------------------------------------
#                              Completion
#-------------------------------------------------------------------------------

# Ctrl-Tab
# Cycle tab completions forward
# SSARNOBA TODO - this doesn't work
# CTRL-SHIFT-TAB
# SSARNOBA TODO - use ctrl-shift-tab for backward

# SSARNOBA TODO - doesn't work
# bindkey -b M-'`' complete-word-fwd
#bindkey -b C-'1'   complete-word-back
#bindkey -b C-'2'   complete-word-fwd
#bindkey -b C-'`' complete-word-back
#bindkey -b C-1   complete-word-fwd
bindkey -b M-1   complete-word-back
bindkey -b M-2   complete-word-fwd


#-------------------------------------------------------------------------------
#                                Paste
#-------------------------------------------------------------------------------

# SHIFT-insert - ^[4
# Paste (highlight)
#bindkey '^[5'      self-insert

# Alt-$
# SSARNOBA - TODO - change this to Ctrl$
bindkey ^[4      insert-last-word

# Yank
# CTRL V
# Paste (regular)
#bindkey '^v'      yank

# Determine character sequence
# Ctrl Y
bindkey ^y      quoted-insert

#-------------------------------------------------------------------------------
#                                Other
#-------------------------------------------------------------------------------

# Alt l
# List
bindkey -s -b M-l "l\n"

# Alt e
# Exit
bindkey -s -b M-e "e\n"

#-------------------------------------------------------------------------------
#                     Oracle-specific key bindings
#-------------------------------------------------------------------------------

# It's better to use \n with -s than to use -c because then the command you're
# executing gets printed.

# TODO SSARNOBA - several of the ctrl - ... bindings don't get unbound correctly
# so I've had to settle for alt - ...



# Alt o
# Check out source code
bindkey -s -b M-o 'scs update -P\n'

# Alt w
# SCS Make Workspace
bindkey -s -b M-w "scs_mkws_"


# Alt t
# check in
bindkey -s -b M-t "td\n"

# Alt j
# Exit
bindkey -s -b M-j "jd\n"

# Alt s
# scs status
bindkey -r ^s
bindkey -s -b M-s "s\n"

# Alt m
# Go to main
bindkey -s -b M-m "m\n"

# Alt i
# check in
bindkey -s -b M-i "scs ci --cmt '"

# Alt i
# check in
bindkey -s -b M-f "fd "

# Ctrl u
# scs update -j ssarnoba_...
bindkey -s ^u "suj\n"

# Alt u
# scs update -j ssarnoba_...
bindkey -s -b M-u "suj "

# Ctrl u
# scs update -j ssarnoba_...
# Note: change directory doesn't do anything
bindkey -s -b M-d "cd mod\n"

# Cycle through tab completions
# bindkey -c "^G" complete-word-fwd
# SSARNOBA: find out more about how to customize these

# mv -q *~ ~/trash/

# In bash there is something called dynamic-complete-history.

# You can use double pipes '||' if you want a comment to be executed if the 
# previous one failed

#setenv LS_COLORS "di=32:ln=95:or=5:mi=91;5;5"
eval `dircolors -c ~/.dir_colors`

# exec ~/.temp;

#===============================================================================
#                           DIRECOTRY STACK
#===============================================================================

# TODO SSARNOBA - it would be nice to push some default locations on the 
# directory stack but first you need to stop it from printing the directory
# stack after every single command


# TODO SSARNOBA This doesn't do anything, possibly because icewm is installed 
# in my home directory instead of in /usr/ etc.
#set ICEWM_PRIVCFG=/home/ssarnoba/.icewm-config
#setenv ICEWM_PRIVCFG /home/ssarnoba/.icewm-config

# SSARNOBA - this doesn't work
#set savehist

# Don't show the directory stack after a pushd or cd command
# (The manpages don't say it, but setting pushdsilent also turn off
# directory stack echoing for cd to a CDPATH destination too)
set pushdsilent

source ~/.aliases_public
Personal tools