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

后端 未结 6 780
野的像风
野的像风 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 03:05

    You can ask vim to interpret the paths in cscope.out relative to the location of the cscope.out file by setting the cscoperelative option. From :help csre:

    If 'cscoperelative' is set, then in absence of a prefix given to cscope (prefix is the argument of -P option of cscope), basename of cscope.out location (usually the project root directory) will be used as the prefix to construct an absolute path. The default is off. Note: This option is only effective when cscope (cscopeprg) is initialized without a prefix path (-P).

    Examples

    : set csre
    : set nocsre

提交回复
热议问题