Authoring GTK Source-level vim Help document tags

Source: Internet
Author: User
Tags gtk



Authoring GTK Source-level vim Help document tags


Reason

That only see the source code. On the Linux source has a website http://lxr.linux.no/+trees, can be very aspects to find out the corresponding version of the code implementation, GTK did not. Then do it yourself.

I have been using VIM, I think of Ctags + vim + gtk3 corresponding source package to create a source-level help document.

SOURCE Package Preparation


Working directory:/ROOT/GTK/SRC
Select the download link on the official download page (http://www.gtk.org/download/index.php) to save the document Packages.url



#cat packages.url#------------http://ftp.gnome.org/pub/gnome/sources/gtk+/3.6/gtk+-3.6.4.tar.xzhttp://ftp.gnome.org/pub/gnome/sources/glib/2.34/glib-2.34.3.tar.xzhttp://ftp.gnome.org/pub/gnome/sources/pango/1.32/pango-1.32.6.tar.xzhttp://ftp.gnome.org/pub/gnome/sources/gdk-pixbuf/2.26/gdk-pixbuf-2.26.5.tar.xzhttp://ftp.gnome.org/pub/gnome/sources/atk/2.6/atk-2.6.0.tar.xz#------------




Make tags Script


After the script mkhelp.sh executes, the tags file is generated in the current directory



#cat mkhelp.sh#----------------------------------#!/bin/bash# by haijie# modified NO. : 001wget -i packages.urlcf=tag.files> $cfforfin$(<packages.url) ;=""do=""tf="${f##*/}"tar=""xjvf=""$tf=""p="${tf%%.tar*}/`echo"${tf%-*}|=""tr=""-d="""+"`=""[="""$p"=""]=""&&=""find=""$pwd=""$p=""-name="""*.[ch]"="">> $cfdonectags -L $cf#------------------------------------------</packages.url)>




Integration into VIM

Writing directly to ~/.VIMRC is silly, because every time I do it, I'm going to write a function that calls are only introduced. The code in ~/.VIMRC is as follows

“--------------------------function!  Set_work_tag()    settags+=/root/gtk/src/tagsendfunctionnmap <silent> <c-j>w : call Set_work_tag()<cr>”--------------------------</cr></c-j></silent>


Use

When viewing files about GTK, the shortcut keys for introducing tags are: Ctrl + J W;
The functions, macros, and data types of GTK that you want to view use Vim's commands and their shortcut keys,
I love to use

  • Ctrl + W]
  • : Stslect


Superfluous words

This is just a ctags, and adding cscope in mkhelp.sh can make better code hints using the Tag.files file list.


Authoring GTK Source-level vim Help document tags


Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.