Gvim text Editor configuration and related plugin installation graphic tutorial

Source: Internet
Author: User
Tags manual zip

Vim is a text editor developed from VI. Code completion, compilation and error jump and other convenient programming features are particularly rich in the programmer is widely used.

  1. Install gvim7.2.

Run Gvim72.exe, select Full, and my installation directory is the default C:Program Filesvim.

After the installation is complete, the folder Vim72 and folder Vimfiles are included, as well as the script _VIMRC.

  2. Install the Chinese Help manual.

Run Vimcdoc-1.7.0-setup.exe, it will automatically find the Gvim installation location.

The Help manual is already in Chinese when you reopen the gvim,:help after installation.

In this step, my gvim menu at the Chinese appeared garbled.

Find solutions on the Internet, delete the C:Program FilesVimvim72 folder named Lang, and make the menu language into English.

  3. Syntax highlighting.
First, edit the _VIMRC file to add the following:

Set nu!
ColorScheme Desert
Syntax enable
Syntax on
These settings allow Gvim to display line numbers, use the desert color scheme, and turn on syntax highlighting, which displays annotations, keywords, strings, and so on in different colors.
We can also highlight the function name, find C.vim and Cpp.vim under C:Program filesvimvim72syntax, and add the following separately:
Syn Match cfunction "<[a-za-z_][a-za-z_0-9]*>[^ ()]*) (" Me=e-2
Syn Match cfunction "<[a-za-z_][a-za-z_0-9]*>s* (" me=e-1
Hi cfunction gui=none guifg= #B5A1FF
Reopen the Gvim, and the effect is as follows:

4. Jump in the program.
Unzip the Ec57w32.zip, locate the Ctags.exe in the Unpacked folder, copy it to C:programfilesvimvim72, and edit the _VIMRC file to add the following:
Set tags=tags;
Set Autochdir
Open the cmd command line, switch to the root of the source code you want to view, run
Ctags-r
A tags file will be generated at this directory.
Open a code file with Gvim, place the cursor over a function name, Updateviewbyposno () of the following figure, press "CTRL +]", and the cursor will automatically jump to the definition.

Press "Ctrl+t" to jump back to its original position.
variables, structs, macros, and so on, can all be done.
When your source files are updated, you can only rerun the ctags-r command to update the tags file.

5. Window management.
Unzip the Taglist_45.zip, unpack and include a doc folder and a plugin folder, and copy the contents to the doc and plugin under C:Program FilesVimvim72 respectively.
Add the following in the _VIMRC file:
Let tlist_show_one_file=1
Let Tlist_exit_onlywindow=1
Open the code file with Gvim (the tags file has been generated): The Tlist,taglist window appears on the left.
To extract and copy the Winmanager.zip in the same way, add the following in the _VIMRC file:
Let g:winmanagerwindowlayout= ' fileexplorer| TagList '
Nmap Wm:wmtoggle
Open the code file with Gvim, enter the command "WM" in normal state, and the window below

On the left is the NETRW window (browse the file), the bottom left is the TagList window, again enter the "WM" when these two windows will be closed.

6. Multi-file editing.
Copy Minibufexpl.vim to C:Program Filesvimvim72plugin and add in _VIMRC:
Let G:minibufexplmapctabswitchbufs=1
Let G:minibufexplmapwindowsnavvim=1
Let G:minibufexplmapwindownavarrows=1
When you open two or more files with Gvim, the Minibufexplorer window pops up automatically, as shown below

Ctrl+tab, switch to the previous buffer and open the file in the current window;
Ctrl+shift+tab, switch to the rear buffer, and open the file in the current window;
CTRL + ARROW keys, you can switch to the top and bottom of the window;
ctrl+h,j,k,l, switch to the top and bottom of the window.

7. Fast switch header file/source file.
Copy A.vim to C:Program Filesvimvim72plugin and add in _VIMRC:
Nnoremap:a
After opening the source file with Gvim, press F12 to switch between the c/h file, or through input: A to achieve.

8. Find quickly in engineering.
Copy Grep.vim to C:Program Filesvimvim72plugin and add in _VIMRC:
Nnoremap:grep
Open the source file with Gvim and position the cursor over the content you want to find, press F3 to determine what you want to find and search for, Gvim will list all eligible search results in the pop-up quickfix window. The following figure

Supports regular expressions when determining what to find.

9. Highlight the bookmark.
Copy the Visualmark.vim to the C:Program filesvimvim72plugin.
Open the source file with Gvim, position the cursor where you want to add a bookmark, press CTRL+F2, or add a bookmark.

Use F2 to toggle between bookmarks, shift+f2 in reverse.

Note : More wonderful tutorials Please pay attention to the triple computer Tutorials Section

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.