ctags的简单用法
ctags的安装:注意ctags有两个,一种是Emacs版本的,另一种是vim版本的。我们通常网上看到的资料是针对vim版本的,结合vim一起使用的。 $sudo apt-get install exuberant-ctags 在vim编辑器内(命令模式下),ctags的几个简单操作符如下::ta xxx 在工程中查找 xxx 字符 Ctrl + ] Ctrl + T Ctrl + O [I [{ ]} 在括号内移动,“[(” 和 “])” 命令”[}” 和 “]}” 类似,只不过它们适用于 () 对而不是 {} 对。 { } gd gD * # [/ ]/
:ptag write_char Vim 会打开一个窗口,跳转到 “write_char” 标签。然后它会回到原来的位置。 使用 CTRL-W 命令可以在两个窗口之间来回切换。 用下面的命令关闭预览窗口: :pclose Note:[http://blog.csdn.net/garfieldswimming/article/details/8727481] 出错了,类似这个问题可能你运行的ctags 不是 Exuberant Ctags,而是 GNU Emacs etags, 可以输入下列命令: $ctags --version ctags (GNU Emacs 23.1) Copyright (C) 2009 Free Software Foundation,Inc. This program is distributed under the terms in ETAGS.README 看到上面ctags (GNU Emacs 23.1),说明当前不是 Exuberant Ctags。 此时,执行man ctags可以看到: -R,--no-regex Don't do any more regexp matching on the following files. May be freely intermixed with filenames and the --regex option. You could probably generate the tags recursively using shell magic,but you may run into problems down the road if you’re expecting Exuberant Ctags. So the best solution is probably to install the ctags you want instead: 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/] (编辑:李大同) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |