return{{"dhananjaylatkar/cscope_maps.nvim",dependencies={"folke/which-key.nvim",-- optional [for whichkey hints]"nvim-telescope/telescope.nvim",-- optional [for picker="telescope"]"ibhagwan/fzf-lua",-- optional [for picker="fzf-lua"]"nvim-tree/nvim-web-devicons",-- optional [for devicons in telescope or fzf]},opts={-- USE EMPTY FOR DEFAULT OPTIONS-- DEFAULTS ARE LISTED BELOW-- 不显示询问skip_input_prompt=true,-- "true" doesn't ask for input},}}
用法
配合map-key插件
1
2
3
4
5
6
7
8
9
10
<leader> + c + b Build database (生成数据库文件)<leader> + c + a Find places where this symbo is assigned
<leader> + c + c Find functions calling this function(查找引用)<leader> + c + d Find functions called by this function(查找被当前函数调用的函数)<leader> + c + e Find this egrep pattern
<leader> + c + f Find this file
<leader> + c + g Find this global definition
<leader> + c + i Find files #including this file<leader> + c + s Find this symbol
<leader> + c + t Find this text string
配置cscope自动生成数据库
1
2
3
4
5
6
7
8
localgroup=vim.api.nvim_create_augroup("CscopeBuild",{clear=true})vim.api.nvim_create_autocmd("BufWritePost",{pattern={"*.c","*.h","*.cc","*.cpp"},callback=function()vim.cmd("Cscope db build")end,group=group,})