Use gvim to establish an IDE programming environment (Windows)

Source: Internet
Author: User
Use gvim to establish an IDE programming environment (Windows)

Reposted from: leemoncc


Note: This article is based entirely on the famous "hands-on instructions for converting Vim into an IDE programming environment" I.
In Windows XP.

Original: http://blog.csdn.net/wooin/archive/2007/10/31/1858917.aspx
.


0. Prepare software and plug-ins.


(Aw.gvim72.exe
Address ftp://ftp.vim.org/pub/vim/pc/gvim72.exe
.

(Bw.vimcdoc-1.7.0-setup.exe
Location
Address http://prdownloads.sourceforge.net/vimcdoc/vimcdoc-1.7.0-setup.exe? Download


(C)ec57w32.zip
Location
Address http://prdownloads.sourceforge.net/ctags/ec57w32.zip


(D1_taglist_45.zip
Location
Address http://www.vim.org/scripts/download_script.php? Src_id = 1, 7701


(E)winmanager.zip
Location
Address http://www.vim.org/scripts/download_script.php? Src_id = 1, 754


(F) minibufexpl. Vim
Location
Address http://www.vim.org/scripts/download_script.php? Src_id = 1, 3640


(G) A. Vim
Address http://www.vim.org/scripts/download_script.php? Src_id = 1, 7218


(H) grep. Vim
Location
Address http://www.vim.org/scripts/download_script.php? Src_id = 1, 7645


(I) visualmark. Vim
Location
Address http://www.vim.org/scripts/download_script.php? Src_id = 1, 4700

1. Security
Install gvim7.2.



Run gvim72.exe
Select full. The default installation directory is C:/program files/vim.
.

After the installation is complete, the vim72 folder, vimfiles folder, and script _ vimrc are included.

2. Security
Install the Chinese help manual.



Run vimcdoc-1.7.0-setup.exe
It will automatically find the installation location of gvim.

After the installation is complete, re-open gvim,: Help
The help manual is already in Chinese.

At this step, garbled Chinese characters appear in the gvim menu.

Search online
Find a solution and set C:/Program
Files/Vim/vim72
The name is Lang.
Of
Delete folder to make the menu language English.

3. Language
Highlight.

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 line number and desert color scheme are used, and the syntax highlighting function is enabled (annotations, keywords, strings, etc. are displayed in different colors ).

We can also highlight the function name in C:/program files/Vim/vim72/syntax.
Find C. Vim
And CPP. Vim
, Respectively Add the following content:
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

Open gvim again. The effect is as follows:

 

4. Cheng
Jump in sequence.

Run ec57w32.zip
Decompress, find ctags.exe in the folder After decompressing
, Copy it to C:/ProgramFiles/Vim/vim72
,
Edit the _ vimrc file and add the following content:
Set tags = tags;

Set autochdir

Open the CMD command line, switch to the root directory of the source code you want to view, and run
Ctags-R


A tags file is generated in this directory.

Open a code file with gvim, place the cursor on a function name, such as updateviewbyposno (), and press "Ctrl + ]".
Will automatically jump to the definition.

 

 

Press Ctrl + T to jump back to the original position.

Variables, struct, macros, and so on.

When your source file is updated, you can only re-run ctags.
-R
Command to update the tags file.

5. Window
Port Management.



Set taglist_45.zip
Solution
Decompress and decompress the package. The package contains a doc folder and a plugin folder. Copy the content to C:/program files/Vim/vim72
.

Add the following content to the _ vimrc file:
Let
Tlist_show_one_file = 1

Let
Tlist_exit_onlywindow = 1


Open code with gvim
File (generated tags file),: tlist
, Taglist
The window appears on the left.

Use the same token to use winmanager.zip
Decompress and copy the file, and add the following content to the _ vimrc file:
Let G: winmanagerwindowlayout = 'fileexplorer | taglist'

Nmap wm: wmtoggle <CR>


Open the code file with gvim, and enter the command "Wm" IN NORMAL STATE
", The window is as follows:



 
The top left is the netrw window.
In the left lower part is the taglist window. Enter "Wm" again.
"
The two windows are closed.

6. Multiple
File editing.



Set minibufexpl. Vim
Copy to C:/program files/Vim/vim72/plugin
, Add in _ vimrc
Add:
Let G: minibufexplmapctabswitchbufs = 1

Let G: minibufexplmapwindowsnavvim = 1

Let G: minibufexplmapwindownavarrows = 1


When you use gvim to open two or more files, the minibufexplorer window is automatically displayed,
For example



 

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. quickly switch the header file/source file.


Set a. Vim
Copy to C:/program files/Vim/vim72/plugin
,
Add the following in _ vimrc:
Nnoremap <silent> <F12>: A <CR>


After opening the source code file with gvim, press F12 to switch between C and H files, or input.

8. In
Quick search in the project.



Set grep. Vim
Copy to C:/program files/Vim/vim72/plugin
,
Add the following in _ vimrc:
Nnoremap <silent> <F3>: grep <CR>

Open the source code file with gvim, position the cursor to the content to be searched, and press F3 to confirm
Gvim lists all matching search results in the pop-up quickfix window. For example



 

Regular Expressions are supported when determining the content to be searched.

9. High
Bright bookmarks.



Set visualmark. Vim
Copy 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 a book.
.



 

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.