Vim-gvim environment setup

Source: Internet
Author: User

1. Install gvim
Gvim72.exe address: ftp://ftp.vim.org/pub/vim/pc/gvim72.exe.

2. Install gvim Chinese help document
Vimcdoc-1.7.0-setup.exe address http://prdownloads.sourceforge.net/vimcdoc/vimcdoc-1.7.0-setup.exe? Download

3. Garbled text on the menu bar after installing the Chinese help document
Edit the _ vimrc file under the gvim installation directory to add
Set ENC = UTF-8
Set fileencodings = ucs-bom, UTF-8, Chinese
Set langmenu = zh_CN.UTF-8
Language message zh_CN.UTF-8
Source $ vimruntime/delmenu. Vim
Source $ vimruntime/menu. Vim

4. syntax highlighting and function highlighting
First, add the following content to the edit _ vimrc file:
Set Nu!
Colorscheme desert
Syntax enable
Syntax on
These settings enable gvim to display the row number, use the desert color scheme, and enable the syntax highlighting function (display comments, keywords, words with different colors)

String ).
We can also highlight the function name, find C. vim and CPP. Vim in c: \ Program Files \ Vim \ vim72 \ syntax, and add the following content respectively:
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

5. install and configure ctags
Ec57w32.zip http://prdownloads.sourceforge.net/ctags/ec57w32.zip
Decompress ec57w32.zip, find ctags.exe in the folder after decompression, copy it to c: \ ProgramFiles \ Vim \ vim72, edit the _ vimrc file, and add

Add the following content: (The ctags file is automatically retrieved from the lower-level directory)
Set tags = tags;
Set autochdir

6. Window Management.
Taglist_45.zip address http://www.vim.org/scripts/download_script.php? Src_id = 1, 7701
Winmanager.zip address http://www.vim.org/scripts/download_script.php? Src_id = 1, 754

Decompress the taglist_45.zip file, decompress it, and include a doc folder and a plugin folder. Copy the content to c: \ Program respectively.

Files \ Vim \ vim72 In the doc and plugin.
Add the following content to the _ vimrc file:
Let tlist_show_one_file = 1
Let tlist_exit_onlywindow = 1
Use gvim to open the code file (the tags file has been generated). The: tlist and taglist windows appear on the left.
Decompress and copy winmanager.zip in the same region, and add the following content to the _ vimrc file:
Let G: winmanagerwindowlayout = 'fileexplorer | taglist'
Nmap wm: wmtoggle <CR>
Use gvim to open the code file. In normal state, enter the command "Wm ",

6. edit multiple files.
Minibufexpl. Vim address http://www.vim.org/scripts/download_script.php? Src_id = 1, 3640

Copy minibufexpl. Vim to c: \ Program Files \ Vim \ vim72 \ plugin and add:
Let G: minibufexplmapctabswitchbufs = 1
Let G: minibufexplmapwindownavvim = 1
Let G: minibufexplmapwindownavarrows = 1
When you use gvim to open two or more files, the minibufexplorer window is automatically displayed, as shown in figure
 
CTRL + TAB, switch to the previous buffer, and open the file in the current window;
CTRL + Shift + TAB, switch to the next buffer, and open the file in the current window;
CTRL + Arrow, you can switch to the upper, lower, and left windows;
CTRL + H, J, K, L, switch to the upper and lower left windows.

7. Quick search in the project.
Grep. Vim address http://www.vim.org/scripts/download_script.php? Src_id = 1, 7645

Copy grep. Vim to c: \ Program Files \ Vim \ vim72 \ plugin and add:
Nnoremap <silent> <F3>: grep <CR>
Open the source code file with gvim, move the cursor to the content to be searched, and press F3 to determine the content to be searched and the search range. gvim will pop up the quickfix

List all matching search results in the window

8. fast switch between header files and source files
A. Vim address http://www.vim.org/scripts/download_script.php? Src_id = 1, 7218

Copy A. Vim to c: \ Program Files \ Vim \ vim72 \ plugin and add:
Nnoremap <silent> <F12>: A <CR>
After opening the source code file with gvim, press F12 to switch between C and H files, or input a to implement

9. Highlighted bookmarks.
Visualmark. Vim address http://www.vim.org/scripts/download_script.php? Src_id = 1, 4700

Copy visualmark. Vim to c: \ Program Files \ Vim \ vim72 \ plugin.
Open the source code file with gvim, move the cursor to the place where you want to add bookmarks, and press Ctrl + F2 to add bookmarks.

Use F2 for forward switching between bookmarks, Shift + F2 for reverse switching.

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.