ctags最基本用法

ctags最基本最基本的用法。

1. 建立索引,

ctags –R 待建索引的文件夹名

例如:

ctags –r testdb

2. 代码阅读

a) 打开文件,vim,与普通vim命令无异,注意执行vim命令需要与tags在同一个目录下。

在tags文件所在目录下,执行

vim testdb/test.cpp

b) Ctrl+],进入某个函数,变量的定义。

例如,当前光标位于test函数处,按ctrl+],则进入test函数的定义

c) Ctrl+o,跳出

按ctrl+o,则跳出test函数定义,回到原来位置

原文地址:https://www.cnblogs.com/glorey/p/1855430.html