Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
BSD 0-clause license, "Zero Clause BSD", SPDX: 0BSD

Copyright (C) 2022 by Daniel C. Nygren <dan.nygren@gmail.com>

Permission to use, copy, modify, and/or distribute this software for any purpose
with or without fee is hereby granted.

THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
PERFORMANCE OF THIS SOFTWARE.
24 changes: 20 additions & 4 deletions README
Original file line number Diff line number Diff line change
@@ -1,9 +1,25 @@
This is a mirror of http://www.vim.org/scripts/script.php?script_id=157
This Vim plugin is based on prior work from a number of authors. See the
cscope_helper.vim comment header block for details.

This plugin will automatically load cscope.out databases into vim when you open a C file. (headers included)
Save this file as ~/.vim/plugin/cscope_helper.vim so you can invoke vim/gvim in
subdirectories and still get cscope.out loaded.

It does a search starting at the directory that the file is in, and checking the parent directories until it find the cscope.out file. The idea being that you can start editing a source file deep in a project dir, and it will find the correct cscope database a couple dirs up.
A prerequisite for use is that an initial Cscope database has been generated.
Cscope can be executed on the command line, or a script like cscope_db_gen can
be used to generate the database. See https://github.com/dnygren/cscope_db_gen
for an example of how to generate a Cscope database for C/C++.

This version also creates some macros and a menu that can be useful. If you don't like them, you can set g:autocscope_menus to 0 and they won't load.
This plugin will automatically load a cscope.out database (created manually in
the base directory of a source code file tree) into Vim when you open a file.

It performs a search starting at the directory that the edited file is in,
checking the parent directories until it finds the cscope.out file. Therefore
you can start editing a file deep in a project directory, and it will find the
correct Cscope database. It will also automatically update the cscope database
after file saves. If new files are created, the cscope.out database must be
recreated manually.

Keystroke macros and a pull down menu are provided to invoke the Cscope
functions.

A cheatsheet is provided to assist in executing the keystroke macros.
24 changes: 24 additions & 0 deletions cheatsheet.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
"""""""""""""" Jason Duell's Cscope/Vim Key Mappings Cheat Sheet """""""""""""""
" (Based on http://cscope.sourceforge.net/cscope_maps.vim with light edits.)
" The following maps all invoke one of the following Cscope search types:
"
" 's' symbol Find all references to the token under cursor
" 'g' global Find global definition(s) of the token under cursor
" 'c' calls Find all calls to the function name under cursor
" 'd' called Find functions that function under cursor calls
" 't' text Find all instances of the text under cursor
" 'e' egrep Find egrep pattern for the word under cursor
" 'f' file Open the filename under cursor
" 'i' includes Find files that include the filename under cursor
"
" The starting keys for the searches are:
" CTRL-\ (Control Backslash) jumps the whole Vim window to the search result,
" CTRL-H (Control H) splits the Vim window horizontally to display the result,
" CTRL-V (Control V) splits the Vim window vertically to display the result.
" CTRL-T (Control T) jumps back to where the search began.
"
" To do the first type of search, hit 'CTRL-\', followed by one of the Cscope
" search types above (s,g,c,d,t,e,f,i). Use CTRL-T to go back to where the
" searching began. The second and third types of search use CTRL-H or CTRL-V
" to split the window horizontally or vertically to display the search result.
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
184 changes: 0 additions & 184 deletions plugin/autoload_cscope.vim

This file was deleted.

Loading