Vim Recall繁體中文

Use cscope to jump to a tag

:cstag

Example

Normal 0 / 2
main();
Cursor on line 1, column 1

Use cscope to jump to a tag.

Prepared cscope connection

Database
/example/cscope.out (connected)
Query g main
main.c:1: int main(void) { return 0; }
Before & after
Before
main();
Cursor on line 1, column 1

Prepared cscope connection

Database
/example/cscope.out (connected)
Query g main
main.c:1: int main(void) { return 0; }
After
int main(void) { return 0; }
Cursor on line 1, column 1

Prepared cscope connection

Database
/example/cscope.out (connected)
Query g main
main.c:1: int main(void) { return 0; }

Windows

main.c Active
int main(void) { return 0; }

Documentation-backed illustration. +cscope and +quickfix; the connected database returns exactly the displayed main definition; csto=0, cscopequickfix=g-; main.c exists. :cstag finds the single cscope definition before trying tags. Primary help: :cstag.

Details & Vim help

Use cscope to jump to a tag. This Ex reference uses the full command name; the alphabetical index omits arguments. Supply the ranges, arguments, flags and prerequisite state documented in the linked help. Press Enter to submit a complete command. The index spelling :cst[ag] puts the optional abbreviation suffix in square brackets; those brackets are not typed. Availability and exact behavior can depend on Vim build features, options, mappings and editor state; the linked help is authoritative. This command requires a Vim build with +cscope support and the corresponding runtime/library or external tool.