Using ctags to find functions
来源:互联网 发布:苹果系统修改软件 编辑:程序博客网 时间:2024/05/17 22:40
http://www.x.org/wiki/Development/Documentation/UsingCtags/
Finding functions in X is hard. One way to search for the actual definition of a data type is to grep the source directory and then open the file. This can take forever, especially when you don't quite know where to look for.
However, vim's support for ctags makes it easier. It is possible to create a tags file for the whole system and then just use it from within vim. That way, in vim you only have to go to the occurence of the data type, press CTRL+] and it will open the matching definition. With CTRL+T you jump back to the original file.
I created my tags file somewhere in my .vim directory.
$> mkdir .vim/tags/$> cd .vim/tags/$> ctags -R /usr/include/* /path/to/X/source/code
ctags will create a file "tags" in the current directory ($HOME/.vim/tags in this case). This way I got pretty much all defintions I need at the moment.
Now you need to tell vim to include this file. Add the following line to your $HOME/.vimrc.
set tags=./tags,tags,/home/username/.vim/tags/tags
On your next startup of vim, everything will be available with CTRL+]. If you use tags heavily, you will find CTRL+G helpful. It shows the name of the file in the current buffer.
A recommendation is to write a little script to update your ctags and run it as a cron job every night. Your computer will not be very responsive while recursively searching for ctags in a multi-GB directory.
Warning
This can be a hazardous setup as the ctags are absolute. If you are working on two different source trees (i.e. two releases of the same software), using CTRL+ ] will jump to the functions as defined in ctags. So you might be editing the wrong source tree.
- Using ctags to find functions
- Using ctags to find functions
- Find sequence gaps using Oracle's analytic functions
- How to automate Excel using MFC and worksheet functions
- How to Call Java functions from C Using JNI
- How to Call Java Functions from C Using JNI
- erwin unable to find all oracle library functions 问题解决
- Using Valgrind to Find Memory Leaks
- how to find deadlock scenario using gdb
- using bgp data to find spammers
- Oracle 10g Enhancements to Analytical Functions -- Using Partitioned Outer Joins To "Densify" Data
- Using Java SecurityManager to grant/deny access to system functions NOVEMBER 16, 2009
- How to solve the linking errors when using the ATOMIC functions
- Using Functions SYSFUNC and IFC to Conditionally Execute Statements in Open Code
- Using FizzBuzz to Find Developers who Grok Coding
- Using v$session_longops to find long running SQL statements
- How to Find a Blank Cell in Excel Using Vba
- How to find out suitable parameters using cross validation
- C/C++中头文件格式
- TestNG 教程1 – 基本使用方法
- 北漂是为了什么
- CodeForces 21D - Traveling Graph 欧拉回路的性质+状态压缩DP
- AceyOffice教程--如何判断单元格的内容
- Using ctags to find functions
- UVA 537 (13.08.01)
- iOS: NSDictionary的方法objectEnumerator
- UIKit类结构图
- 纯手工打造漂亮的垂直时间轴,使用最简单的HTML+CSS+JQUERY完成100个版本更新记录的华丽转身!
- poj3348
- iOS: NSDictionary的方法objectForKey:
- ArcGIS 10.2抢先下载地址
- iOS: NSDictionary的方法objectForKeyedSubscript: