Back to Spacevim

SpaceVim cscope layer

docs/layers/cscope.md

2.4.02.2 KB
Original Source

Available Layers >> cscope

<!-- vim-markdown-toc GFM --> <!-- vim-markdown-toc -->

Intro

This layer provides a smart Cscope and PyCscope helper for SpaceVim.

For more info about the differences between Cscope and other similar tools, please read Comparison with Similar Tools

Install

cscope

For Archlinux

shell
sudo pacman -S cscope

For Ubuntu

shell
sudo apt install cscope

In windows, you can use scoop to install cscope:

scoop install cscope

layer

To use this configuration layer, add it to your configuration file.

toml
[[layers]]
    name = "cscope"

Layer options

  • cscope_command: set the command or path of cscope executable.
  • auto_update: enable/disable auto udpate when saving files.
  • open_location: enable/disable open location list after searching.
  • preload_path: set the proload paths.
  • list_files_command: set the command to list all files which should be involed to create cscope database, By default it is:
    ['rg', '--color=never', '--files']
    
    To specific filetypes, use custom command, for example:
    [[layers]]
        name = 'cscope'
        list_files_command = ['rg', '--color=never', '--files', '--type', 'c']
    

Key bindings

Key BindingDescription
SPC m c =Find assignments to this symbol
SPC m c iCreate cscope DB
SPC m c uUpdate cscope DBs
SPC m c cFind functions called by this function
SPC m c CFind functions calling this function
SPC m c dfind global definition of a symbol
SPC m c rfind references of a symbol
SPC m c ffind file
SPC m c Ffind which files include a file
SPC m c esearch regular expression
SPC m c tsearch text