installation, use and management of commonly used vim plugins

Source: Internet
Author: User
Tags function definition

1.Ctags

Ctags tool is used to traverse the source code files generated tags files, these tags files can be used by the editor or other tools to quickly find the location of the source code symbols, into the variable name, function name and so on. For example, tags files are the basis for taglist and omnicppcomplete work.

Installation process:

(1) Open the link: www.vim.org/scripts/script.php?script_id=610, after the download is complete, go to the download folder.

(2) Under the download folder, unzip the downloaded Stags compressed file by command Unzip Ctags.vim command, then install the Ctags plugin via the command sudo apt install exuberant-ctags command.

Use procedure:

(1) to their own source directory, if your source code is a multi-level directory, go to the top-level directory, run the command in this directory: Ctags–r, will produce a name tags file, the file is copied to the $home/.vim/tags directory. You can then use the command $vim ~/.vim/tags to see the contents of the generated tags file.

(2) Run command in Vim ": Set Tags=home/.vim/tags/tags, you can also put this command in the HOME/.VIMRC file. When you want to query the definition of a function, place the cursor over the function, press the <Ctrl+]> key, jump to the definition of the function, and press the <Ctrl+t> key to return. (Note: The home here refers to the storage. Vim path is the path of your user name, not just the path of home, generally to increase your user name, similar to home/yang/)

This can also occur when using the problem, when you modify the program, if you add a function definition, or delete the variable definition, tags file can not be automatically rebuild, you must manually run the command: Ctags–r.

2.Taglist

List the current file of all macros, global variables, function names, etc., can efficiently browse the source code, functions like VC workspace.

Installation process:

(1) Download TagList compressed package from URL http://www.vim.org/scripts/script.php?script_id=273.

(2) Put the extracted two files Taglist.vim and taglist.txt respectively into the Home/.vim/plugin and Home/.vim/doc directories.

(3) by order $vim ~/.VIMRC Add the following two words to the. vimrc file:

Let tlist_show_one_file=1

Let Tlist_exit_onlywindow=1

Using the plugin taglist:

After entering vim, you can open the TagList window by entering the tlist command in vim command mode.

We can switch focus between taglist window and edit area by ctrl-w shortcut or mouse click, select a symbol with the mouse or keyboard in the TagList window, then click or enter, you can jump to the position defined by the symbol.

More features are available by running the Help Taglist.txt query under the VIM command line.

The management of plug-ins, mainly through the. vimrc file to manage the Vim plugin. It is inconvenient to use the plugin via the command line, and it is convenient to use the. vimrc file for automated or semi-automatic plugins.

Below is my VIMRC file, because now for the type of plug-in, the specific function is not very familiar with, and write too little code, also do not know what is very useful plug-ins, so need to manage the plug-ins and use to a small number of functions. In the future learning process should also pay attention to the use of tools, more skilled use of tools is one of the ways to improve efficiency.

installation, use and management of commonly used vim plugins

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.