refer to following link
Wednesday, September 24, 2008
cshrc
####################################################
#!/bin/tcsh
unset autologout
set ignoreeof
set filec
set history = 200
set osversion=`uname`
xmodmap -e 'keycode 22 = BackSpace'
setenv MANPATH /usr/man:/usr/openwin/man
setenv PATH .
setenv PATH $HOME/bin:$PATH
setenv PATH /bin:$PATH
setenv PATH /sbin:$PATH
setenv PATH /usr/bin:$PATH
setenv PATH /usr/sbin:$PATH
setenv PATH /usr/local/bin:$PATH
setenv PATH /usr/X11R6/bin:$PATH
setenv PATH /magnum/tools/novas/verdi-10.2/bin:$PATH
setenv PATH /magnum/tools/cadence/RC62USR2/bin:$PATH
####################################################
#! /bin/csh -fset osversion=`uname`alias a aliasa cls cleara ls ls -F --colora acroread "acroread \!* &"a l lsa L lsa LS lsa lcd lsa ld 'ls -d \!*|\grep /$'#a ld '\ls --color -F1 | \grep /$'#a ld 'find . -type d -maxdepth 1'a lc 'ls -1 \!*|grep -c ""'a lls lla llt ll -rta le lessa f finda fm "ftp sb1500-001.magnumsemi.com"a h historya h1 head -1a h2 head -2a k kill -9a kd "kdiff3 \!* &"#a g xvia g gvima gd g -da go g -oa gO g -Oa gt g --remote-tab-silenta vo v -oa vO v -Oa grep grep --colora gc grep --colora gl grep -la glw grep -lwa gw grep -wa pd pushda rf rm -fa v via vr vi -Ra qk 'qstat |\grep -w "\!*"|awk "{print $1}"|xargs qdel'a x 'xterm -bd "#7f7f00" -fg "#7f7f7f" -bg black -cr "#ff7f7f" -geometry 101x35 -fn 9x15bold -sl 2000 &'a qx 'Q xterm -bd "#7f7f00" -fg "#7f7f7f" -bg black -cr "#ff7f7f" -geometry 101x35 -fn 9x15bold -sl 2000 &'a qxf 'Q xterm -bd "#7f7f00" -fg "#7f7f7f" -bg black -cr "#ff7f7f" -geometry 101x35 -fn 9x15bold -sl 2000'a so sourcea CD cda cdl "cd ~/goto_lynley;l"#a cdc "cd ~/thunder2/run/r3ksource/csrc/test"#a cds "cd ~/thunder2/run/sim"a cdh "cd ~/thunder2/hdl"a . pwda .. "cd .."a ... "cd ../.."a .... "cd ../../.."a ..... "cd ../../../.."a ...... "cd ../../../../.."a Q "qrsh -l mem_free=25G -l num_proc=4 -now no -V -noshell -cwd \!*"a Qsh 'echo "start at `date`"; qrsh -l mem_free=25G -l num_proc=4 -now no -V -noshell -b y -cwd -l lic_sim=1 -l simh \!*;echo "finish at `date`"'#a Q 'qrsh -l mem_free=25G -l num_proc=4 -now no -noshell -cwd \!*'a udc "unsetenv DISPLAY"a la ls -aa lt ls -t -la ll ls -la lm 'll |more'a lr 'ls -ltd'a pvnc 'ps aux |grep vnc'a rm rm -ia boo '\rm #*; \rm *~'a cdd cd ..a cp cp -ipa nc ncveriloga h history#a gvim gvim -reverseunalias test### hg/mercurial relateda hl "hg log|more"a hv hg viewa hs "hg status|grep -v ^\?"a hjs "hg jstatus|grep -v ^\?"a hgg "hg glog|grep ^@; echo 'latest hg log:';hg log|head -2"a hj "hg jpull |tee ~/hg.log; hg jupdate |tee -a ~/hg.log;date"set HOSTNAME=`hostname`if ($HOSTNAME =~ *bj*) then a hjpu 'hg jrebase /proj/lynley/ws/hgmirror/mrepo/mrepo > /dev/null;set startTime=`date`;hg jpull --root \!*|tee ~/hg.log; hg jupdate --root \!*|tee -a ~/hg.log;date; hg jrebase ssh://$USER@mrepo//magnum/hg/mrepo > /dev/null;\echo -e "hjpu started at\t$startTime\n\tended at\t`date`"' a hjpuc 'hg jrebase /proj/lynley/ws/hgmirror/mrepo/mrepo > /dev/null;set startTime=`date`;hg jpull --root \!*|tee ~/hg.log; hg jupdate -C --root \!*|tee -a ~/hg.log;date; hg jrebase ssh://$USER@mrepo//magnum/hg/mrepo > /dev/null;\echo -e "hjpu started at\t$startTime\n\tended at\t`date`"'else a hjpu 'set startTime=`date`;hg jpull --root \!*|tee ~/hg.log; hg jupdate --root \!*|tee -a ~/hg.log;date; \echo -e "hjpu started at\t$startTime\n\tended at\t`date`"' a hjpuc 'set startTime=`date`;hg jpull --root \!*|tee ~/hg.log; hg jupdate -C --root \!*|tee -a ~/hg.log;date; \echo -e "hjpu started at\t$startTime\n\tended at\t`date`"'endifa hjpul 'hjpu hw/fe/Lynley/proj/dev@\!*'a hjpui 'hjpu hw/fe/interconnect/verif/dev@\!*'a hjpuit 'hjpui tip'a hpu "hg pull \!*; hg update \!*"a simvision 'simvision -waves \!* &'a sv "simvision waves.shm/waves.trn"if ($osversion == "Linux") then set mach_type="`uname -m`" a vi vim #alias vi "/home/lfchen/bin/vim -v" #alias vim "/home/lfchen/bin/vim" #alias vi "/usr/bin/vim -v" #alias vim "/usr/bin/vim" #alias vi "/usr/X11R6/bin/gvim -font MiscFixed -reverse" #alias vim "/usr/X11R6/bin/gvim -font MiscFixed -reverse" #alias gvim "/usr/X11R6/bin/gvim -font MiscFixed -reverse" alias xterm "/usr/X11R6/bin/xterm" #setenv VIMRUNTIME "/cirrus/linuxapps/local/share/vim/runtime" #setenv VIMRUNTIME "/home/lfchen/share/vim/runtime" alias xvi vim -g #if ($mach_type == "x86_64") then #alias xvi "/cirrus/linuxapps/local/bin/bit64/vim -g" #endifendif## for xml flowa cdroot "so ~lfchen/scripts/mgnmFlow/cdRoot"a cdr "cdroot;ssm"a ssm "source ~lfchen/scripts/mgnmFlow/set_mrepo"## set my personal favorite IPNAME by force. But I don't need to override now.#setenv IPNAME interconnectsetenv ipname interconnectsetenv intf hw/fe/common/rtl/interfaces/devsetenv tiwir mtools/veriTools/dev/tiwirsetenv tests hw/tests/$ipname/dev/svsetenv verif hw/fe/$ipname/verif/devsetenv run $verif/runsetenv src $verif/srcsetenv rtl hw/fe/$ipname/rtl/devsetenv xml xml/impl/ip/$ipname/devsetenv ovm hw/fe/common/verif/ovmsetenv ovmahb $ovm/ahb/dev/08.20.002-s/vr_ahb/svsetenv ovmocp $ovm/ocp/dev/srcsetenv ovmmcbus $ovm/mcbus/dev/srcsetenv ovmcbus $ovm/cbus/dev/srca cdmem 'cdr;cd hw/fe/common/memories/Lynley/dev'a cdgen 'cdr;cd mtools/generators/dev'a cdinc 'cdr;cd hw/fe/Lynley/verif/dev/common/include'a cdinc 'cdr;cd hw/fe/common/rtl/interfaces/dev'a cdxml 'cdr;\\ if (a"\!*" != a"") \\ cd xml/impl/ip/\!*/dev;\\ if (a"\!*" == a"") \\ cd xml/impl/ip/$ipname/dev;\\ 'a cdrtl 'cdr;\\ if (a"\!*" != a"") \\ cd hw/fe/\!*/rtl/dev;\\ if (a"\!*" == a"") \\ cd hw/fe/$ipname/rtl/dev;\\ 'a cdsdc 'cdr;\\ if (a"\!*" != a"") \\ cd hw/fe/\!*/gate/asic/dev;\\ if (a"\!*" == a"") \\ cd hw/fe/$ipname/gate/asic/dev;\\ 'a cdrun 'cdr;\\ if (a"\!*" != a"") \\ cd hw/fe/\!*/verif/dev/run;\\ if (a"\!*" == a"") \\ cd hw/fe/$ipname/verif/dev/run;\\ 'a cdverif 'cdr;\\ if (a"\!*" != a"") \\ cd hw/fe/\!*/verif/dev;\\ if (a"\!*" == a"") \\ cd hw/fe/$ipname/verif/dev;\\ 'a cdsrc 'cdr;\\ if (a"\!*" != a"") \\ cd hw/fe/\!*/verif/dev/src;\\ if (a"\!*" == a"") \\ cd hw/fe/$ipname/verif/dev/src;\\ 'a cdtests 'cdr;\\ if (a"\!*" != a"") \\ cd hw/tests/\!*/dev/sv;\\ if (a"\!*" == a"") \\ cd hw/tests/$ipname/dev/sv;\\ 'setenv shortName `echo $HOSTNAME|cut -f1 -d"."`#try DISPLAYa d 'echo $DISPLAY'a sdf 'echo $DISPLAY >! ~/.display'a sdfe 'echo $DISPLAY |tee ~/.display'set myTTY=`who am i | awk '{ print $2 }'`set myHOSTNAME=`w | grep -w "$myTTY" | awk '{ print $3 }'`set myVNC=94if (! -f ~/.display) touch .displaya vdc "setenv DISPLAY ${myHOSTNAME}:$myVNC.0; sdf" #engvnca pdc "setenv DISPLAY 172.18.20.31:0; sdf" #bj pca mdc "setenv DISPLAY milcitrix.ad.magnumsemi.com:0.0; sdf" #172.16.4.229:0a gdc "setenv DISPLAY ${USER}-pc.ad.magnumsemi.com:0.0; sdf" #172.16.4.165:0a mvnc vncserver -geometry 1350x1000 :94### personal settingsif ($USER != lfchen) exitif ("$myHOSTNAME" =~ milfarm*) then setenv DISPLAY `cat ~/.display` #echo login from $myHOSTNAMEelse if ("$myHOSTNAME" =~ engvnc*) then vdc sdfelse if ("$myHOSTNAME" =~ milcitrix*) then mdc sdfelse if ("$myHOSTNAME" =~ ${USER}*) then gdc sdfelse #login from pc if ($HOSTNAME =~ *bj*) then pdc else gdc endif sdfendif###########DISPLAY SET###########################
alias sdp setenv DISPLAY 172.16.18.5:10
if ($osversion == "Linux") then
set mach_type="`uname -m`"
alias pscheck "/bin/ps -Af | grep -v root"
else
alias pscheck "/bin/ps -Af -o pid,etime,user,args | grep -v root"
endif
####################################################
content of .dir_colors
# Configuration file for the color ls utility
# This file goes in the /etc directory, and must be world readable.
# You can copy this file to .dir_colors in your $HOME directory to override
# the system defaults.
# COLOR needs one of these arguments: 'tty' colorizes output to ttys, but not
# pipes. 'all' adds color characters to all output. 'none' shuts colorization
# off.
COLOR tty
# Extra command line options for ls go here.
# Basically these ones are:
# -F = show '/' for dirs, '*' for executables, etc.
# -T 0 = don't trust tab spacing when formatting ls output.
OPTIONS -F -T 0
# Below, there should be one TERM entry for each termtype that is colorizable
TERM linux
TERM console
TERM con132x25
TERM con132x30
TERM con132x43
TERM con132x60
TERM con80x25
TERM con80x28
TERM con80x30
TERM con80x43
TERM con80x50
TERM con80x60
TERM cons25
TERM xterm
TERM rxvt
TERM xterm-color
TERM color-xterm
TERM vt100
TERM dtterm
TERM color_xterm
TERM ansi
TERM screen
TERM screen.linux
TERM kon
TERM kterm
TERM gnome
TERM konsole
# EIGHTBIT, followed by '1' for on, '0' for off. (8-bit output)
EIGHTBIT 1
# Below are the color init strings for the basic file types. A color init
# string consists of one or more of the following numeric codes:
# Attribute codes:
# 00=none 01=bold 04=underscore 05=blink 07=reverse 08=concealed
# Text color codes:
# 30=black 31=red 32=green 33=yellow 34=blue 35=magenta 36=cyan 37=white
# Background color codes:
# 40=black 41=red 42=green 43=yellow 44=blue 45=magenta 46=cyan 47=white
NORMAL 00 # global default, although everything should be something.
FILE 00 # normal file
DIR 04;36 # directory
LINK 01;36 # symbolic link
FIFO 40;33 # pipe
SOCK 01;35 # socket
BLK 40;33;01 # block device driver
CHR 40;33;01 # character device driver
ORPHAN 01;05;37;41 # orphaned syminks
MISSING 01;05;37;41 # ... and the files they point to
# This is for files with execute permission:
EXEC 01;32
# List any file extensions like '.gz' or '.tar' that you would like ls
# to colorize below. Put the extension, a space, and the color init string.
# (and any comments you want to add after a '#')
.cmd 01;32 # executables (bright green)
.exe 01;32
.com 01;32
.btm 01;32
.bat 01;32
.sh 01;32
.csh 01;32
.tar 01;31 # archives or compressed (bright red)
.tgz 01;31
.arj 01;31
.taz 01;31
.lzh 01;31
.zip 01;31
.z 01;31
.Z 01;31
.gz 01;31
.bz2 01;31
.bz 01;31
.tz 01;31
.rpm 01;31
.cpio 01;31
.jpg 01;35 # image formats
.gif 01;35
.bmp 01;35
.xbm 01;35
.xpm 01;35
.png 01;35
.tif 01;35
#!/bin/tcsh
unset autologout
set ignoreeof
set filec
set history = 200
set osversion=`uname`
xmodmap -e 'keycode 22 = BackSpace'
setenv MANPATH /usr/man:/usr/openwin/man
setenv PATH .
setenv PATH $HOME/bin:$PATH
setenv PATH /bin:$PATH
setenv PATH /sbin:$PATH
setenv PATH /usr/bin:$PATH
setenv PATH /usr/sbin:$PATH
setenv PATH /usr/local/bin:$PATH
setenv PATH /usr/X11R6/bin:$PATH
setenv PATH /magnum/tools/novas/verdi-10.2/bin:$PATH
setenv PATH /magnum/tools/cadence/RC62USR2/bin:$PATH
####################################################
#! /bin/csh -fset osversion=`uname`alias a aliasa cls cleara ls ls -F --colora acroread "acroread \!* &"a l lsa L lsa LS lsa lcd lsa ld 'ls -d \!*|\grep /$'#a ld '\ls --color -F1 | \grep /$'#a ld 'find . -type d -maxdepth 1'a lc 'ls -1 \!*|grep -c ""'a lls lla llt ll -rta le lessa f finda fm "ftp sb1500-001.magnumsemi.com"a h historya h1 head -1a h2 head -2a k kill -9a kd "kdiff3 \!* &"#a g xvia g gvima gd g -da go g -oa gO g -Oa gt g --remote-tab-silenta vo v -oa vO v -Oa grep grep --colora gc grep --colora gl grep -la glw grep -lwa gw grep -wa pd pushda rf rm -fa v via vr vi -Ra qk 'qstat |\grep -w "\!*"|awk "{print $1}"|xargs qdel'a x 'xterm -bd "#7f7f00" -fg "#7f7f7f" -bg black -cr "#ff7f7f" -geometry 101x35 -fn 9x15bold -sl 2000 &'a qx 'Q xterm -bd "#7f7f00" -fg "#7f7f7f" -bg black -cr "#ff7f7f" -geometry 101x35 -fn 9x15bold -sl 2000 &'a qxf 'Q xterm -bd "#7f7f00" -fg "#7f7f7f" -bg black -cr "#ff7f7f" -geometry 101x35 -fn 9x15bold -sl 2000'a so sourcea CD cda cdl "cd ~/goto_lynley;l"#a cdc "cd ~/thunder2/run/r3ksource/csrc/test"#a cds "cd ~/thunder2/run/sim"a cdh "cd ~/thunder2/hdl"a . pwda .. "cd .."a ... "cd ../.."a .... "cd ../../.."a ..... "cd ../../../.."a ...... "cd ../../../../.."a Q "qrsh -l mem_free=25G -l num_proc=4 -now no -V -noshell -cwd \!*"a Qsh 'echo "start at `date`"; qrsh -l mem_free=25G -l num_proc=4 -now no -V -noshell -b y -cwd -l lic_sim=1 -l simh \!*;echo "finish at `date`"'#a Q 'qrsh -l mem_free=25G -l num_proc=4 -now no -noshell -cwd \!*'a udc "unsetenv DISPLAY"a la ls -aa lt ls -t -la ll ls -la lm 'll |more'a lr 'ls -ltd'a pvnc 'ps aux |grep vnc'a rm rm -ia boo '\rm #*; \rm *~'a cdd cd ..a cp cp -ipa nc ncveriloga h history#a gvim gvim -reverseunalias test### hg/mercurial relateda hl "hg log|more"a hv hg viewa hs "hg status|grep -v ^\?"a hjs "hg jstatus|grep -v ^\?"a hgg "hg glog|grep ^@; echo 'latest hg log:';hg log|head -2"a hj "hg jpull |tee ~/hg.log; hg jupdate |tee -a ~/hg.log;date"set HOSTNAME=`hostname`if ($HOSTNAME =~ *bj*) then a hjpu 'hg jrebase /proj/lynley/ws/hgmirror/mrepo/mrepo > /dev/null;set startTime=`date`;hg jpull --root \!*|tee ~/hg.log; hg jupdate --root \!*|tee -a ~/hg.log;date; hg jrebase ssh://$USER@mrepo//magnum/hg/mrepo > /dev/null;\echo -e "hjpu started at\t$startTime\n\tended at\t`date`"' a hjpuc 'hg jrebase /proj/lynley/ws/hgmirror/mrepo/mrepo > /dev/null;set startTime=`date`;hg jpull --root \!*|tee ~/hg.log; hg jupdate -C --root \!*|tee -a ~/hg.log;date; hg jrebase ssh://$USER@mrepo//magnum/hg/mrepo > /dev/null;\echo -e "hjpu started at\t$startTime\n\tended at\t`date`"'else a hjpu 'set startTime=`date`;hg jpull --root \!*|tee ~/hg.log; hg jupdate --root \!*|tee -a ~/hg.log;date; \echo -e "hjpu started at\t$startTime\n\tended at\t`date`"' a hjpuc 'set startTime=`date`;hg jpull --root \!*|tee ~/hg.log; hg jupdate -C --root \!*|tee -a ~/hg.log;date; \echo -e "hjpu started at\t$startTime\n\tended at\t`date`"'endifa hjpul 'hjpu hw/fe/Lynley/proj/dev@\!*'a hjpui 'hjpu hw/fe/interconnect/verif/dev@\!*'a hjpuit 'hjpui tip'a hpu "hg pull \!*; hg update \!*"a simvision 'simvision -waves \!* &'a sv "simvision waves.shm/waves.trn"if ($osversion == "Linux") then set mach_type="`uname -m`" a vi vim #alias vi "/home/lfchen/bin/vim -v" #alias vim "/home/lfchen/bin/vim" #alias vi "/usr/bin/vim -v" #alias vim "/usr/bin/vim" #alias vi "/usr/X11R6/bin/gvim -font MiscFixed -reverse" #alias vim "/usr/X11R6/bin/gvim -font MiscFixed -reverse" #alias gvim "/usr/X11R6/bin/gvim -font MiscFixed -reverse" alias xterm "/usr/X11R6/bin/xterm" #setenv VIMRUNTIME "/cirrus/linuxapps/local/share/vim/runtime" #setenv VIMRUNTIME "/home/lfchen/share/vim/runtime" alias xvi vim -g #if ($mach_type == "x86_64") then #alias xvi "/cirrus/linuxapps/local/bin/bit64/vim -g" #endifendif## for xml flowa cdroot "so ~lfchen/scripts/mgnmFlow/cdRoot"a cdr "cdroot;ssm"a ssm "source ~lfchen/scripts/mgnmFlow/set_mrepo"## set my personal favorite IPNAME by force. But I don't need to override now.#setenv IPNAME interconnectsetenv ipname interconnectsetenv intf hw/fe/common/rtl/interfaces/devsetenv tiwir mtools/veriTools/dev/tiwirsetenv tests hw/tests/$ipname/dev/svsetenv verif hw/fe/$ipname/verif/devsetenv run $verif/runsetenv src $verif/srcsetenv rtl hw/fe/$ipname/rtl/devsetenv xml xml/impl/ip/$ipname/devsetenv ovm hw/fe/common/verif/ovmsetenv ovmahb $ovm/ahb/dev/08.20.002-s/vr_ahb/svsetenv ovmocp $ovm/ocp/dev/srcsetenv ovmmcbus $ovm/mcbus/dev/srcsetenv ovmcbus $ovm/cbus/dev/srca cdmem 'cdr;cd hw/fe/common/memories/Lynley/dev'a cdgen 'cdr;cd mtools/generators/dev'a cdinc 'cdr;cd hw/fe/Lynley/verif/dev/common/include'a cdinc 'cdr;cd hw/fe/common/rtl/interfaces/dev'a cdxml 'cdr;\\ if (a"\!*" != a"") \\ cd xml/impl/ip/\!*/dev;\\ if (a"\!*" == a"") \\ cd xml/impl/ip/$ipname/dev;\\ 'a cdrtl 'cdr;\\ if (a"\!*" != a"") \\ cd hw/fe/\!*/rtl/dev;\\ if (a"\!*" == a"") \\ cd hw/fe/$ipname/rtl/dev;\\ 'a cdsdc 'cdr;\\ if (a"\!*" != a"") \\ cd hw/fe/\!*/gate/asic/dev;\\ if (a"\!*" == a"") \\ cd hw/fe/$ipname/gate/asic/dev;\\ 'a cdrun 'cdr;\\ if (a"\!*" != a"") \\ cd hw/fe/\!*/verif/dev/run;\\ if (a"\!*" == a"") \\ cd hw/fe/$ipname/verif/dev/run;\\ 'a cdverif 'cdr;\\ if (a"\!*" != a"") \\ cd hw/fe/\!*/verif/dev;\\ if (a"\!*" == a"") \\ cd hw/fe/$ipname/verif/dev;\\ 'a cdsrc 'cdr;\\ if (a"\!*" != a"") \\ cd hw/fe/\!*/verif/dev/src;\\ if (a"\!*" == a"") \\ cd hw/fe/$ipname/verif/dev/src;\\ 'a cdtests 'cdr;\\ if (a"\!*" != a"") \\ cd hw/tests/\!*/dev/sv;\\ if (a"\!*" == a"") \\ cd hw/tests/$ipname/dev/sv;\\ 'setenv shortName `echo $HOSTNAME|cut -f1 -d"."`#try DISPLAYa d 'echo $DISPLAY'a sdf 'echo $DISPLAY >! ~/.display'a sdfe 'echo $DISPLAY |tee ~/.display'set myTTY=`who am i | awk '{ print $2 }'`set myHOSTNAME=`w | grep -w "$myTTY" | awk '{ print $3 }'`set myVNC=94if (! -f ~/.display) touch .displaya vdc "setenv DISPLAY ${myHOSTNAME}:$myVNC.0; sdf" #engvnca pdc "setenv DISPLAY 172.18.20.31:0; sdf" #bj pca mdc "setenv DISPLAY milcitrix.ad.magnumsemi.com:0.0; sdf" #172.16.4.229:0a gdc "setenv DISPLAY ${USER}-pc.ad.magnumsemi.com:0.0; sdf" #172.16.4.165:0a mvnc vncserver -geometry 1350x1000 :94### personal settingsif ($USER != lfchen) exitif ("$myHOSTNAME" =~ milfarm*) then setenv DISPLAY `cat ~/.display` #echo login from $myHOSTNAMEelse if ("$myHOSTNAME" =~ engvnc*) then vdc sdfelse if ("$myHOSTNAME" =~ milcitrix*) then mdc sdfelse if ("$myHOSTNAME" =~ ${USER}*) then gdc sdfelse #login from pc if ($HOSTNAME =~ *bj*) then pdc else gdc endif sdfendif###########DISPLAY SET###########################
alias sdp setenv DISPLAY 172.16.18.5:10
if ($osversion == "Linux") then
set mach_type="`uname -m`"
alias pscheck "/bin/ps -Af | grep -v root"
else
alias pscheck "/bin/ps -Af -o pid,etime,user,args | grep -v root"
endif
####################################################
#
set cd_cnt=0
alias sp 'set prompt="%{\033[33;44m%}\\![%.3\]%{\033[0m%}:\ ";\\
if("$shortName" !~ milfarm11*) set prompt="$shortName $prompt";\\
if("$cd_cnt" >= 20) \echo -e "PWD: \033[1;33;41m$PWD\033[0m";\\
if("$cd_cnt" >= 20) set cd_cnt=0\\
'
sp
alias cd 'chdir \!* ; sp; setenv PWD `pwd`; set cd_cnt=`echo $cd_cnt+1|bc -l`;' # redefine cd command
alias pushd 'if("\!:0-$" == pushd) pushd;\\
if("\!:0-$" != pushd) pushd \!$;\\
sp'
alias popd 'if ("\!:0-$" == popd) popd;\\
if ("\!:0-$" != popd) popd \!$;\\
sp'
content of .dir_colors
# Configuration file for the color ls utility
# This file goes in the /etc directory, and must be world readable.
# You can copy this file to .dir_colors in your $HOME directory to override
# the system defaults.
# COLOR needs one of these arguments: 'tty' colorizes output to ttys, but not
# pipes. 'all' adds color characters to all output. 'none' shuts colorization
# off.
COLOR tty
# Extra command line options for ls go here.
# Basically these ones are:
# -F = show '/' for dirs, '*' for executables, etc.
# -T 0 = don't trust tab spacing when formatting ls output.
OPTIONS -F -T 0
# Below, there should be one TERM entry for each termtype that is colorizable
TERM linux
TERM console
TERM con132x25
TERM con132x30
TERM con132x43
TERM con132x60
TERM con80x25
TERM con80x28
TERM con80x30
TERM con80x43
TERM con80x50
TERM con80x60
TERM cons25
TERM xterm
TERM rxvt
TERM xterm-color
TERM color-xterm
TERM vt100
TERM dtterm
TERM color_xterm
TERM ansi
TERM screen
TERM screen.linux
TERM kon
TERM kterm
TERM gnome
TERM konsole
# EIGHTBIT, followed by '1' for on, '0' for off. (8-bit output)
EIGHTBIT 1
# Below are the color init strings for the basic file types. A color init
# string consists of one or more of the following numeric codes:
# Attribute codes:
# 00=none 01=bold 04=underscore 05=blink 07=reverse 08=concealed
# Text color codes:
# 30=black 31=red 32=green 33=yellow 34=blue 35=magenta 36=cyan 37=white
# Background color codes:
# 40=black 41=red 42=green 43=yellow 44=blue 45=magenta 46=cyan 47=white
NORMAL 00 # global default, although everything should be something.
FILE 00 # normal file
DIR 04;36 # directory
LINK 01;36 # symbolic link
FIFO 40;33 # pipe
SOCK 01;35 # socket
BLK 40;33;01 # block device driver
CHR 40;33;01 # character device driver
ORPHAN 01;05;37;41 # orphaned syminks
MISSING 01;05;37;41 # ... and the files they point to
# This is for files with execute permission:
EXEC 01;32
# List any file extensions like '.gz' or '.tar' that you would like ls
# to colorize below. Put the extension, a space, and the color init string.
# (and any comments you want to add after a '#')
.cmd 01;32 # executables (bright green)
.exe 01;32
.com 01;32
.btm 01;32
.bat 01;32
.sh 01;32
.csh 01;32
.tar 01;31 # archives or compressed (bright red)
.tgz 01;31
.arj 01;31
.taz 01;31
.lzh 01;31
.zip 01;31
.z 01;31
.Z 01;31
.gz 01;31
.bz2 01;31
.bz 01;31
.tz 01;31
.rpm 01;31
.cpio 01;31
.jpg 01;35 # image formats
.gif 01;35
.bmp 01;35
.xbm 01;35
.xpm 01;35
.png 01;35
.tif 01;35
ultraedit wordfile for vhdl
/L15"VHDL" Line Comment = -- Nocase String Chars = " File Extensions = VHD VHO
/Delimiters = ~!@$%^&*()+=|\/{}[]:;""<> ,.?/
/Regexp Type = Perl
/Function String = "^\s*(\w*\s*:\s*process)"
/Function String 1 = "^\s*(entity\s+\w+)\s+is"
/Function String 2 = "^\s*(architecture\s*\w+\s+of\s*\w+)\s+is"
/Function String 3 = "^\s*(component\s*\w+)"
/Function String 4 = "^\s*(\w+\s*:\s*\w+)\s*$"
/Function String 5 = "^\s*(\w+\s*:\s*\w+)\s+port\s+map"
/Open Fold Strings = "(""process""if""loop" "component" "entity" "architecture"
/Close Fold Strings = ")""end process""end if""end loop" "end component""end entity" "end architecture"
/Open Brace Strings = "{" "(" "["
/Close Brace Strings = "}" ")" "]"
/C1"VHDL reserved words"
abs access after alias all and architecture array assert attribute
begin block body buffer bus
case component configuration constant
disconnect downto
else elsif end entity exit
file for function
generate generic group guarded
if impure in inertial inout is
label library linkage literal loop
map mod
nand new next nor not null
of on open or others out
package port postponed procedure process pure
range record register reject rem report return rol ror
select severity signal shared sla sll sra srl subtype
then to transport type
unaffected untis until use
variable
wait when while with
xnor xor
/C2"VHDL attributes"
active ascending ascending
base
delayed driving driving_value
event
falling_edge
high
image instance_name
last_active last_event last_value left leftof length low
path_name pos pred
quiet
reverse_range right rightof rising_edge
simple_name stable succ
transaction
val value
/C3"VHDL stings"
""
/C4"VHDL types"
bit bit_vector boolean
character
integer
line
natural
positive
real
signed std_logic std_logic_vector string
text time
unsigned
/C5"VHDL Procedures"
endfile
file_close file_open
read readline
write writeline
/Delimiters = ~!@$%^&*()+=|\/{}[]:;""<> ,.?/
/Regexp Type = Perl
/Function String = "^\s*(\w*\s*:\s*process)"
/Function String 1 = "^\s*(entity\s+\w+)\s+is"
/Function String 2 = "^\s*(architecture\s*\w+\s+of\s*\w+)\s+is"
/Function String 3 = "^\s*(component\s*\w+)"
/Function String 4 = "^\s*(\w+\s*:\s*\w+)\s*$"
/Function String 5 = "^\s*(\w+\s*:\s*\w+)\s+port\s+map"
/Open Fold Strings = "(""process""if""loop" "component" "entity" "architecture"
/Close Fold Strings = ")""end process""end if""end loop" "end component""end entity" "end architecture"
/Open Brace Strings = "{" "(" "["
/Close Brace Strings = "}" ")" "]"
/C1"VHDL reserved words"
abs access after alias all and architecture array assert attribute
begin block body buffer bus
case component configuration constant
disconnect downto
else elsif end entity exit
file for function
generate generic group guarded
if impure in inertial inout is
label library linkage literal loop
map mod
nand new next nor not null
of on open or others out
package port postponed procedure process pure
range record register reject rem report return rol ror
select severity signal shared sla sll sra srl subtype
then to transport type
unaffected untis until use
variable
wait when while with
xnor xor
/C2"VHDL attributes"
active ascending ascending
base
delayed driving driving_value
event
falling_edge
high
image instance_name
last_active last_event last_value left leftof length low
path_name pos pred
quiet
reverse_range right rightof rising_edge
simple_name stable succ
transaction
val value
/C3"VHDL stings"
""
/C4"VHDL types"
bit bit_vector boolean
character
integer
line
natural
positive
real
signed std_logic std_logic_vector string
text time
unsigned
/C5"VHDL Procedures"
endfile
file_close file_open
read readline
write writeline
ultraedit wordfile for verilog
/L13"Verilog 1364-2001" Line Comment = // Block Comment On = /* Block Comment Off = */ String Chars = " File Extensions = V VL VMD
/Delimiters = ~!@%^&*()-+=|\/{}[]:;"<> , .?
/Regexp Type = Perl
/Function String = "^[ \t]*(config\s+\w+)"
/Function String 1 = "^[ \t]*(module\s+\w+)"
/Function String 2 = "^[ \t]*(task\s+\w+)"
/Function String 3 = "^[ \t]*(function[\s\[]*[^\]]*[\s\]]+\w+;)"
/Function String 4 = "begin\s*(:\s*\w+)"
/Function String 5 = "^[ \t]*([^(begin|else|assign|always|if)]\w+[ \t]+\w+\s*\()"
/Function String 6 = "^\s*(primitive\s+\w+" unfortunately ultraedit support but 6 Function String
/Open Fold Strings = "(" "begin" "function" "task" "module"
/Close Fold Strings = ")" "end" "endfunction" "endtask" "endmodule"
/Indent Strings = "begin" "fork" "specify" "config"
/Unindent Strings = "end" "join" "endspecify" "endconfig"
/C1"Keywords"
always and assign automatic
begin buf bufif0 bufif1
case casex casez cell cmos config
deassign default defparam design disable
edge else end endcase endconfig endmodule endfunction endgenerate endprimitive endspecify endtable endtask event
for force forever fork function
generate genvar
highz0 highz1
if ifnone initial inout input instance integer
join
large liblist library localparam
macromodule medium module
nand negedge nmos none nor noshowcancelled not notif0 notif1
or output
parameter pulsestyle_onevent pulsestyle_ondetect pmos posedge primitive pull0 pull1 pullup pulldown
real realtime reg release repeat rcmos rnmos rpmos rtran rtranif0 rtanif1
scalared showcancelled signed small specify specparam strength strong0 strong1 supply0 supply1
table task time tran tranif0 tranif1 tri tri1 tri0 triand trior trireg
use
vectored
wait wand weak0 weak1 while wire wor
xnor xor
/C2"System"
** 'b 'B 'o 'O 'd 'D 'h 'H 'sb 'sB 'so 'sO 'sd 'sD 'sh 'sH 'Sb 'SB 'So 'SO 'Sd 'SD 'Sh 'SH
** _
$async$and$array $async$and$plane $async$nand$array $async$nand$plane $async$nor$array $async$nor$plane $async$or$array $async$or$plane
$bitstoreal
$countdrivers
$display $displayb $displayh $displayo
$dist_chi_square $dist_erlang $dist_exponential $dist_normal $dist_poisson $dist_t $dist_uniform
$dumpall $dumpfile $dumpflush $dumplimit $dumpoff $dumpon $dumpportsall $dumpportsflush $dumpportslimit $dumpportsoff $dumpportson $dumpvars
$fclose $fdisplayh $fdisplay $fdisplayf $fdisplayb $ferror $fflush $fgetc $fgets $finish $fmonitorb $fmonitor $fmonitorf $fmonitorh $fopen $fread $fscanf $fseek $fsscanf $fstrobe $fstrobebb $fstrobef $fstrobeh $ftel $fullskew $fwriteb $fwritef $fwriteh $fwrite
$getpattern
$history $hold
$incsave $input $itor
$key
$list $log
$monitorb $monitorh $monitoroff $monitoron $monitor $monitoro
$nochange $nokey $nolog
$period $printtimescale
$q_add $q_exam $q_full $q_initialize $q_remove
$random $readmemb $readmemh $readmemh $realtime $realtobits $recovery $recrem $removal $reset_count $reset $reset_value $restart $rewind $rtoi
$save $scale $scope $sdf_annotate $setup $setuphold $sformat $showscopes $showvariables $showvars $signed $skew $sreadmemb $sreadmemh $stime $stop $strobeb $strobe $strobeh $strobeo $swriteb $swriteh $swriteo $swrite $sync$and$array $sync$and$plane $sync$nand$array $sync$nand$plane $sync$nor$array $sync$nor$plane $sync$or$array $sync$or$plane
$test$plusargs $time $timeformat $timeskew
$ungetc $unsigned
$value$plusargs
$width $writeb $writeh $write $writeo
/C3"Operators"
->
+:
-:
@
@*
*>
,
;
{
}
+
-
// /
*
**
%
>
>=
>>
>>>
<
<=
<<
<<<
!
!=
!==
&
&&
|
||
=
==
===
^
^~
~
~^
~&
~|
?
:
/C4"Directives"
** `
`accelerate `autoexepand_vectornets
`celldefine
`default_nettype `define `default_decay_time `default_trireg_strength `delay_mode_distributed `delay_mode_path `delay_mode_unit `delay_mode_zero
`else `elsif `endcelldefine `endif `endprotect `endprotected `expand_vectornets
`file
`ifdef `ifndef `include
`line
`noaccelerate `noexpand_vectornets `noremove_gatenames `noremove_netnames `nounconnected_drive
`protect `protected
`remove_gatenames `remove_netnames `resetall
`timescale
`unconnected_drive `undef `uselib
/C5"DelaysAndParameters"
#ay
/Delimiters = ~!@%^&*()-+=|\/{}[]:;"<> , .?
/Regexp Type = Perl
/Function String = "^[ \t]*(config\s+\w+)"
/Function String 1 = "^[ \t]*(module\s+\w+)"
/Function String 2 = "^[ \t]*(task\s+\w+)"
/Function String 3 = "^[ \t]*(function[\s\[]*[^\]]*[\s\]]+\w+;)"
/Function String 4 = "begin\s*(:\s*\w+)"
/Function String 5 = "^[ \t]*([^(begin|else|assign|always|if)]\w+[ \t]+\w+\s*\()"
/Function String 6 = "^\s*(primitive\s+\w+" unfortunately ultraedit support but 6 Function String
/Open Fold Strings = "(" "begin" "function" "task" "module"
/Close Fold Strings = ")" "end" "endfunction" "endtask" "endmodule"
/Indent Strings = "begin" "fork" "specify" "config"
/Unindent Strings = "end" "join" "endspecify" "endconfig"
/C1"Keywords"
always and assign automatic
begin buf bufif0 bufif1
case casex casez cell cmos config
deassign default defparam design disable
edge else end endcase endconfig endmodule endfunction endgenerate endprimitive endspecify endtable endtask event
for force forever fork function
generate genvar
highz0 highz1
if ifnone initial inout input instance integer
join
large liblist library localparam
macromodule medium module
nand negedge nmos none nor noshowcancelled not notif0 notif1
or output
parameter pulsestyle_onevent pulsestyle_ondetect pmos posedge primitive pull0 pull1 pullup pulldown
real realtime reg release repeat rcmos rnmos rpmos rtran rtranif0 rtanif1
scalared showcancelled signed small specify specparam strength strong0 strong1 supply0 supply1
table task time tran tranif0 tranif1 tri tri1 tri0 triand trior trireg
use
vectored
wait wand weak0 weak1 while wire wor
xnor xor
/C2"System"
** 'b 'B 'o 'O 'd 'D 'h 'H 'sb 'sB 'so 'sO 'sd 'sD 'sh 'sH 'Sb 'SB 'So 'SO 'Sd 'SD 'Sh 'SH
** _
$async$and$array $async$and$plane $async$nand$array $async$nand$plane $async$nor$array $async$nor$plane $async$or$array $async$or$plane
$bitstoreal
$countdrivers
$display $displayb $displayh $displayo
$dist_chi_square $dist_erlang $dist_exponential $dist_normal $dist_poisson $dist_t $dist_uniform
$dumpall $dumpfile $dumpflush $dumplimit $dumpoff $dumpon $dumpportsall $dumpportsflush $dumpportslimit $dumpportsoff $dumpportson $dumpvars
$fclose $fdisplayh $fdisplay $fdisplayf $fdisplayb $ferror $fflush $fgetc $fgets $finish $fmonitorb $fmonitor $fmonitorf $fmonitorh $fopen $fread $fscanf $fseek $fsscanf $fstrobe $fstrobebb $fstrobef $fstrobeh $ftel $fullskew $fwriteb $fwritef $fwriteh $fwrite
$getpattern
$history $hold
$incsave $input $itor
$key
$list $log
$monitorb $monitorh $monitoroff $monitoron $monitor $monitoro
$nochange $nokey $nolog
$period $printtimescale
$q_add $q_exam $q_full $q_initialize $q_remove
$random $readmemb $readmemh $readmemh $realtime $realtobits $recovery $recrem $removal $reset_count $reset $reset_value $restart $rewind $rtoi
$save $scale $scope $sdf_annotate $setup $setuphold $sformat $showscopes $showvariables $showvars $signed $skew $sreadmemb $sreadmemh $stime $stop $strobeb $strobe $strobeh $strobeo $swriteb $swriteh $swriteo $swrite $sync$and$array $sync$and$plane $sync$nand$array $sync$nand$plane $sync$nor$array $sync$nor$plane $sync$or$array $sync$or$plane
$test$plusargs $time $timeformat $timeskew
$ungetc $unsigned
$value$plusargs
$width $writeb $writeh $write $writeo
/C3"Operators"
->
+:
-:
@
@*
*>
,
;
{
}
+
-
// /
*
**
%
>
>=
>>
>>>
<
<=
<<
<<<
!
!=
!==
&
&&
|
||
=
==
===
^
^~
~
~^
~&
~|
?
:
/C4"Directives"
** `
`accelerate `autoexepand_vectornets
`celldefine
`default_nettype `define `default_decay_time `default_trireg_strength `delay_mode_distributed `delay_mode_path `delay_mode_unit `delay_mode_zero
`else `elsif `endcelldefine `endif `endprotect `endprotected `expand_vectornets
`file
`ifdef `ifndef `include
`line
`noaccelerate `noexpand_vectornets `noremove_gatenames `noremove_netnames `nounconnected_drive
`protect `protected
`remove_gatenames `remove_netnames `resetall
`timescale
`unconnected_drive `undef `uselib
/C5"DelaysAndParameters"
#ay
my vimrc
""script by Lifeng Chen.
set langmenu=en_US
let $LANG = 'en_US'
syntax on
set nocompatible
set ai
set textwidth=0 ""disable line auto broken
set hlsearch
set incsearch
set magic
"set scrolloff=3 ""to see more context above and below the cursor
set lz " do not redraw while running macros (much faster) (LazyRedraw)
"set shell=csh\ -f
if has("win32")
set backupdir=c:/tmp/vim
set guifont=Lucida_Console:h11:b:cANSI
let myfile = $VIMRUNTIME."/colors/my_murphy.vim"
else
set backupdir=~/tmp/vim
set guifont=MiscFixed\ 12
"set guifont=MiscFixed\ Bold\ 11
let myfile = $HOME."/.vim/colors/my_murphy.vim"
endif
if filereadable(myfile)
colorscheme my_murphy
else
colorscheme murphy
endif
so $VIMRUNTIME/mswin.vim
"set nu ""disable line_number for TERM as it is not intended when copying
set vb t_vb= ""disable any boring beep or flash. Need to set in .gvimrc to make it really work for GUI.
"set autochdir ""don't change working dir automatically for TERM
set nowrap
set backup ""I also need non-default backupdir
set viminfo='10,:20,%,n~/.viminfo ""same viminfo: 'files w marks, :cmd his num,
"set mouse=a
"set mouse=nvc
"set mousemodel=extend
"set nowrapscan
set more
set ve=block
set vb t_vb= " no beep or flash
set fillchars=stl:^,stlnc:-,vert:\|,fold:-,diff:- " better spacing btwn windows
set showmatch "" When a bracket is inserted, briefly jump to the matching one.
set matchtime=5
set wildignore=.svn,CVS,.git,*.o,*.a,*.class,*.mo,*.la,*.so,*.obj,*.swp,*.jpg,*.png,*.xpm,*.gif
set wildmode=list:full "" Completion mode: When more than one match, list all matches and complete first match.
set wildmenu "" command-line completion operates in an enhanced mode: to invoke the completion
" syn keyword myTodo todo contained
" highlight def link myTodo Todo
"" highlight my favorites
match Todo /\c\\|\\|\/
set ru "" Show the line and column number of the cursor position
if version >= 700
set cul "" Highlight the screen line of the cursor with CursorLine
endif
"set cuc "" Highlight the screen column of the cursor with CursorColumn
"" a: Autoselect, Visually highlighted text is available for pasting into other applications as well as into Vim itself
"" b: Bottom (horizontal) scrollbar is present
set guioptions+=abrh
set guioptions-=L "" L: Left-hand scrollbar is present when there is a vertically
set foldmethod=indent
set foldlevelstart=1
"let b:did_ftplugin = 1 ""This disables loading of default plugin completely
autocmd FileType python source ~/.vim/ftplugin/python.vim
"" {{{balloon control
if version >= 700
set ballooneval "" ballon control
fun! FoldSpellBalloon()
let foldStart = foldclosed(v:beval_lnum )
let foldEnd = foldclosedend(v:beval_lnum)
let lines = []
let maxlinenum=60
" Detect if we are in a fold
if foldStart < 0
" Detect if we are on a misspelled word
let lines = spellsuggest( spellbadword(v:beval_text)[ 0 ], 5, 0 )
else
" we are in a fold
let numLines = foldEnd - foldStart + 1
" if we have too many lines in fold, show only the first half_of_max
" and the last half_of_max lines
if ( numLines >= maxlinenum )
let lines = getline( foldStart, foldStart + maxlinenum/2 - 1 )
let lines += [ '..............' ]
let lines += [ '[-- Snipped ' . ( numLines - maxlinenum ) . ' lines --]' ]
let lines += [ '..............' ]
let lines += getline( foldEnd - maxlinenum/2 + 1, foldEnd )
else
"less than maxlinenum lines, lets show all of them
let lines = getline( foldStart, foldEnd )
endif
endif
" return result
return join( lines, has( "balloon_multiline" ) ? "\n" : " " )
endfun
set balloonexpr=FoldSpellBalloon()
set balloondelay=400
"" settings invalid for the KDE, GTK+ or Win32
"set tooltipForeground=
"set tooltipBackground=
"set tooltipFont=
"set balloonevalcode 59
endif
""}}}balloon control
function! ShortStr(str,max_len)
let max_len_lead = a:max_len/2
let total_len=strlen(a:str)
let trim_str = a:str
if total_len > a:max_len
let trim_str = strpart(a:str, 0, max_len_lead) . ".." . strpart(a:str, total_len - a:max_len + max_len_lead + 2)
endif
return trim_str
endfunction
function! CurDir()
let homedir = '/home/'.$USER
let curdir = substitute(getcwd(), homedir, "~", "g")
let curdir=ShortStr(curdir, 18)
return curdir . "/"
endfunction
"set ruler "" overridden by statusline ""Show the line and column number of the cursor position
"set rulerformat=%20(%2*%<%f%=" %m%r" %3l" %c" %p%%%)
"" {{{statusline control
if filereadable(myfile)
"set statusline=%F%m%r%h%w" [FORMAT=%{&ff}]" [TYPE=%Y]" [POS=%l,%v][%p%%]" %{strftime(""%d/%m/%y" -" %H:%M"")}
"set statusline=%F%m%r%h%w\ [FORMAT=%{&ff}]\ [TYPE=%Y]\ [ASCII=\%03.3b]\ [HEX=\%02.2B]\ [POS=%04l,%04v][%p%%]\ [LEN=%L]
"set statusline=%F%m%r%h%w\ -\ ascii=x\%02.2B,\ pos=%05l,%3v\ (%p%%\ of\ %L\ lines)
set statusline= ""overwrite any existent statusline
set statusline+=%#StatusLineB1#%f%m%r%h%w%0* ""short name
set statusline+=%#StatusLineB2#[BUF:%-1.2n]%0* ""buffer number
set statusline+=%#StatusLineB3#[%{&fileformat}]%0* ""fileformat
set statusline+=%= ""spacer
"set statusline+=%#StatusLineB3#[%{CurDir()}]%0* ""fileformat
set statusline+=%#StatusLineB4#[%p%%]%0* ""position percentage
set statusline+=%#StatusLineB5#[pos=%05l,%3v]%0* ""horizontal/vertical position
set statusline+=%#StatusLineB6#[LEN=%L]%0* ""total line number
set statusline+=%< ""Left aligned to see file name all the time
set laststatus=2 "" 2: the last window will always have a status line
else
set statusline= ""overwrite any existent statusline
set statusline+=%f%m%r%h%w%0* ""short name
set statusline+=[BUF:%-1.2n]%0* ""buffer number
set statusline+=[%{&fileformat}]%0* ""fileformat
set statusline+=%= ""spacer
set statusline+=[%p%%]%0* ""position percentage
set statusline+=[pos=%05l,%3v]%0* ""horizontal/vertical position
set statusline+=[LEN=%L]%0* ""total line number
set statusline+=%< ""Left aligned to see file name all the time
set laststatus=2 "" 2: the last window will always have a status line
endif
""}}}statusline control
"--------------------------------------for mapping-------------------------------
let mapleader = ","
"{{{
"" fast switch btwn buffers
nnoremap gt
nnoremap gT
nnoremap w
nnoremap h
nnoremap l
nnoremap j
nnoremap k
"" za: open or close a fold
"" zA: open or close a fold recursively
nnoremap za
nnoremap zA
if version >= 700
"open file in new tabpage
vnoremap gf y:sp =escape(@", '\\/.*$^~[]')
nnoremap gf
endif
"" fast search: don't use as I want them echoed
nnoremap/ yiw/=escape(@", '\\/.*$^~[]')
nnoremap/b /\<\>
nnoremap/c /\c
nnoremap/e //e
nnoremap /
nnoremap ?
vnoremap y/=escape(@", '\\/.*$^~[]')q
vnoremap y?=escape(@", '\\/.*$^~[]')q
vmap /
nnoremap. .n
nnoremap :help =expand("")
vnoremap y:help "
nnoremap :e#
nnoremap :q
nnoremap :e!
""{{{single-line comment behavior
"nnoremap I#j
"nnoremap ^:,s/\v^(\s*)#\s*/\1/en
autocmd BufWinEnter,BufNewFile * nnoremap I#j
autocmd BufWinEnter,BufNewFile *.c nnoremap I//j
autocmd BufWinEnter,BufNewFile *.cpp nnoremap I//j
autocmd BufWinEnter,BufNewFile *.v nnoremap I//j
autocmd BufWinEnter,BufNewFile *.sv* nnoremap I//j
autocmd BufWinEnter,BufNewFile *.*vim nnoremap I"j
autocmd BufWinEnter,BufNewFile .*vim* nnoremap I"j
autocmd BufWinEnter,BufNewFile * nnoremap ^:,s/\v(^\s*)@\<=#\s*//en
autocmd BufWinEnter,BufNewFile *.c nnoremap ^:,s/\v(^\s*)@\<=(\/\/)\s*//en
autocmd BufWinEnter,BufNewFile *.cpp nnoremap ^:,s/\v(^\s*)@\<=(\/\/)\s*//en
autocmd BufWinEnter,BufNewFile *.v nnoremap ^:,s/\v(^\s*)@\<=(\/\/)\s*//en
autocmd BufWinEnter,BufNewFile *.sv* nnoremap ^:,s/\v(^\s*)@\<=(\/\/)\s*//en
autocmd BufWinEnter,BufNewFile *.*vim nnoremap ^:,s/\v(^\s*)@\<="\s*//en
autocmd BufWinEnter,BufNewFile .*vim* nnoremap ^:,s/\v(^\s*)@\<="\s*//en
"nnoremap I//j
"nnoremap ^:,s/\v^(\s*)\/\//\1/n
"nnoremap I#j
"nnoremap ^:,s/\v^(\s*)#/\1/n
"}}}single-line comment behavior
"" avoid annoying K by mistake
nnoremap K :K
nnoremap @a
nnoremap :lt ""quick return to previous tag stack
vnoremap [ xi[]"
vnoremap { xi{}"
vnoremap ( xi()"
vnoremap " xi"""
vnoremap ::
vnoremap / y/=escape(@", '\\/.*$^~[]')
vnoremap y/=escape(@", '\\/.*$^~[]')
vnoremap y:s/=escape(@", '\\/.*$^~[]')//
""vnoremap y:promptfind
vnoremap >gv
vnoremap inoremap ( ()
inoremap { {}
inoremap [ []
autocmd BufEnter * :if &ft != 'vim' | inoremap " ""| endif
nnoremap sv :set syntax=verilog_systemverilog
if has("win32")
nnoremap ss :source $VIMRUNTIME\..\_vimrc
else
nnoremap ss :source ~/.vimrc
endif
nnoremap v :set pastemui+mv'uV'v=:set nopaste
vnoremaptn y:tabnew =escape(@", '\\/.*$^~[]')
vnoremapte y:tabedit =escape(@", '\\/.*$^~[]')
"noremap
"" allow me to use double to give up
noremap
set langmenu=en_US
let $LANG = 'en_US'
syntax on
set nocompatible
set ai
set textwidth=0 ""disable line auto broken
set hlsearch
set incsearch
set magic
"set scrolloff=3 ""to see more context above and below the cursor
set lz " do not redraw while running macros (much faster) (LazyRedraw)
"set shell=csh\ -f
if has("win32")
set backupdir=c:/tmp/vim
set guifont=Lucida_Console:h11:b:cANSI
let myfile = $VIMRUNTIME."/colors/my_murphy.vim"
else
set backupdir=~/tmp/vim
set guifont=MiscFixed\ 12
"set guifont=MiscFixed\ Bold\ 11
let myfile = $HOME."/.vim/colors/my_murphy.vim"
endif
if filereadable(myfile)
colorscheme my_murphy
else
colorscheme murphy
endif
so $VIMRUNTIME/mswin.vim
"set nu ""disable line_number for TERM as it is not intended when copying
set vb t_vb= ""disable any boring beep or flash. Need to set in .gvimrc to make it really work for GUI.
"set autochdir ""don't change working dir automatically for TERM
set nowrap
set backup ""I also need non-default backupdir
set viminfo='10,:20,%,n~/.viminfo ""same viminfo: 'files w marks, :cmd his num,
"set mouse=a
"set mouse=nvc
"set mousemodel=extend
"set nowrapscan
set more
set ve=block
set vb t_vb= " no beep or flash
set fillchars=stl:^,stlnc:-,vert:\|,fold:-,diff:- " better spacing btwn windows
set showmatch "" When a bracket is inserted, briefly jump to the matching one.
set matchtime=5
set wildignore=.svn,CVS,.git,*.o,*.a,*.class,*.mo,*.la,*.so,*.obj,*.swp,*.jpg,*.png,*.xpm,*.gif
set wildmode=list:full "" Completion mode: When more than one match, list all matches and complete first match.
set wildmenu "" command-line completion operates in an enhanced mode:
" syn keyword myTodo todo contained
" highlight def link myTodo Todo
"" highlight my favorites
match Todo /\c\
set ru "" Show the line and column number of the cursor position
if version >= 700
set cul "" Highlight the screen line of the cursor with CursorLine
endif
"set cuc "" Highlight the screen column of the cursor with CursorColumn
"" a: Autoselect, Visually highlighted text is available for pasting into other applications as well as into Vim itself
"" b: Bottom (horizontal) scrollbar is present
set guioptions+=abrh
set guioptions-=L "" L: Left-hand scrollbar is present when there is a vertically
set foldmethod=indent
set foldlevelstart=1
"let b:did_ftplugin = 1 ""This disables loading of default plugin completely
autocmd FileType python source ~/.vim/ftplugin/python.vim
"" {{{balloon control
if version >= 700
set ballooneval "" ballon control
fun! FoldSpellBalloon()
let foldStart = foldclosed(v:beval_lnum )
let foldEnd = foldclosedend(v:beval_lnum)
let lines = []
let maxlinenum=60
" Detect if we are in a fold
if foldStart < 0
" Detect if we are on a misspelled word
let lines = spellsuggest( spellbadword(v:beval_text)[ 0 ], 5, 0 )
else
" we are in a fold
let numLines = foldEnd - foldStart + 1
" if we have too many lines in fold, show only the first half_of_max
" and the last half_of_max lines
if ( numLines >= maxlinenum )
let lines = getline( foldStart, foldStart + maxlinenum/2 - 1 )
let lines += [ '..............' ]
let lines += [ '[-- Snipped ' . ( numLines - maxlinenum ) . ' lines --]' ]
let lines += [ '..............' ]
let lines += getline( foldEnd - maxlinenum/2 + 1, foldEnd )
else
"less than maxlinenum lines, lets show all of them
let lines = getline( foldStart, foldEnd )
endif
endif
" return result
return join( lines, has( "balloon_multiline" ) ? "\n" : " " )
endfun
set balloonexpr=FoldSpellBalloon()
set balloondelay=400
"" settings invalid for the KDE, GTK+ or Win32
"set tooltipForeground=
"set tooltipBackground=
"set tooltipFont=
"set balloonevalcode 59
endif
""}}}balloon control
function! ShortStr(str,max_len)
let max_len_lead = a:max_len/2
let total_len=strlen(a:str)
let trim_str = a:str
if total_len > a:max_len
let trim_str = strpart(a:str, 0, max_len_lead) . ".." . strpart(a:str, total_len - a:max_len + max_len_lead + 2)
endif
return trim_str
endfunction
function! CurDir()
let homedir = '/home/'.$USER
let curdir = substitute(getcwd(), homedir, "~", "g")
let curdir=ShortStr(curdir, 18)
return curdir . "/"
endfunction
"set ruler "" overridden by statusline ""Show the line and column number of the cursor position
"set rulerformat=%20(%2*%<%f%=" %m%r" %3l" %c" %p%%%)
"" {{{statusline control
if filereadable(myfile)
"set statusline=%F%m%r%h%w" [FORMAT=%{&ff}]" [TYPE=%Y]" [POS=%l,%v][%p%%]" %{strftime(""%d/%m/%y" -" %H:%M"")}
"set statusline=%F%m%r%h%w\ [FORMAT=%{&ff}]\ [TYPE=%Y]\ [ASCII=\%03.3b]\ [HEX=\%02.2B]\ [POS=%04l,%04v][%p%%]\ [LEN=%L]
"set statusline=%F%m%r%h%w\ -\ ascii=x\%02.2B,\ pos=%05l,%3v\ (%p%%\ of\ %L\ lines)
set statusline= ""overwrite any existent statusline
set statusline+=%#StatusLineB1#%f%m%r%h%w%0* ""short name
set statusline+=%#StatusLineB2#[BUF:%-1.2n]%0* ""buffer number
set statusline+=%#StatusLineB3#[%{&fileformat}]%0* ""fileformat
set statusline+=%= ""spacer
"set statusline+=%#StatusLineB3#[%{CurDir()}]%0* ""fileformat
set statusline+=%#StatusLineB4#[%p%%]%0* ""position percentage
set statusline+=%#StatusLineB5#[pos=%05l,%3v]%0* ""horizontal/vertical position
set statusline+=%#StatusLineB6#[LEN=%L]%0* ""total line number
set statusline+=%< ""Left aligned to see file name all the time
set laststatus=2 "" 2: the last window will always have a status line
else
set statusline= ""overwrite any existent statusline
set statusline+=%f%m%r%h%w%0* ""short name
set statusline+=[BUF:%-1.2n]%0* ""buffer number
set statusline+=[%{&fileformat}]%0* ""fileformat
set statusline+=%= ""spacer
set statusline+=[%p%%]%0* ""position percentage
set statusline+=[pos=%05l,%3v]%0* ""horizontal/vertical position
set statusline+=[LEN=%L]%0* ""total line number
set statusline+=%< ""Left aligned to see file name all the time
set laststatus=2 "" 2: the last window will always have a status line
endif
""}}}statusline control
"--------------------------------------for mapping-------------------------------
let mapleader = ","
"{{{
"" fast switch btwn buffers
nnoremap
nnoremap
nnoremap
nnoremap
nnoremap
nnoremap
nnoremap
"" za: open or close a fold
"" zA: open or close a fold recursively
nnoremap
nnoremap
if version >= 700
"open file in new tabpage
vnoremap
nnoremap
endif
"" fast search: don't use
nnoremap
nnoremap
nnoremap
nnoremap
nnoremap
nnoremap
vnoremap
vnoremap
vmap
nnoremap
nnoremap
vnoremap
nnoremap
nnoremap
nnoremap
""{{{single-line comment behavior
"nnoremap
"nnoremap
autocmd BufWinEnter,BufNewFile * nnoremap
autocmd BufWinEnter,BufNewFile *.c nnoremap
autocmd BufWinEnter,BufNewFile *.cpp nnoremap
autocmd BufWinEnter,BufNewFile *.v nnoremap
autocmd BufWinEnter,BufNewFile *.sv* nnoremap
autocmd BufWinEnter,BufNewFile *.*vim nnoremap
autocmd BufWinEnter,BufNewFile .*vim* nnoremap
autocmd BufWinEnter,BufNewFile * nnoremap
autocmd BufWinEnter,BufNewFile *.c nnoremap
autocmd BufWinEnter,BufNewFile *.cpp nnoremap
autocmd BufWinEnter,BufNewFile *.v nnoremap
autocmd BufWinEnter,BufNewFile *.sv* nnoremap
autocmd BufWinEnter,BufNewFile *.*vim nnoremap
autocmd BufWinEnter,BufNewFile .*vim* nnoremap
"nnoremap
"nnoremap
"nnoremap
"nnoremap
"}}}single-line comment behavior
"" avoid annoying K by mistake
nnoremap
nnoremap
nnoremap
vnoremap
vnoremap
vnoremap
vnoremap
vnoremap :
vnoremap / y
vnoremap
vnoremap
""vnoremap
vnoremap
vnoremap
inoremap
inoremap
autocmd BufEnter * :if &ft != 'vim' | inoremap
nnoremap
if has("win32")
nnoremap
else
nnoremap
endif
nnoremap
vnoremap
vnoremap
"noremap
"" allow me to use double
noremap