VIM + taglist + ctags (read source code ).

Source: Internet
Author: User

Finally, the configuration was not successful for the past two days.

Software required:

Ctags

Taglist

1, ctags.

1) Description:

I will not demonstrate this. My redhat5.5 itself has ctags.

2) Verify that ctags has been installed:

    Input on the terminal

ctags --version

The following message is displayed, indicating that the image has been installed ):

Exuberant Ctags 5.6, Copyright (C) 1996-2004 Darren Hiebert
  Compiled: Jul 17 2006, 11:39:49
  Addresses: <dhiebert@users.sourceforge.net>, http://ctags.sourceforge.net
  Optional compiled features: +wildcards, +regex

2, taglist

  1) download:

Search on the http://sourceforge.net/projects/vim-taglist/files/, my file name isTaglist_46.zip.

  2) create a directory and store the taglist:

    Run the following command in the personal root directory ($ home:

mkdir ~/.vim

2) decompress the downloaded Taglist_46.zipFile(Assuming that the file is still in the personal root directory ):  

unzip taglist_46.zip

At this point, there are two directories "Doc" and "plugin" in the directory, move the two directories ~ /. Vim directory:

mv doc/ plugin/ .vim/

3) install taglist:

Enter VI (m) on the terminal to open vim, and enter in command mode:

helptags ~/.vim/doc

  4) Associate ctags and taglist:

   First, check the installation directory of ctags:

which ctags

Will display:/Usr/bin/ctags

    After you know the installation directory of ctags, enter:

vim .vim/plugin/taglist.vim

Find if! Exists ('loaded _ taglist') This line (actually in if! The exists ('s: cpo_save ') Row can also be above. This is the first time I did this. I can guess why I got it wrong ), enter let tlist_ctags_cmd = "/usr/bin/ctags"


 let Tlist_Ctags_Cmd="/usr/bin/ctags" 69 if !exists(‘loaded_taglist‘) 70  " First time loading the taglist plugin
  71     "
  72     " To speed up the loading of Vim, the taglist plugin uses autoload
  73     " mechanism to load the taglist functions.
  74     " Only define the configuration variables, user commands and some

The installation has been completed.

3. Use

  Go to the directory for source code analysis and run:

ctags -R

The directory contains one more tags file.

Open the file to be analyzed (such as VI inout. c) switch to VIM. In command mode, use the tlisttoggle command to control the function list. press ctrl and press W twice to switch between the normal editing area and the tags area. In the tags area, move the cursor to the variable and function name, and press enter to automatically locate the specified content in the normal editing area.

The function list area displays only the functions in inout. C. The function definitions used in this file in other code files are not displayed. You can move the cursor over the function to be viewed and press Ctrl +] to view the definition of the function. After viewing the definition of the function, press Ctrl + O to jump back to the original file.

Search for specific commands on the Internet, and there is no need to list them one by one here.

Ref:

1, http://www.cnblogs.com/shenlian/archive/2011/06/14/2080655.html

2. <Linux Programming Technology (du Hua)>

VIM + taglist + ctags (read source code ).

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.