使用 cscope 的时候总是提示没有连接
Tofloor
poster avatar
yinduren
deepin
2016-07-11 23:20
Author
请各位大侠帮忙给看看:
需要手动运行:cs add cscope.out 才能正常使用
.vimrc中 cscope 相关配置如下:
"Settings for cscope
if has("cscope")
    if filereadable("/usr/bin/cscope")
        set csprg=/usr/bin/cscope     " specify which cscope to be used
    elseif filereadable("/usr/local/bin/cscope")
        set csprg=/usr/local/bin/cscope     " specify which cscope to be used
    endif

    set csto=0                          " 0 means search cscope database first, then search tags file
    set cst                             " use |:cstag|(:cs find g), not default :tag
    set nocsverb                        " do not show if database is added successful

    " add any database in current directory
    if filereadable("cscope.out")
        cscope add cscope.out           " add cscope database
    " else add database pointed to by environment
    elseif $CSCOPE_DB != ""
        cscope add $CSCOPE_DB
    endif

    set csverb                          " show if database is added successful
endif


Reply Favorite View the author
All Replies
avatar
jingle
deepin
2016-07-12 01:39
#1
好的,我反馈下,看能否能解决。
Reply View the author
avatar
yinduren
deepin
2016-07-12 01:54
#2
https://bbs.deepin.org/post/41398
好的,我反馈下,看能否能解决。

这个可能跟我的设置有关,不一定是系统问题,多谢关心
Reply View the author
avatar
yanbowen
deepin
Community Developer
2016-07-12 04:04
#3
vim 中执行命令需要这样用 exec "!cscope  add cscope.out"
Reply View the author
avatar
yinduren
deepin
2016-07-12 18:14
#4
https://bbs.deepin.org/post/41398
vim 中执行命令需要这样用 exec "!cscope  add cscope.out"

不需要啊,有两种方式
1. 在.vimrc中添加 cs add cscope.out
     我的.vimrc已经有了,并且没有报错,但是不生效
2. 在vim中手动执行 cscope add cscope.out
    这样的话每次运行vim都要手动执行,非常麻烦,所以添加到了.vimrc中
    这种方式,没有问题。
Reply View the author
avatar
yinduren
deepin
2016-07-14 00:10
#5
自己顶顶
Reply View the author
avatar
yinduren
deepin
2016-07-14 18:46
#6
没人遇到过吗,自己顶顶
Reply View the author
avatar
yanbowen
deepin
Community Developer
2016-07-14 22:44
#7
你可以先测试下你的那条语句是否执行,如果执行了再去找执行无效的问题。
Reply View the author
avatar
yinduren
deepin
2016-07-15 01:32
#8
https://bbs.deepin.org/post/41398
好的,我反馈下,看能否能解决。

我试过多个系统,只有 deepin 有问题,我的机器型号是 lenovo 450
Reply View the author
avatar
yinduren
deepin
2016-07-15 18:26
#9
https://bbs.deepin.org/post/41398
你可以先测试下你的那条语句是否执行,如果执行了再去找执行无效的问题。 ...

语句执行了,报了VIM E563的错误
只有奖这个语句卸载.vimrc中执行的时候会出现这个问题。
进入vim以后,再执行cs add cscope.out就没问题了
Reply View the author