How to let cscope use absolute path in cscope.out file?

后端 未结 6 766
野的像风
野的像风 2021-02-02 02:11

Everytime after load a cscope.out in Vim, I need to change Vim\'s \"pwd\" to the same directory as cscope.out file is under, which might be due to that cscope use relative path

6条回答
  •  野的像风
    2021-02-02 02:49

    @Aaron H. is right.

    For my configuration I used the cscope_maps.vim plugin and modified the following lines:

      40     " add any cscope database in current directory
      41     if filereadable("/usr/project/cscope.out")
      42         cs add /usr/project/cscope.out /usr/project
      43     " else add the database pointed to by environment variable 
      44     elseif $CSCOPE_DB != ""
      45         cs add $CSCOPE_DB
      46     endif
    

    Where "/usr/project" is the location of the cscope.out file and the absolute path I want to use.

提交回复
热议问题