On 2007-05-03, Natesh Kedlaya <[EMAIL PROTECTED]> wrote: > Hi, > I have built a cscope db of a source tree which was mounted on /mnt. > Now, I want to use the same cscope db on the same source tree but mounted > on a different mount point /scratch. > > I could achieve this using the standard cscope and EDITOR env variable > trick as shown below. > 1. set the EDITOR to a shell script of my own. The shell script contains > the following lines in it. > > #!/bin/sh > offset=$1 > fname=`echo $2 | sed s@/mnt/@/scratch/@` > xterm -e /usr/bin/vim $offset $fname > > 2. Run cscope and when it tries to open a file, it goes through my > EDITOR script and does the right job. > > > How do I achieve the same in vim6.3? > I have the necessary settings in my .vimrc to work with cscope : > > if has("cscope") > set cscopeprg=/usr/local/bin/cscope > set csto=0 > set cst > set nocsverb > " add any database in current directory > if filereadable("cscope.out") > cs add cscope.out > " else add database pointed to by environment > elseif $CSCOPE_DB != "" > cs add $SRCHOME/$NDE_PRODUCT/utl/ $SRCHOME -U > endif > set cspc=5 > set csverb > endif
Here's an idea, untested. Create a wrapper script around cscope, as you did before for EDITOR. The script contains just this line: /usr/local/bin/cscope "$@" | sed s@/mnt/@/scratch/@ Change your .vimrc to set cscopeprg to the name of this script. HTH, Gary -- Gary Johnson | Agilent Technologies [EMAIL PROTECTED] | Mobile Broadband Division | Spokane, Washington, USA