开发者社区> 问答> 正文

Vim函数跳转定义无效 : 配置报错

我输入tags就会出现如图所示,那句提示是啥意思?

我使用函数切换命令总是出现下面这些提示,该如何解决??


在我的目录下有tags文件,截图给你们看看

展开
收起
kun坤 2020-06-03 14:33:42 837 0
1 条回答
写回答
取消 提交回答
  • 你的工程下 有 tags 文件没有? 
    就是你输入 命令  ctags -R 生成的文件 ######唉######在工程目录运行 ctags -R######

    引用来自“云松”的答案

    你的工程下 有 tags 文件没有?  就是你输入 命令  ctags -R 生成的文件
    tags文件是有的,我cmd 定位到vim目录,输入ctags -R 就生成了一个tags文件,但是依然出现这种现象。 ######你需要在你的工程里面运行ctags -R 而不是在 vim的目录里面,比如你的工程 叫 pro 你应该cd到这个目录里面 运行######就是我用cd 进入我的vim目录,输入ctags -R,生成了一个tags文件,我已经重新上传了tags的截图,你看看,到底那里错了吗?######“我cmd 定位到vim目录” 这句话看不懂######

    引用来自“温习江湖”的答案

    在工程目录运行 ctags -R
    tags文件是有的,我cmd 定位到vim目录,输入ctags -R 就生成了一个tags文件,但是依然出现这种现象。 ###### vim中设定tags路径 :set tags=/path/tags ######

    引用来自“林希”的答案

    hi,你好漂亮哦 ,看你好像一直都很多愁善感。看张搞笑的图片,笑一下吧,网络上有流传这是欧洲的转基因航空母鸡,可以骑的哦~。 ######在Windows这么先进的操作系统上面还使用这个VIM是出于什么目的呢?你是因为时间太多了,还是希望VIM可以让你变得聪明呢?######确实,在windows下没必要折腾这些。######
    "自动添加tags文件  
     set tags+=./tags,./../tags,./../../tags,./../../../tags
     
             
    我的vimrc文件 http://weiki.tk/file/.vimrc.html
    ######
    " Sections:
    "    -> Pathogen
    "    -> General
    "    -> Cscope
    "    -> VIM user interface
    "    -> TagbarToggle
    "    -> Neocomplcache
    "    -> ClangComplete
    "    -> Neocomplcache-clang
    "    -> GUI General Setting
    "    -> Colors and Fonts
    "    -> Files and backups
    "    -> Text, tab and indent related
    "    -> Visual mode related
    "    -> Moving around, tabs and buffers
    "    -> Status line
    "    -> Editing mappings
    "    -> vimgrep searching and cope displaying
    "    -> Spell checking
    "    -> Misc
    "    -> Helper functions
    "    -> Pydiction
    "    -> Tabular
    "    -> SingalComplile
    "    -> Markdown
    
    """""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
    " ==>  Cscope  
    """""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
    autocmd BufEnter * lcd %:p:h
    
    map <F12> :call Do_CsTag()<CR>
    nmap <C-@>s :cs find s <C-R>=expand("<cword>")<CR><CR>:copen<CR>
    nmap <C-@>g :cs find g <C-R>=expand("<cword>")<CR><CR>
    nmap <C-@>c :cs find c <C-R>=expand("<cword>")<CR><CR>:copen<CR>
    nmap <C-@>t :cs find t <C-R>=expand("<cword>")<CR><CR>:copen<CR>
    nmap <C-@>e :cs find e <C-R>=expand("<cword>")<CR><CR>:copen<CR>
    nmap <C-@>f :cs find f <C-R>=expand("<cfile>")<CR><CR>:copen<CR>
    nmap <C-@>i :cs find i ^<C-R>=expand("<cfile>")<CR>$<CR>:copen<CR>
    nmap <C-@>d :cs find d <C-R>=expand("<cword>")<CR><CR>:copen<CR>
    function Do_CsTag()
        let dir = getcwd()
        if filereadable("tags")
            if(g:iswindows==1)
                let tagsdeleted=delete(dir."\\"."tags")
            else
                let tagsdeleted=delete("./"."tags")
            endif
            if(tagsdeleted!=0)
                echohl WarningMsg | echo "Fail to do tags! I cannot delete the tags" | echohl None
                return
            endif
        endif
        if has("cscope")
            silent! execute "cs kill -1"
        endif
        if filereadable("cscope.files")
            if(g:iswindows==1)
                let csfilesdeleted=delete(dir."\\"."cscope.files")
            else
                let csfilesdeleted=delete("./"."cscope.files")
            endif
            if(csfilesdeleted!=0)
                echohl WarningMsg | echo "Fail to do cscope! I cannot delete the cscope.files" | echohl None
                return
            endif
        endif
        if filereadable("cscope.out")
            if(g:iswindows==1)
                let csoutdeleted=delete(dir."\\"."cscope.out")
            else
                let csoutdeleted=delete("./"."cscope.out")
            endif
            if(csoutdeleted!=0)
                echohl WarningMsg | echo "Fail to do cscope! I cannot delete the cscope.out" | echohl None
                return
            endif
        endif
        if(executable('ctags'))
            "silent! execute "!ctags -R --c-types=+p --fields=+S *"
            silent! execute "!ctags -R --c++-kinds=+p --fields=+iaS --extra=+q ."
        endif
        if(executable('cscope') && has("cscope") )
            if(g:iswindows!=1)
                silent! execute "!find . -name '*.h' -o -name '*.c' -o -name '*.cpp' -o -name '*.java' -o -name '*.cs' > cscope.files"
            else
                silent! execute "!dir /s/b *.c,*.cpp,*.h,*.java,*.cs >> cscope.files"
            endif
            silent! execute "!cscope -b"
            execute "normal :"
            if filereadable("cscope.out")
                execute "cs add cscope.out"
            endif
        endif
    endfunction
    ######在~/.vimrc中加入以上代码。
    2020-06-04 10:33:56
    赞同 展开评论 打赏
问答分类:
问答地址:
问答排行榜
最热
最新

相关电子书

更多
低代码开发师(初级)实战教程 立即下载
冬季实战营第三期:MySQL数据库进阶实战 立即下载
阿里巴巴DevOps 最佳实践手册 立即下载