1 Star 0 Fork 0

houwentaoff/cscope.vim

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
贡献代码
同步代码
取消
提示: 由于 Git 不支持空文件夾,创建文件夹后会生成空的 .keep 文件
Loading...
README
This is a mirror of http://www.vim.org/scripts/script.php?script_id=4082

This plugin helps you to create cscope database and connect to existing proper database automatically.

For latest version and bug reports, please go to https://github.com/brookhong/cscope.vim

Default settings --

    " in case your cscope execute is not in system path.
    " let g:cscope_cmd = 'D:/tools/vim/cscope.exe'
    " s: Find this C symbol
    map <leader>fs :call CscopeFind('s', expand('<cword>'))<CR>
    " g: Find this definition
    map <leader>fg :call CscopeFind('g', expand('<cword>'))<CR>
    " d: Find functions called by this function
    map <leader>fd :call CscopeFind('d', expand('<cword>'))<CR>
    " c: Find functions calling this function
    map <leader>fc :call CscopeFind('c', expand('<cword>'))<CR>
    " t: Find this text string
    map <leader>ft :call CscopeFind('t', expand('<cword>'))<CR>
    " e: Find this egrep pattern
    map <leader>fe :call CscopeFind('e', expand('<cword>'))<CR>
    " f: Find this file
    map <leader>ff :call CscopeFind('f', expand('<cword>'))<CR>
    " i: Find files #including this file
    map <leader>fi :call CscopeFind('i', expand('<cword>'))<CR>
    map <leader>l :call ToggleLocationList()<CR>

To use the plugin, just open your source file with VIM, and press <leader>fs with cursor on a function name.

The plugin will try to find and connect a proper cscope database for current file. If there is no proper cscope database for current file, you are prompted to specify a folder with a string like --

    *** Can not find proper cscope db, please input a path to create cscope db for. ***

Then the plugin will create cscope database for you, connect to it, and find what you want.

The found result will be listed in location list window, press <leader>l to toggle it.

Next time when you open the same file or other file that the cscope database can be used for, the plugin will connect to the cscope database automatically. You need not take care of anything about cscope database.

There is one case you need take care cscope database. If you have some files added/edited in those folders for which cscope databases have been created, then you want to refresh the cscope database, you can use command --

    :CscopeGen [path_to_the_folder]

If there is no path_to_the_folder provided, all existing cscope databases will be re-created.

For exmample,

    :CscopeGen /works/vim/src

Other commands --

    :CscopeClear    to remove all existing cscope databases
    :CscopeList     to list all existing cscope databases

Here is example output from :CscopeList

 ID                   COUNT    PATH
*1337668712           3        /works/vim/src

'*'         means the db has been connected.
ID          id of the db.
COUNT       how many times this db has ever been used.
PATH        which folder the db is for.

空文件

简介

create cscope database and connect to existing proper database automatically. 展开 收起
取消

发行版

暂无发行版

贡献者

全部

近期动态

加载更多
不能加载更多了
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
VimL
1
https://gitee.com/houwentaoff/cscope.vim.git
git@gitee.com:houwentaoff/cscope.vim.git
houwentaoff
cscope.vim
cscope.vim
master

搜索帮助