2018-01-01 21:39:59 +08:00
---
title: "SpaceVim cscope layer"
2018-05-12 19:01:00 +08:00
description: "cscope layer provides a smart cscope and pycscope helper for SpaceVim, help users win at cscope"
2018-01-01 21:39:59 +08:00
---
2018-06-23 14:37:41 +08:00
# [Available Layers](../) >> cscope
2018-05-12 19:01:00 +08:00
<!-- vim - markdown - toc GFM -->
2021-08-22 14:35:22 +08:00
- [Intro ](#intro )
2018-06-23 14:37:41 +08:00
- [Install ](#install )
2018-05-12 19:01:00 +08:00
- [cscope ](#cscope )
- [layer ](#layer )
2021-08-22 14:35:22 +08:00
- [Layer options ](#layer-options )
2018-05-12 19:01:00 +08:00
- [Key bindings ](#key-bindings )
<!-- vim - markdown - toc -->
2021-08-22 14:35:22 +08:00
## Intro
2018-01-01 21:39:59 +08:00
This layer provides a smart [Cscope ](http://cscope.sourceforge.net/ ) and [PyCscope ](https://github.com/portante/pycscope ) helper for SpaceVim.
For more info about the differences between Cscope and other similar tools, please read [Comparison with Similar Tools ](https://github.com/oracle/opengrok/wiki/Comparison-with-Similar-Tools )
2018-06-23 14:37:41 +08:00
## Install
2018-01-01 21:39:59 +08:00
### cscope
```shell
sudo pacman -S cscope
```
2019-08-27 19:57:17 +08:00
In windows, you can use scoop to install cscope:
```
scoop install cscope
```
2018-01-01 21:39:59 +08:00
### layer
2018-05-12 19:01:00 +08:00
To use this configuration layer, add it to your configuration file.
2018-01-01 21:39:59 +08:00
2018-05-12 19:01:00 +08:00
```toml
[[layers]]
2019-02-02 22:26:35 +08:00
name = "cscope"
2018-01-01 21:39:59 +08:00
```
2021-08-22 14:35:22 +08:00
## 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.
2018-01-01 21:39:59 +08:00
## Key bindings
| Key Binding | Description |
| ----------- | -------------------------------------- |
2018-01-01 22:02:16 +08:00
| `SPC m c =` | Find assignments to this symbol |
2019-02-02 22:26:35 +08:00
| `SPC m c i` | Create cscope DB |
| `SPC m c u` | Update cscope DBs |
2018-01-01 21:39:59 +08:00
| `SPC m c c` | Find functions called by this function |
| `SPC m c C` | Find functions calling this function |
| `SPC m c d` | find global definition of a symbol |
| `SPC m c r` | find references of a symbol |
2018-01-01 22:02:16 +08:00
| `SPC m c f` | find file |
| `SPC m c F` | find which files include a file |
| `SPC m c e` | search regular expression |
| `SPC m c t` | search text |