VIM中ctags的简单使用教程
关于ctags的安装及配置等,请参考 Vim:打造Linux程序员的编辑利器(ctags+cscope+taglist+code_complete)。 注意: 若在其他目录时打开vim使用ctags,需要在vim中设置tags变量,变量值为tags文件路径。例如: :set tags=....../tags_glibc 打开进入vim后,在vim编辑器内,在命令模式下输入 :ta pattern 就可以 找到符合pattern的字符位置。(相当于search功能)
在括号内移动,“[(” 和 “])” 命令”[}” 和 “]}” 类似,只不过它们适用于 () 对而不是 {} 对。
打开一个预览窗口,来显示函数 “write_char” 的页面内容,使用ptag命令: :ptag write_char Vim 会打开一个窗口,跳转到 “write_char” 标签,然后它会回到原来的位置。
:pclose Note:http://blog.csdn.net/garfieldswimming/article/details/8727481 在一个源码根目录下,运行如下命令建立索引时 出错了: $ ctags -R . ctags: skipping ***: it is not a regular file. 碰到类似这个问题的,其原因可能是因为你运行的ctags 不是 Exuberant Ctags,而是 GNU Emacsetags, 可通过如下命令查看: $ctags --version ctags (GNU Emacs 23.1) Copyright (C) 2009 Free Software Foundation,Inc. This program is distributed under the terms in ETAGS.README 当你运行man ctags命令时,可以看到-R选项的描述为: -R,--no-regex Don't do any more regexp matching on the following files. May be freely intermixed with filenames and the --regex option.
所以,可以通过如下命令安装ctags: $ sudo apt-get install exuberant-ctags 另一种可能是 It occurs if you have elvis-tools installed . Remove them with something like $ sudo apt-get remove elvis-tools and then install exuberant-ctags by $ sudo apt-get install exuberant-ctags Reference:http://fancyxinyu.blog.163.com/blog/static/1823213662012101694049404/ (编辑:李大同) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |