Ⅰ. 插件描述
Use cscope within vimⅡ. 基本信息
|
Ⅲ. 安装方法
使用Vundle管理器安装
在你的.vimrc下添加:Plugin 'amitab/vim-unite-cscope'
… 然后在Vim中运行以下命令:
:source %
:PluginInstall
对于Vundle版本 < 0.10.2,请用上面的Bundle替换Plugin。
使用NeoBundle管理器安装
在你的.vimrc下添加:NeoBundle 'amitab/vim-unite-cscope'
… 然后在Vim中运行以下命令:
:source %
:NeoBundleInstall
使用VimPlug管理器安装
在你的.vimrc下添加:Plug 'amitab/vim-unite-cscope'
… 然后在Vim中运行以下命令:
:source %
:PlugInstall
使用Pathogen管理器安装
在终端中运行以下命令:cd ~/.vim/bundle
git clone https://github.com/vim-scripts/vim-unite-cscope
Ⅳ. 文档说明
# vim-unite-cscope
Uniting cscope with vim
This is a package similar to my other package (https://www.github.com/amitab/atom-cscope)
PS: I just learnt vim scripting recently and there may be mistakes/better way of doing things.
If you find any problems, please let me know.
What it does?
- Find this C symbol: ✓
- Find this global definition: ✓
- Find functions called by this function: ✓
- Find functions calling this function: ✓
- Find this text string: ✓
- Change this text string: ✗
- Find this egrep pattern: ✓
- Find this file: ✓
- Find files #including this file: ✓
- Find assignments to this symbol: ✓
Set it up?
This package depends on:
- vim-unite (https://github.com/Shougo/unite.vim)
- vim-proc (https://github.com/Shougo/vimproc.vim)
After you've installed the dependencies, you can install this package
with your favioure package manager.
Example:
- With Vundle -
Plugin 'amitab/vim-unite-cscope'- With Pathogen
cd ~/.vim/bundle
git clone https://github.com/amitab/vim-unite-cscope- With Neobundle
NeoBundle 'amitab/vim-unite-cscope'To generate cscope.out manually, in your project directory run:
find . -name "*.c" -o -name "*.cpp" -o -name "*.h" -o -name "*.hpp" > cscope.files
cscope -q -R -b -i cscope.filesAnd then the package will be able to use the cscope.out file to generate results.
Usage
- In command palette, run:
:Unite cscope/find_this_symbol - Then a prompt appears asking for an input
- Input your query and press enter
Screenshots
Input your search term:
Voila! Results:
Further Improvements?
- Add 'Change this text string' functionality