Skip to content

Latest commit

 

History

History
74 lines (57 loc) · 2.35 KB

README.org

File metadata and controls

74 lines (57 loc) · 2.35 KB

Cscope contribution layer for Spacemacs

img/cscope.png

Table of Contents

Description

This layer provides bindings for using Cscope and PyCscope in Spacemacs.

Cscope provides indexing and searching capabilities for C and C++ code. PyCscope extends these capabilities for Python code as well. See here for a comparison between Cscope and other similar tools (such as gtags).

Install

Layer

To use this contribution add it to your ~/.spacemacs

(setq-default dotspacemacs-configuration-layers '(cscope))

Cscope

Install Cscope through your package manager, or download it from the website and build it from source.

From package manager (for example, Ubuntu):

sudo apt-get install cscope

From source:

tar xvf cscope-15.8b
cd cscope-15.8b
./configure
make
sudo make install

PyCscope

Install PyCscope through pip:

pip install pycscope

Usage

Before using any helm-cscope commands, remember to create a Cscope index file. Do it by running the command cscope-index-files for C and C++ projects, or the command cscope/run-pycscope for Python projects, bound to SPC m g i.

Key bindings

Key BindingDescription
SPC m g cfind which functions are called by a function
SPC m g Cfind where a function is called
SPC m g dfind global definition of a symbol
SPC m g esearch regular expression
SPC m g ffind a file
SPC m g Ffind which files include a file
SPC m g icreate Cscope index
SPC m g rfind references of a symbol
SPC m g xsearch text