This repository has been archived on 2024-10-22. You can view files and clone it, but cannot push or open issues or pull requests.
spacemacs/contrib/cscope
2015-07-23 22:20:25 -04:00
..
img Add Cscope layer (includes PyCscope) 2015-07-23 21:45:21 -04:00
packages.el cscope layer: Make it agnostic of c-c++ and python modes 2015-07-23 22:20:25 -04:00
README.org Convert cscope layer README to org 2015-07-23 21:56:04 -04:00

Cscope contribution layer for Spacemacs

/TakeV/spacemacs/media/commit/f3a8e009b54f56a190945ac42fde026a30cb7eed/contrib/cscope/img/cscope.png

Table of Contents   TOC@4

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 Binding Description
SPC m g c find which functions are called by a function
SPC m g C find where a function is called
SPC m g d find global definition of a symbol
SPC m g e search regular expression
SPC m g f find a file
SPC m g F find which files include a file
SPC m g i create Cscope index
SPC m g r find references of a symbol
SPC m g x search text