annotate runtime/doc/if_cscop.txt @ 33566:e1e3805fcd96 v9.0.2028

patch 9.0.2028: confusing build dependencies Commit: https://github.com/vim/vim/commit/5d03525cdef5db1b1cedfa26c6f8a21aaa207ec0 Author: Yee Cheng Chin <ychin.git@gmail.com> Date: Sun Oct 15 09:50:53 2023 +0200 patch 9.0.2028: confusing build dependencies Problem: confusing build dependencies Solution: clean them up, make them parallelizable Separate vim binary and unittest dependencies, make them parallelizable Clean up make dependencies so Vim and unit test binaries only depend on the object files they need. This fixes an existing issue where after running unit tests, the Vim binary would be invalidated, which results in it having to be linked again when running script tests, even though Vim was already previously built. Make link.sh (script we use to link those binaries) generate namespaced temporary files for each app to avoid them colliding with each other. This allows `unittesttargets` to be built in parallel. These fixes are useful when using link-time-optimization as the link phase could now take minutes rather than a few seconds. closes: #13344 Signed-off-by: Christian Brabandt <cb@256bit.org> Co-authored-by: Yee Cheng Chin <ychin.git@gmail.com>
author Christian Brabandt <cb@256bit.org>
date Sun, 15 Oct 2023 10:00:03 +0200
parents f8116058ca76
children 4635e43f2c6f
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
29314
f8116058ca76 release version 9.0
Bram Moolenaar <Bram@vim.org>
parents: 27036
diff changeset
1 *if_cscop.txt* For Vim version 9.0. Last change: 2022 Jan 08
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4 VIM REFERENCE MANUAL by Andy Kahn
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6 *cscope* *Cscope*
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7 This document explains how to use Vim's cscope interface.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
9 Cscope is a tool like ctags, but think of it as ctags on steroids since it
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
10 does a lot more than what ctags provides. In Vim, jumping to a result from
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
11 a cscope query is just like jumping to any tag; it is saved on the tag stack
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
12 so that with the right keyboard mappings, you can jump back and forth between
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
13 functions as you normally would with |tags|.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
14
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
15 1. Cscope introduction |cscope-intro|
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
16 2. Cscope related commands |cscope-commands|
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
17 3. Cscope options |cscope-options|
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
18 4. How to use cscope in Vim |cscope-howtouse|
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
19 5. Limitations |cscope-limitations|
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
20 6. Suggested usage |cscope-suggestions|
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
21 7. Availability & Information |cscope-info|
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
22
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
23 This is currently for Unix and Win32 only.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
24
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
25 ==============================================================================
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
26 1. Cscope introduction *cscope-intro*
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
27
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
28 The following text is taken from a version of the cscope man page:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
29
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
30 -----
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
31
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
32 Cscope is an interactive screen-oriented tool that helps you:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
33
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
34 Learn how a C program works without endless flipping through a thick
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
35 listing.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
36
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
37 Locate the section of code to change to fix a bug without having to
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
38 learn the entire program.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
39
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
40 Examine the effect of a proposed change such as adding a value to an
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
41 enum variable.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
42
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
43 Verify that a change has been made in all source files such as adding
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
44 an argument to an existing function.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
45
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
46 Rename a global variable in all source files.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
47
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
48 Change a constant to a preprocessor symbol in selected lines of files.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
49
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
50 It is designed to answer questions like:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
51 Where is this symbol used?
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
52 Where is it defined?
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
53 Where did this variable get its value?
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
54 What is this global symbol's definition?
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
55 Where is this function in the source files?
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
56 What functions call this function?
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
57 What functions are called by this function?
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
58 Where does the message "out of space" come from?
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
59 Where is this source file in the directory structure?
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
60 What files include this header file?
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
61
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
62 Cscope answers these questions from a symbol database that it builds the
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
63 first time it is used on the source files. On a subsequent call, cscope
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
64 rebuilds the database only if a source file has changed or the list of
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
65 source files is different. When the database is rebuilt the data for the
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
66 unchanged files is copied from the old database, which makes rebuilding
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
67 much faster than the initial build.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
68
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
69 -----
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
70
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
71 When cscope is normally invoked, you will get a full-screen selection
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
72 screen allowing you to make a query for one of the above questions.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
73 However, once a match is found to your query and you have entered your
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
74 text editor to edit the source file containing match, you cannot simply
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
75 jump from tag to tag as you normally would with vi's Ctrl-] or :tag
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
76 command.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
77
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
78 Vim's cscope interface is done by invoking cscope with its line-oriented
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
79 interface, and then parsing the output returned from a query. The end
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
80 result is that cscope query results become just like regular tags, so
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
81 you can jump to them just like you do with normal tags (Ctrl-] or :tag)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
82 and then go back by popping off the tagstack with Ctrl-T. (Please note
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
83 however, that you don't actually jump to a cscope tag simply by doing
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
84 Ctrl-] or :tag without remapping these commands or setting an option.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
85 See the remaining sections on how the cscope interface works and for
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
86 suggested use.)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
87
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
88
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
89 ==============================================================================
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
90 2. Cscope related commands *cscope-commands*
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
91
27036
3e661b0cf500 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 18879
diff changeset
92 *:cscope* *:cs* *:scs* *:scscope* *E259* *E262* *E560* *E561*
11659
49c12c93abf3 Updated runtime files and translations.
Christian Brabandt <cb@256bit.org>
parents: 10198
diff changeset
93 All cscope commands are accessed through suboptions to the cscope commands.
49c12c93abf3 Updated runtime files and translations.
Christian Brabandt <cb@256bit.org>
parents: 10198
diff changeset
94 `:cscope` or `:cs` is the main command
49c12c93abf3 Updated runtime files and translations.
Christian Brabandt <cb@256bit.org>
parents: 10198
diff changeset
95 `:scscope` or `:scs` does the same and splits the window
49c12c93abf3 Updated runtime files and translations.
Christian Brabandt <cb@256bit.org>
parents: 10198
diff changeset
96 `:lcscope` or `:lcs` uses the location list, see |:lcscope|
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
97
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
98 The available subcommands are:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
99
8951
0bdeaf7092bc commit https://github.com/vim/vim/commit/aa3b15dbebf333282503d6031e2f9ba6ee4398ed
Christian Brabandt <cb@256bit.org>
parents: 5294
diff changeset
100 *E563* *E564* *E566* *E568* *E622* *E623* *E625*
0bdeaf7092bc commit https://github.com/vim/vim/commit/aa3b15dbebf333282503d6031e2f9ba6ee4398ed
Christian Brabandt <cb@256bit.org>
parents: 5294
diff changeset
101 *E626* *E609*
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
102 add : Add a new cscope database/connection.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
103
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
104 USAGE :cs add {file|dir} [pre-path] [flags]
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
105
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
106 [pre-path] is the pathname used with the -P command to cscope.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
107
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
108 [flags] are any additional flags you want to pass to cscope.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
109
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
110 EXAMPLES >
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
111 :cscope add /usr/local/cdb/cscope.out
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
112 :cscope add /projects/vim/cscope.out /usr/local/vim
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
113 :cscope add cscope.out /usr/local/vim -C
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
114 <
2596
fae782ef63dd Runtime file updates.
Bram Moolenaar <bram@vim.org>
parents: 2577
diff changeset
115 *cscope-find* *cs-find* *E567*
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
116 find : Query cscope. All cscope query options are available
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
117 except option #5 ("Change this grep pattern").
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
118
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
119 USAGE :cs find {querytype} {name}
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
120
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
121 {querytype} corresponds to the actual cscope line
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
122 interface numbers as well as default nvi commands:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
123
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
124 0 or s: Find this C symbol
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
125 1 or g: Find this definition
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
126 2 or d: Find functions called by this function
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
127 3 or c: Find functions calling this function
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
128 4 or t: Find this text string
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
129 6 or e: Find this egrep pattern
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
130 7 or f: Find this file
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
131 8 or i: Find files #including this file
9344
33c1b85d408c commit https://github.com/vim/vim/commit/802a0d902fca423acb15f835d7b09183883d79a0
Christian Brabandt <cb@256bit.org>
parents: 8951
diff changeset
132 9 or a: Find places where this symbol is assigned a value
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
133
1847
44fe912b5a1b updated for version 7.2-145
vimboss
parents: 1702
diff changeset
134 For all types, except 4 and 6, leading white space for {name} is
44fe912b5a1b updated for version 7.2-145
vimboss
parents: 1702
diff changeset
135 removed. For 4 and 6 there is exactly one space between {querytype}
44fe912b5a1b updated for version 7.2-145
vimboss
parents: 1702
diff changeset
136 and {name}. Further white space is included in {name}.
44fe912b5a1b updated for version 7.2-145
vimboss
parents: 1702
diff changeset
137
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
138 EXAMPLES >
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
139 :cscope find c vim_free
1847
44fe912b5a1b updated for version 7.2-145
vimboss
parents: 1702
diff changeset
140 :cscope find 3 vim_free
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
141 <
1847
44fe912b5a1b updated for version 7.2-145
vimboss
parents: 1702
diff changeset
142 These two examples perform the same query: functions calling
44fe912b5a1b updated for version 7.2-145
vimboss
parents: 1702
diff changeset
143 "vim_free". >
44fe912b5a1b updated for version 7.2-145
vimboss
parents: 1702
diff changeset
144
44fe912b5a1b updated for version 7.2-145
vimboss
parents: 1702
diff changeset
145 :cscope find t initOnce
44fe912b5a1b updated for version 7.2-145
vimboss
parents: 1702
diff changeset
146 :cscope find t initOnce
44fe912b5a1b updated for version 7.2-145
vimboss
parents: 1702
diff changeset
147 <
44fe912b5a1b updated for version 7.2-145
vimboss
parents: 1702
diff changeset
148 The first one searches for the text "initOnce", the second one for
44fe912b5a1b updated for version 7.2-145
vimboss
parents: 1702
diff changeset
149 " initOnce". >
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
150
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
151 :cscope find 0 DEFAULT_TERM
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
152 <
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
153 Executing this example on the source code for Vim 5.1 produces the
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
154 following output:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
155
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
156 Cscope tag: DEFAULT_TERM
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
157 # line filename / context / line
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
158 1 1009 vim-5.1-gtk/src/term.c <<GLOBAL>>
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
159 #define DEFAULT_TERM (char_u *)"amiga"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
160 2 1013 vim-5.1-gtk/src/term.c <<GLOBAL>>
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
161 #define DEFAULT_TERM (char_u *)"win32"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
162 3 1017 vim-5.1-gtk/src/term.c <<GLOBAL>>
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
163 #define DEFAULT_TERM (char_u *)"pcterm"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
164 4 1021 vim-5.1-gtk/src/term.c <<GLOBAL>>
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
165 #define DEFAULT_TERM (char_u *)"ansi"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
166 5 1025 vim-5.1-gtk/src/term.c <<GLOBAL>>
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
167 #define DEFAULT_TERM (char_u *)"vt52"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
168 6 1029 vim-5.1-gtk/src/term.c <<GLOBAL>>
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
169 #define DEFAULT_TERM (char_u *)"os2ansi"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
170 7 1033 vim-5.1-gtk/src/term.c <<GLOBAL>>
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
171 #define DEFAULT_TERM (char_u *)"ansi"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
172 8 1037 vim-5.1-gtk/src/term.c <<GLOBAL>>
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
173 # undef DEFAULT_TERM
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
174 9 1038 vim-5.1-gtk/src/term.c <<GLOBAL>>
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
175 #define DEFAULT_TERM (char_u *)"beos-ansi"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
176 10 1042 vim-5.1-gtk/src/term.c <<GLOBAL>>
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
177 #define DEFAULT_TERM (char_u *)"mac-ansi"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
178 11 1335 vim-5.1-gtk/src/term.c <<set_termname>>
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
179 term = DEFAULT_TERM;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
180 12 1459 vim-5.1-gtk/src/term.c <<set_termname>>
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
181 if (STRCMP(term, DEFAULT_TERM))
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
182 13 1826 vim-5.1-gtk/src/term.c <<termcapinit>>
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
183 term = DEFAULT_TERM;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
184 14 1833 vim-5.1-gtk/src/term.c <<termcapinit>>
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
185 term = DEFAULT_TERM;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
186 15 3635 vim-5.1-gtk/src/term.c <<update_tcap>>
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
187 p = find_builtin_term(DEFAULT_TERM);
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
188 Enter nr of choice (<CR> to abort):
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
189
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
190 The output shows several pieces of information:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
191 1. The tag number (there are 15 in this example).
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
192 2. The line number where the tag occurs.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
193 3. The filename where the tag occurs.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
194 4. The context of the tag (e.g., global, or the function name).
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
195 5. The line from the file itself.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
196
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
197 help : Show a brief synopsis.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
198
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
199 USAGE :cs help
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
200
2596
fae782ef63dd Runtime file updates.
Bram Moolenaar <bram@vim.org>
parents: 2577
diff changeset
201 *E261*
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
202 kill : Kill a cscope connection (or kill all cscope connections).
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
203
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
204 USAGE :cs kill {num|partial_name}
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
205
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
206 To kill a cscope connection, the connection number or a partial
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
207 name must be specified. The partial name is simply any part of
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
208 the pathname of the cscope database. Kill a cscope connection
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
209 using the partial name with caution!
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
210
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
211 If the specified connection number is -1, then _ALL_ cscope
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
212 connections will be killed.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
213
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
214 reset : Reinit all cscope connections.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
215
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
216 USAGE :cs reset
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
217
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
218 show : Show cscope connections.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
219
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
220 USAGE :cs show
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
221
665
21ab9abf0f08 updated for version 7.0196
vimboss
parents: 236
diff changeset
222 *:lcscope* *:lcs*
21ab9abf0f08 updated for version 7.0196
vimboss
parents: 236
diff changeset
223 This command is same as the ":cscope" command, except when the
21ab9abf0f08 updated for version 7.0196
vimboss
parents: 236
diff changeset
224 'cscopequickfix' option is set, the location list for the current window is
21ab9abf0f08 updated for version 7.0196
vimboss
parents: 236
diff changeset
225 used instead of the quickfix list to show the cscope results.
21ab9abf0f08 updated for version 7.0196
vimboss
parents: 236
diff changeset
226
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
227 *:cstag* *E257* *E562*
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
228 If you use cscope as well as ctags, |:cstag| allows you to search one or
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
229 the other before making a jump. For example, you can choose to first
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
230 search your cscope database(s) for a match, and if one is not found, then
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
231 your tags file(s) will be searched. The order in which this happens
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
232 is determined by the value of |csto|. See |cscope-options| for more
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
233 details.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
234
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
235 |:cstag| performs the equivalent of ":cs find g" on the identifier when
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
236 searching through the cscope database(s).
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
237
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
238 |:cstag| performs the equivalent of |:tjump| on the identifier when searching
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
239 through your tags file(s).
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
240
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
241
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
242 ==============================================================================
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
243 3. Cscope options *cscope-options*
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
244
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
245 Use the |:set| command to set all cscope options. Ideally, you would do
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
246 this in one of your startup files (e.g., .vimrc). Some cscope related
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
247 variables are only valid within |.vimrc|. Setting them after vim has
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
248 started will have no effect!
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
249
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
250 *cscopeprg* *csprg*
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
251 'cscopeprg' specifies the command to execute cscope. The default is
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
252 "cscope". For example: >
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
253 :set csprg=/usr/local/bin/cscope
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
254 <
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
255 *cscopequickfix* *csqf* *E469*
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
256 {not available when compiled without the |+quickfix| feature}
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
257 'cscopequickfix' specifies whether to use quickfix window to show cscope
236
4707450c2b33 updated for version 7.0066
vimboss
parents: 147
diff changeset
258 results. This is a list of comma-separated values. Each item consists of
9344
33c1b85d408c commit https://github.com/vim/vim/commit/802a0d902fca423acb15f835d7b09183883d79a0
Christian Brabandt <cb@256bit.org>
parents: 8951
diff changeset
259 |cscope-find| command (s, g, d, c, t, e, f, i or a) and flag (+, - or 0).
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
260 '+' indicates that results must be appended to quickfix window,
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
261 '-' implies previous results clearance, '0' or command absence - don't use
236
4707450c2b33 updated for version 7.0066
vimboss
parents: 147
diff changeset
262 quickfix. Search is performed from start until first command occurrence.
4707450c2b33 updated for version 7.0066
vimboss
parents: 147
diff changeset
263 The default value is "" (don't use quickfix anyway). The following value
33
f6033dcbaf31 updated for version 7.0020
vimboss
parents: 20
diff changeset
264 seems to be useful: >
9344
33c1b85d408c commit https://github.com/vim/vim/commit/802a0d902fca423acb15f835d7b09183883d79a0
Christian Brabandt <cb@256bit.org>
parents: 8951
diff changeset
265 :set cscopequickfix=s-,c-,d-,i-,t-,e-,a-
33
f6033dcbaf31 updated for version 7.0020
vimboss
parents: 20
diff changeset
266 <
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
267 *cscopetag* *cst*
2908
fd09a9c8468e Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 2873
diff changeset
268 If 'cscopetag' is set, the commands ":tag" and CTRL-] as well as "vim -t"
fd09a9c8468e Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 2873
diff changeset
269 will always use |:cstag| instead of the default :tag behavior. Effectively,
fd09a9c8468e Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 2873
diff changeset
270 by setting 'cst', you will always search your cscope databases as well as
fd09a9c8468e Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 2873
diff changeset
271 your tag files. The default is off. Examples: >
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
272 :set cst
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
273 :set nocst
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
274 <
2873
eeb1ac4f66d1 updated for version 7.3.210
Bram Moolenaar <bram@vim.org>
parents: 2596
diff changeset
275 *cscoperelative* *csre*
2908
fd09a9c8468e Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 2873
diff changeset
276 If 'cscoperelative' is set, then in absence of a prefix given to cscope
fd09a9c8468e Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 2873
diff changeset
277 (prefix is the argument of -P option of cscope), basename of cscope.out
fd09a9c8468e Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 2873
diff changeset
278 location (usually the project root directory) will be used as the prefix
fd09a9c8468e Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 2873
diff changeset
279 to construct an absolute path. The default is off. Note: This option is
fd09a9c8468e Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 2873
diff changeset
280 only effective when cscope (cscopeprg) is initialized without a prefix
fd09a9c8468e Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 2873
diff changeset
281 path (-P). Examples: >
2873
eeb1ac4f66d1 updated for version 7.3.210
Bram Moolenaar <bram@vim.org>
parents: 2596
diff changeset
282 :set csre
eeb1ac4f66d1 updated for version 7.3.210
Bram Moolenaar <bram@vim.org>
parents: 2596
diff changeset
283 :set nocsre
eeb1ac4f66d1 updated for version 7.3.210
Bram Moolenaar <bram@vim.org>
parents: 2596
diff changeset
284 <
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
285 *cscopetagorder* *csto*
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
286 The value of 'csto' determines the order in which |:cstag| performs a search.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
287 If 'csto' is set to zero, cscope database(s) are searched first, followed
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
288 by tag file(s) if cscope did not return any matches. If 'csto' is set to
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
289 one, tag file(s) are searched before cscope database(s). The default is zero.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
290 Examples: >
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
291 :set csto=0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
292 :set csto=1
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
293 <
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
294 *cscopeverbose* *csverb*
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
295 If 'cscopeverbose' is not set (the default), messages will not be printed
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
296 indicating success or failure when adding a cscope database. Ideally, you
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
297 should reset this option in your |.vimrc| before adding any cscope databases,
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
298 and after adding them, set it. From then on, when you add more databases
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
299 within Vim, you will get a (hopefully) useful message should the database fail
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
300 to be added. Examples: >
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
301 :set csverb
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
302 :set nocsverb
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
303 <
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
304 *cscopepathcomp* *cspc*
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
305 The value of 'cspc' determines how many components of a file's path to
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
306 display. With the default value of zero the entire path will be displayed.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
307 The value one will display only the filename with no path. Other values
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
308 display that many components. For example: >
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
309 :set cspc=3
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
310 will display the last 3 components of the file's path, including the file
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
311 name itself.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
312
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
313 ==============================================================================
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
314 4. How to use cscope in Vim *cscope-howtouse*
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
315
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
316 The first thing you need to do is to build a cscope database for your
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
317 source files. For the most basic case, simply do "cscope -b". Please
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
318 refer to the cscope man page for more details.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
319
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
320 Assuming you have a cscope database, you need to "add" the database to Vim.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
321 This establishes a cscope "connection" and makes it available for Vim to use.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
322 You can do this in your .vimrc file, or you can do it manually after starting
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
323 vim. For example, to add the cscope database "cscope.out", you would do:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
324
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
325 :cs add cscope.out
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
326
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
327 You can double-check the result of this by executing ":cs show". This will
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
328 produce output which looks like this:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
329
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
330 # pid database name prepend path
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
331 0 28806 cscope.out <none>
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
332
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
333 Note:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
334 Because of the Microsoft RTL limitations, Win32 version shows 0 instead
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
335 of the real pid.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
336
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
337 Once a cscope connection is established, you can make queries to cscope and
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
338 the results will be printed to you. Queries are made using the command
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
339 ":cs find". For example:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
340
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
341 :cs find g ALIGN_SIZE
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
342
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
343 This can get a little cumbersome since one ends up doing a significant
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
344 amount of typing. Fortunately, there are ways around this by mapping
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
345 shortcut keys. See |cscope-suggestions| for suggested usage.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
346
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
347 If the results return only one match, you will automatically be taken to it.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
348 If there is more than one match, you will be given a selection screen to pick
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
349 the match you want to go to. After you have jumped to the new location,
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
350 simply hit Ctrl-T to get back to the previous one.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
351
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
352
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
353 ==============================================================================
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
354 5. Limitations *cscope-limitations*
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
355
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
356 Cscope support for Vim is only available on systems that support these four
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
357 system calls: fork(), pipe(), execl(), waitpid(). This means it is mostly
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
358 limited to Unix systems.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
359
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
360 Additionally Cscope support works for Win32. For more information and a
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
361 cscope version for Win32 see:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
362
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
363 http://iamphet.nm.ru/cscope/index.html
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
364
20
4ac1dce8dd5e updated for version 7.0012
vimboss
parents: 7
diff changeset
365 The DJGPP-built version from http://cscope.sourceforge.net is known to not
4ac1dce8dd5e updated for version 7.0012
vimboss
parents: 7
diff changeset
366 work with Vim.
4ac1dce8dd5e updated for version 7.0012
vimboss
parents: 7
diff changeset
367
1931
3f661e42f262 updated for version 7.2-228
vimboss
parents: 1847
diff changeset
368 Hard-coded limitation: doing a |:tjump| when |:cstag| searches the tag files
3f661e42f262 updated for version 7.2-228
vimboss
parents: 1847
diff changeset
369 is not configurable (e.g., you can't do a tselect instead).
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
370
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
371 ==============================================================================
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
372 6. Suggested usage *cscope-suggestions*
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
373
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
374 Put these entries in your .vimrc (adjust the pathname accordingly to your
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
375 setup): >
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
376
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
377 if has("cscope")
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
378 set csprg=/usr/local/bin/cscope
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
379 set csto=0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
380 set cst
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
381 set nocsverb
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
382 " add any database in current directory
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
383 if filereadable("cscope.out")
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
384 cs add cscope.out
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
385 " else add database pointed to by environment
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
386 elseif $CSCOPE_DB != ""
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
387 cs add $CSCOPE_DB
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
388 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
389 set csverb
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
390 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
391
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
392 By setting 'cscopetag', we have effectively replaced all instances of the :tag
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
393 command with :cstag. This includes :tag, Ctrl-], and "vim -t". In doing
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
394 this, the regular tag command not only searches your ctags generated tag
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
395 files, but your cscope databases as well.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
396
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
397 Some users may want to keep the regular tag behavior and have a different
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
398 shortcut to access :cstag. For example, one could map Ctrl-_ (underscore)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
399 to :cstag with the following command: >
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
400
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
401 map <C-_> :cstag <C-R>=expand("<cword>")<CR><CR>
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
402
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
403 A couple of very commonly used cscope queries (using ":cs find") is to
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
404 find all functions calling a certain function and to find all occurrences
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
405 of a particular C symbol. To do this, you can use these mappings as an
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
406 example: >
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
407
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
408 map g<C-]> :cs find 3 <C-R>=expand("<cword>")<CR><CR>
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
409 map g<C-\> :cs find 0 <C-R>=expand("<cword>")<CR><CR>
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
410
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
411 These mappings for Ctrl-] (right bracket) and Ctrl-\ (backslash) allow you to
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
412 place your cursor over the function name or C symbol and quickly query cscope
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
413 for any matches.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
414
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
415 Or you may use the following scheme, inspired by Vim/Cscope tutorial from
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
416 Cscope Home Page (http://cscope.sourceforge.net/): >
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
417
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
418 nmap <C-_>s :cs find s <C-R>=expand("<cword>")<CR><CR>
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
419 nmap <C-_>g :cs find g <C-R>=expand("<cword>")<CR><CR>
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
420 nmap <C-_>c :cs find c <C-R>=expand("<cword>")<CR><CR>
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
421 nmap <C-_>t :cs find t <C-R>=expand("<cword>")<CR><CR>
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
422 nmap <C-_>e :cs find e <C-R>=expand("<cword>")<CR><CR>
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
423 nmap <C-_>f :cs find f <C-R>=expand("<cfile>")<CR><CR>
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
424 nmap <C-_>i :cs find i ^<C-R>=expand("<cfile>")<CR>$<CR>
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
425 nmap <C-_>d :cs find d <C-R>=expand("<cword>")<CR><CR>
9344
33c1b85d408c commit https://github.com/vim/vim/commit/802a0d902fca423acb15f835d7b09183883d79a0
Christian Brabandt <cb@256bit.org>
parents: 8951
diff changeset
426 nmap <C-_>a :cs find a <C-R>=expand("<cword>")<CR><CR>
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
427
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
428 " Using 'CTRL-spacebar' then a search type makes the vim window
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
429 " split horizontally, with search result displayed in
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
430 " the new window.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
431
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
432 nmap <C-Space>s :scs find s <C-R>=expand("<cword>")<CR><CR>
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
433 nmap <C-Space>g :scs find g <C-R>=expand("<cword>")<CR><CR>
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
434 nmap <C-Space>c :scs find c <C-R>=expand("<cword>")<CR><CR>
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
435 nmap <C-Space>t :scs find t <C-R>=expand("<cword>")<CR><CR>
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
436 nmap <C-Space>e :scs find e <C-R>=expand("<cword>")<CR><CR>
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
437 nmap <C-Space>f :scs find f <C-R>=expand("<cfile>")<CR><CR>
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
438 nmap <C-Space>i :scs find i ^<C-R>=expand("<cfile>")<CR>$<CR>
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
439 nmap <C-Space>d :scs find d <C-R>=expand("<cword>")<CR><CR>
9344
33c1b85d408c commit https://github.com/vim/vim/commit/802a0d902fca423acb15f835d7b09183883d79a0
Christian Brabandt <cb@256bit.org>
parents: 8951
diff changeset
440 nmap <C-Space>a :scs find a <C-R>=expand("<cword>")<CR><CR>
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
441
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
442 " Hitting CTRL-space *twice* before the search type does a vertical
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
443 " split instead of a horizontal one
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
444
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
445 nmap <C-Space><C-Space>s
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
446 \:vert scs find s <C-R>=expand("<cword>")<CR><CR>
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
447 nmap <C-Space><C-Space>g
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
448 \:vert scs find g <C-R>=expand("<cword>")<CR><CR>
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
449 nmap <C-Space><C-Space>c
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
450 \:vert scs find c <C-R>=expand("<cword>")<CR><CR>
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
451 nmap <C-Space><C-Space>t
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
452 \:vert scs find t <C-R>=expand("<cword>")<CR><CR>
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
453 nmap <C-Space><C-Space>e
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
454 \:vert scs find e <C-R>=expand("<cword>")<CR><CR>
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
455 nmap <C-Space><C-Space>i
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
456 \:vert scs find i ^<C-R>=expand("<cfile>")<CR>$<CR>
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
457 nmap <C-Space><C-Space>d
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
458 \:vert scs find d <C-R>=expand("<cword>")<CR><CR>
9344
33c1b85d408c commit https://github.com/vim/vim/commit/802a0d902fca423acb15f835d7b09183883d79a0
Christian Brabandt <cb@256bit.org>
parents: 8951
diff changeset
459 nmap <C-Space><C-Space>a
33c1b85d408c commit https://github.com/vim/vim/commit/802a0d902fca423acb15f835d7b09183883d79a0
Christian Brabandt <cb@256bit.org>
parents: 8951
diff changeset
460 \:vert scs find a <C-R>=expand("<cword>")<CR><CR>
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
461
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
462 ==============================================================================
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
463 7. Cscope availability and information *cscope-info*
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
464
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
465 If you do not already have cscope (it did not come with your compiler
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
466 license or OS distribution), then you can download it for free from:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
467 http://cscope.sourceforge.net/
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
468 This is released by SCO under the BSD license.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
469
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
470 In Solaris 2.x, if you have the C compiler license, you will also have
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
471 cscope. Both are usually located under /opt/SUNWspro/bin
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
472
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
473 There is source to an older version of a cscope clone (called "cs") available
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
474 on the net. Due to various reasons, this is not supported with Vim.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
475
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
476 The cscope interface/support for Vim was originally written by
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
477 Andy Kahn <ackahn@netapp.com>. The original structure (as well as a tiny
12968
45987b1b77dc Update runtime files
Christian Brabandt <cb@256bit.org>
parents: 11659
diff changeset
478 bit of code) was adapted from the cscope interface in nvi.
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
479 *cscope-win32*
13125
371ceeebbdaa Update runtime files.
Christian Brabandt <cb@256bit.org>
parents: 12968
diff changeset
480 For a cscope version for Win32 see (seems abandoned):
12968
45987b1b77dc Update runtime files
Christian Brabandt <cb@256bit.org>
parents: 11659
diff changeset
481 https://code.google.com/archive/p/cscope-win32/
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
482
236
4707450c2b33 updated for version 7.0066
vimboss
parents: 147
diff changeset
483 Win32 support was added by Sergey Khorev <sergey.khorev@gmail.com>. Contact
147
2f5a3b881ada updated for version 7.0046
vimboss
parents: 33
diff changeset
484 him if you have Win32-specific issues.
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
485
14421
2f7e67dd088c Update runtime files.
Christian Brabandt <cb@256bit.org>
parents: 13963
diff changeset
486 vim:tw=78:ts=8:noet:ft=help:norl: