Vim Learning notes-ctags and TagList

Source: Internet
Author: User

These two days, vim learning has encountered bottlenecks. Vimtutor after reading, although there will be a lot of basic operations, but with the deepening of learning, more and more problems. According to Vimtutor's instructions, the next step should look at User-manual:

This concludes the Vim Tutor. It is intended to give a brief overview of the Vim editor, just enough to allow you to use the editor fairly easily.  It's far from complete as Vim have many many more commands. Read the user manual Next: ": Help User-manual".

However open user-manual on a directory list, dumbfounded. Then all kinds of online search for information, began to know with : syntax enable syntax highlighting, with Ctrl +] on the highlighted word jump around. Suddenly think of a friend in front of me to show off his vim, in the code to jump to jump to the screen, then feel good, and nothing else to understand.

It is a mysterious and powerful tags file that brings me problems.

At first, the answer to the online search data is: Install Ctags, use the ctags command to generate tags files. I am very puzzled, I did not pretend ctags why can jump in the user-manual? And many of the articles have ctags called Vim plug-ins, then the new question: where is the location of the vim plugin? What plugins do you have with the default ? Exuberant ctags the same as ctags? Ctags is born so early, and programming languages abound, does he need to configure the grammar rules for the corresponding language? ctags is used to generate code for C/s + + tags or all languages can be, there is no jtags such things (now seems a bit ridiculous)? even if I have solved the previous problem generated a tags file, how to use this file? With so many questions, and no mind to slowly read the thick user-manual. I was even a little desperate, thinking that I could not be a mysterious vimer.

After a few days of painful struggle, keep looking for information, constantly testing, with the accumulation of the knowledge of vim sporadic, today suddenly enlightened, good happy.

My understanding is that ctags is a tool used to generate tags files , not a vim plugin.

Ctags generates an index (or tag), file of language objects found in source files, allows these items to be quickly and Easily located by a text editor or other utility. A tag signifies a language object for which an index entry be available (or, alternatively, the index entry created for th At object). "1"

Some articles say that he is a vim plug-in, some articles in the ctags copied to the Vim folder, I formed a certain degree of misleading. and many of the articles written by Daniel are based on Linux, not with make is apt-get, so this part of the knowledge in the Windows platform is missing. No way, to bite the bullet into Linux, according to the " transform vim into a powerful IDE" "2" in the introduction of Linux learning Vim, install Ctags and found that the name of the software is called exuberant Ctags, Then you see the Ctags shortcut key that the author has configured:

Map <F5>:!ctags-r--c++-kinds=+p--fields=+ias--extra=+q .<cr><cr>:tlistupdate<cr>

! Shell command, suddenly dawned. In retrospect, other people copied to the vim file are the Ctags.exe,vim installation path and are set to the path in the installation. So, back to Windows, on exuberant Ctags official website "1" Download for Windows Zip package, unzip, configure environment variables, open the Command Window CD to a Java project directory, execute ctags-r. command, the directory has a more tags file, with vim to open a copy of the source code for testing, jump success . Again to Vim Doc next check, sure enough to bring tags files. Ctags around the question of the vanished, no wonder I did not install ctags can also be used everywhere to jump, tags file is vim really need. The usefulness of the tags file also leads to a solution: It is an index file. TagList is a plugin that uses tags files to display tags in vim.

Resources:

"1" exuberant Ctags official website http://ctags.sourceforge.net/

"2" transform vim into a powerful IDE http://www.cnblogs.com/zhangsf/archive/2013/06/13/3134409.html


Vim Learning notes-ctags and TagList

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.