Ctags为GTK库生成tags

GTK程序ctags配置
本文介绍了一种为GTK程序生成适合vim插件使用的ctags文件的方法。通过特定的ctags命令参数设置,可以生成包含函数原型及签名的tags文件,从而实现函数原型的自动补全功能。
最近写gtk程序时常常需要参考函数的原型声明,网上google了一下为GTK生成正确tags文件的命令,发现都是说到安装目录下执行ctags -R,但是这样生成的tags文件却并不能很好的配合echofunc/code_compelete等常用的vim插件,读了ctags的手册又仔细对比了一下以前下载的libc等等的tags文件,发现是由于生成的tags文件中缺少函数原型以及函数的signature造成的,故使用命令
sudo ctags --c-kinds=+p --fields=+S -R -f tags include/
即可生成正确的ctags文件。
此时配合code_compelete插件时可自动补全函数原型,效果如下:
[img]http://dl.iteye.com/upload/attachment/356947/35186a64-40ab-3cfa-a8fd-fd1e55ceb314.png[/img]
linux@ubuntu:~/sdk/source/bootloader/u-boot-2020.01$ make help Cleaning targets: clean - Remove most generated files but keep the config mrproper - Remove all generated files + config + various backup files distclean - mrproper + remove editor backup and patch files Configuration targets: config - Update current config utilising a line-oriented program nconfig - Update current config utilising a ncurses menu based program menuconfig - Update current config utilising a menu based program xconfig - Update current config utilising a Qt based front-end gconfig - Update current config utilising a GTK+ based front-end oldconfig - Update current config utilising a provided .config as base localmodconfig - Update current config disabling modules not loaded localyesconfig - Update current config converting local mods to core defconfig - New config with default from ARCH supplied defconfig savedefconfig - Save current config as ./defconfig (minimal config) allnoconfig - New config where all options are answered with no allyesconfig - New config where all options are accepted with yes allmodconfig - New config selecting modules when possible alldefconfig - New config with all symbols set to default randconfig - New config with random answer to all options listnewconfig - List new options olddefconfig - Same as oldconfig but sets new symbols to their default value without prompting Test targets: check - Run all automated tests that use sandbox qcheck - Run quick automated tests that use sandbox Other generic targets: all - Build all necessary images depending on configuration tests - Build U-Boot for sandbox and run tests * u-boot - Build the bare u-boot dir/ - Build all files in dir and below dir/file.[oisS] - Build specified target only dir/file.lst - Build specified mixed source/assembly target only (requires a recent binutils and recent build (System.map)) tags/ctags - Generate ctags file for editors etags - Generate etags file for editors cscope - Generate cscope index ubootrelease - Output the release version string (use with make -s) ubootversion - Output the version stored in Makefile (use with make -s) cfg - Don't build, just create the .cfg files envtools - Build only the target-side environment tools Static analysers checkstack - Generate a list of stack hogs coccicheck - Execute static code analysis with Coccinelle Documentation targets: Linux kernel internal documentation in different formats from ReST: htmldocs - HTML latexdocs - LaTeX pdfdocs - PDF epubdocs - EPUB xmldocs - XML linkcheckdocs - check for broken external links (will connect to external hosts) refcheckdocs - check for references to non-existing files under Documentation cleandocs - clean all generated files make SPHINXDIRS="s1 s2" [target] Generate only docs of folder s1, s2 valid values for SPHINXDIRS are: make SPHINX_CONF={conf-file} [target] use *additional* sphinx-build configuration. This is e.g. useful to build with nit-picking config. Default location for the generated documents is doc/output make V=0|1 [targets] 0 => quiet build (default), 1 => verbose build make V=2 [targets] 2 => give reason for rebuild of target make O=dir [targets] Locate all output files in "dir", including .config make C=1 [targets] Check all c source with $CHECK (sparse by default) make C=2 [targets] Force check of all c source with $CHECK make RECORDMCOUNT_WARN=1 [targets] Warn about ignored mcount sections make W=n [targets] Enable extra gcc checks, n=1,2,3 where 1: warnings which may be relevant and do not occur too often 2: warnings which occur quite often but may still be relevant 3: more obscure warnings, can most likely be ignored Multiple levels can be combined with W=12 or W=123 Execute "make" or "make all" to build all targets marked with [*] For further info see the ./README file #### make "help" completed successfully! #### linux@ubuntu:~/sdk/source/bootloader/u-boot-2020.01$
最新发布
07-09
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值