vim(二) 代码查看
ctags,cscope 查看代码
生成cscope脚本文件
#!/bin/bash
if [ -f "*.cscope" ]; then
rm -fr *.cscope
fi
if [ "$1" == "go" ]; then
echo "go"
find `pwd` -name "*.go" > cscope.files
cscope -Rb
elif [ "$1" == "c" ]; then
echo "c"
find `pwd` -name "*.h" > cscope.files
find `pwd` -name "*.c" >> cscope.files
cscope -Rb
elif [ "$1" == "cpp" ]; then
echo "cpp"
find `pwd` -name "*.h" > cscope.files
find `pwd` -name "*.cpp" >> cscope.files
cscope -bkq -i cscope.files
ctags -R
elif [ "$1" == "rm" ]; then
rm -fr cscope.* tags
fi
欢迎评论交流