how to auto load cscope.out in vim

后端 未结 1 1202
一向
一向 2021-01-03 08:39

I want to auto load my cscope.out in the subdirectory of my project, so I add this scripts in my .vimrc, which is as follows:

set c         


        
相关标签:
1条回答
  • 2021-01-03 09:36

    If you add a cscope.out make sure it to set the correct path prefix. Otherwise it will show you the result but cannot load the file.

    example:

       cs add ../cscope.out ../
    

    so you should change your script to

     ...
     else
       let cscope_file=findfile("cscope.out", ".;")
       let cscope_pre=matchstr(cscope_file, ".*/")
       "echo cscope_file
       if !empty(cscope_file) && filereadable(cscope_file)
          exe "cs add" cscope_file cscope_pre
       endif
     ...
    
    0 讨论(0)
提交回复
热议问题