Taught you how to put Vim into an IDE programming environment converted 1

2010-10-01  来源:本站原创  分类:Java  人气:279 

Taught you how to put Vim into an IDE programming environment modification (Photo)

By: Wu Yin
Date: 2007-09-07
Version: 0.5
Email: lazy.fox.wu # gmail.com
Homepage: http://blog.csdn.net/wooin
Copyright: Copyright of the article by Wu Yin and his lovely wife all the little buns. Under non-commercial purposes can be arbitrary in the dissemination and replication. For commercial purposes, any act under the subject of this article of the agreement.
Contact: lazy.fox.wu # gmail.com
1 EDITORIAL
Under the program has been criticized for Linux is this: no one easy to use IDE, but I heard Linux cattle, hackers and the like are also not IDE. But I'll wait for the transfer from the Windows platform over the Coder is a useful The IDE is how important it ah, it is estimated that many people are stuck in this threshold, and "we must first of its profits," Well, I think if there is a good use of the IDE, Linux beef those people will be welcome. These are the good wishes nothing more working people, today I will teach you to gvim converted into a simple IDE, it was "easy" is the interface looks "simple", but definitely better than a good IDE function is poor, Some features that are, should not have functions there, smiling at the news you have to do it all right, here I began to introduce today's work.

This article will teach you:
1. Chinese to help the installation manual
2. Vim program frequently used commands
3. syntax highlighting
4. in the program jumping: Ctags use
5. teach you to efficiently browse source - plug-in: TagList
6. file browser and window manager - plug-in: WinManager
7. Cscope use
8. QuickFix window
9. fast browsing and operating Buffer - Plug: MiniBufExplorer
10. c / H files with each other to switch - plug-in: A
11. in the project to find - plug-in: Grep
12. Highlight the bookmark - plug-in: VisualMark
13. autocompletion
14. accelerate your completion - plug-in: SuperTab

This article will not teach you:
1. How to use vim. This will not teach you from scratch how to use vim, if you are new to vim,
Suggest you look at other entry tutorial vim, or shell, enter the command: vimtutor,
This is a simple introductory tutorial.
2. Programming skills.
3. Vim script writing.

My work environment is: Fedora Core 5
gvim is to compile the 7.0, if you have not installed gvim, see my article <in Redhat Linux 9 to compile and configure gvim 7.0>
Since I have been working in C language, so the following examples are demonstrated in the C programming language, other languages have not tried, if you have friends in other languages, under the problem, you can discuss with me, I will try to help you.

In this paper, the model source code is vim7.1 the source, you can download www.vim.org Source Package: vim-7.1.tar.bz2, you can not download to your own program source code, has little to . I extract source code under my home directory: ~ / vim71

The following text some of the names on the definition of it:
1. Some of the text used with <> symbols enclosed example, and the like, you can use the following command to see explanation:

: Help keycodes

2. The paper said that some of the paths, such as:
~ / .vim / Plugin
~ / .vim / Doc
~ / .vim / Syntax
If you do not have to create your own.
3. The paper said the. Vimrc file is that ~ /. Vimrc

Give everyone to see pictures, I was vim interface, greedy self first ^ _ ^

Taught you how to put Vim into an IDE programming environment converted 1

(--- Figure 1 ---)
Control icon on the map, I will teach you in this article following features:

1 Buffer concise navigation and operation
2 File Browser
3 tag browser
4 Highlight a bookmark
5 Richer syntax highlighting
6 Member variable of the drop-down, auto-completion

2 Chinese Help Manual Installation
vim comes with the help of manual is in English, on the people who usually have little programming reading difficulties, not to mention there are "star Translation King" as it could be gang happens to have translated into Chinese, but why I can block tempted to install it, alas ....... and lost a good opportunity to learn English, just this once.
Look at my Chinese help screen it:

Taught you how to put Vim into an IDE programming environment converted 1

(--- Figure 2 ---)
Installation:
In the following website to help Chinese language package:
http://vimcdoc.sf.net (English)
http://vcd.gro.clinux.org (Chinese)

Download the file package should look like this: vimcdoc-1.5.0.tar.gz
After decompression of which have a doc folder, copy all the contents of which to ~ / .vim / doc, or vim installation directory under the doc directory, then vim help message is already in the Chinese language.
Note:
a. If you can not display Chinese in the ~ /. vimrc try to add the following sentence:
set helplang = cn
b. Help file is utf-8 text encoding, if you want to use vim direct view, need to ~ /. vimrc set:
set encoding = utf-8

3 vim programming frequently used commands
Look at the manual recommends the following help sections, of which some of the relevant tags files you can skip the first, in the later chapters will be referred to the time you come back and found it very simple:
: Help usr_29
: Help usr_30

Here are some of the commands I used, go here for my notes:

% Jump to matching parenthesis to
[[ Jump to the beginning of the block to (but requires a separate block of code must be accounted for in the''''''''''''''''{'''''''''''''''' line)
gD Jump to a local variable at
'''''''''''''''''''''''''''''''' Jump to the last stop where the cursor is not a two'''''''''''''''', "
mx Bookmark, x can only be 26 letters az
`X Jump to bookmark Department ("` "is the one on the left button)
> Increase Indent, "x>" said to add the following line indent x
< Decrease Indent, "x <" mean a reduction in the following x-line indent

4 Syntax highlighting
No written procedures would be a syntax highlighting how painful ah, thanks to the author of vim is a programmer (if not, That big NB), providing syntax highlighting, in the above picture you can see to those comments, keywords, strings, etc, are displayed in different colors, and to do so, first in your ~ /. vimrc file add the following words:
syntax enable
syntax on

Restart vim, and open a c program file, is not that colorful up front suddenly ...
If you do not like the color scheme you can "Edit -> Color Scheme" (gvim), select a color scheme you are satisfied, then in ~ /. Vimrc file add the following sentence:

colorscheme desert

desert is my favorite color scheme, you can change you. If the menu you are not satisfied with the color scheme (you took it too), it does not matter, in the vim.org on a lot of people just like you, they do a variety of color themes, you can download one by one test, you can see more blurred. If so you are not satisfied (you really XXXX), it does not matter, vim's author will have you thought of this earlier kinds of people, you can create your own color theme, the following number of this document learn about it:

: Help syntax.txt

Even more dazzling syntax highlighting:
You may find a lot of things together is not highlighted, such as operation symbols, various brackets, function names, defined types, etc., but look at the picture above, my operator symbols and function names have highlighted the ^ _ ^, want to know why? wow ha ha ha ha .... I'll teach you ...

The main idea is to create a new grammar file, as defined in the file you want to highlight the East, would like to highlight what is to highlight what is so confident with vim. The so-called vim syntax file is used to highlight a variety of source files a script, vim by a description of the script to make the file a different color different texts, such as the C language syntax file in a path similar to this:
/ Usr/share/vim/vim64/syntax/c.vim
Syntax files for other languages can also be found in this path, you may not in this path, whether it, in your own HOME under a new grammar file, create a new empty file:
~ / .vim / Syntax / c.vim
In which the added

"================================================= =======
"Highlight All Function
"================================================= =======
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

"================================================= =======
"Highlight All Math Operator
"================================================= =======
"C math operators
syn match cMathOperator display "[- + \ */%=]"
"C pointer operators
syn match cPointerOperator display "-> \ | \."
"C logical operators - boolean results
syn match cLogicalOperator display "[!<>] = \ ="
syn match cLogicalOperator display "=="
"C bit operators
syn match cBinaryOperator display "\ (& \ | | \ | \ ^ \ | <<\ |>> \) = \ ="
syn match cBinaryOperator display "\ ~"
syn match cBinaryOperatorError display "\ ~ ="
"More C logical operators - highlight in preference to binary
syn match cLogicalOperator display "& & \ | | |"
syn match cLogicalOperatorError display "\ (& & \ | | | \) ="

"Math Operator
hi cMathOperator guifg = # 3EFFE2
hi cPointerOperator guifg = # 3EFFE2
hi cLogicalOperator guifg = # 3EFFE2
hi cBinaryOperator guifg = # 3EFFE2
hi cBinaryOperatorError guifg = # 3EFFE2
hi cLogicalOperator guifg = # 3EFFE2
hi cLogicalOperatorError guifg = # 3EFFE2

Then open your C file and see, is not and bright a lot. There is also a pressing bottom of to tell you, if you added a type or class structure, how it, as in "int", "void "This will highlight up? again in the above file ~ / .vim / syntax / c.vim add the following stuff:

"================================================= =======
"My Own DataType
"================================================= =======
syn keyword cType My_Type_1 My_Type_2 My_Type_3

This type of your own My_Type_1, My_Type_2, My_Type_3 also get to the "int" as highlighting it, and this drawback is a type for each additional, we must manually add here that, if someone knows an easier way, please be sure to tell me, use the following address:

Email : Lazy.fox.wu # gmail.com
Homepage : Http://blog.csdn.net/wooin

5 Jumping in the program: Ctags use
Wow, instrument allows fiercely, Tag file (tab file), but the programmer's magic Yeah, you can do it, but you can not know it, because the Linux kernel source code is provided "make tags" this option. Now we to introduce the Tag file.

tags file generated by the ctags program an index file, ctags program is called its "Exuberant Ctags", is the Unix ctags program alternatives above, and powerful than it is by default on most Linux distributions the ctags program. So tags file is used to do? If you are reading program read a function call, or a variable, or a macro, etc., you want to know where they are defined, how do? with grep? that would be found many irrelevant places. now popular use is, who with who know, sir, when the cursor in a function or variable, press "Ctrl +]", the cursor will automatically jump to the definition of place, it powerful enough, You do not have to envy Visual Studio programmers, and began to envy me ~ _ ~.

You do not rush to press for now, you press useless, you do not I do it, you have to do now is to check your computer have ctags this procedure, if so, what version, if it is Ctags 5.5 .4, like me, you better go to install a Ctags 5.6, the auto-completion in the following sections will be used. In this site: http://ctags.sourceforge.net, download a similar ctags-5.6 . tar.gz file down (it seems that version 5.7 came out, but I have not used):

Installation with the following command to extract:

$ Tar-xzvf ctags-5.6.tar.gz
$ Cd ctags-5.6
$ Make
# Make install. / Configure & & make & & make install / / require root privileges

Then go to your source directory, if your source is a multi-directory, and went to top-level directory, run the command in the directory: ctags-R
I now make presentations vim71 the source directory

$ Cd / home/wooin/vim71
$ Ctags-R

At this point in the / home/wooin/vim71 directory will generate a tags file, now use vim to open / home/wooin/vim71/src/main.c

$ Vim / home/wooin/vim71/src/main.c

Then run the command in vim:

: Set tags = / home/wooin/vim71/tags

This command tags the file to vim in the past, you can also put this sentence ~ /. Vimrc to go, if you often programmed in the words of this project.
The following real gun to start the opening knife really did, as shown, place the cursor setmouse () function on

Taught you how to put Vim into an IDE programming environment converted 1

(--- Figure 3 ---)

At this point press, the cursor will automatically jump to setmouse () function at the definition, see below:

Taught you how to put Vim into an IDE programming environment converted 1

(--- Figure 4 ---)

If you still want to jump back just at this time the location, you can, so they jump back setmouse () function is called the place, variables, structures, macros, etc., can, quickly try it .....

At this point in the back section 3 to learn about the vim manual says it

: Help usr_29

But there is a small flaw, you modify the program, such as increasing the function definition, delete the variable definition, tags file can not automatically rebuild, you must manually re-run the following command:

$ Ctags-R

The tags file updates, but did feel pleased that the vim not restart procedures are not written out, we can immediately and correctly use and the. If anyone knows an easier way, please be sure to tell me, and with the following address:

Email : Lazy.fox.wu # gmail.com
Homepage : Http://blog.csdn.net/woo
6. Teach you to efficiently browse source - plug-in: TagList
Download http://www.vim.org/scripts/script.php?script_id=273
Version 4.4
Installation In ~ /. Vim directory decompression taglist_xx.zip
Manual : Help taglist.txt

Used in the Windows platform, Source Insight program of the men will look very familiar to the code window on the left of the Symbol window, and that the file which lists all the current macros, global variables, function names, etc., in the view code overall situation with the window , the location very convenient to switch today to tell you a vim plugin: Taglist, you can also achieve this function.

Have told you the previous section the use of the ctags, ctags program is the basic principle of the program some of the keywords (eg: function name, variable name, etc.) the name, location and other information through a window to tell you, if you have installed Good taglist, you can use the following command to see taglist help file that comes with:

: Help taglist.txt

Here is my translation of one of the first paragraph of the "Overview", for we now find out taglist, the translation is not good, please advise:
"Tab List" is used to browse the source code of a Vim plugin, this plugin allows you to efficiently browse a variety of different languages source code, "Tag List" has the following features:
* In Vim, a vertical or horizontal split window to display a file defined in the tags (functions, classes, structures,
Variables, etc.)
* In GUI Vim, you can choose to tags displayed in the drop-down menus and pop-up menu
* When you are in multiple source files / buffers when switching between, taglist window will be updated accordingly.
When you open a new file, the new tags defined in the file will be added to the list of files that already exist,
And all files defined in the file name tags will be grouped
* Taglist window when you select a tag name, source file, the cursor will automatically jump to the definition of the tag at the
* Automatically highlight the current tag name
* Grouped by type, the tag, and each group will be displayed in a collapsible tree structure
* Can display the tag type and scope of the original
* Tag in the taglist window, choose to display the original type replacement tag name
* Tag list can follow the tag name, or time to sort
* The source file supports the following languages: Assembly, ASP, Awk, Beta, C,
C + +, C #, Cobol, Eiffel, Erlang, Fortran, HTML, Java, Javascript, Lisp,
Lua, Make, Pascal, Perl, PHP, Python, Rexx, Ruby, Scheme, Shell, Slang,
SML, Sql, TCL, Verilog, Vim and Yacc.
* Can easily expand to support the new language. To modify the new language support is also very simple.
* Provides a number of functions that can be used in the Vim status bar or in the window's title bar shows the current tag name
* Taglist in the list of files and tags can be saved and loaded between sessions in vim
* Provides some used to get tag name and the original type of command
* In the console and GUI vim vim can be used in
* Plug-ins can be used in conjunction with winmanager. Winmanager plugin allows you to simultaneously use the file browser,
Taglist buffer browsers and plug-ins, like a different IDE.
* In the Unix and MS-Windows system using

First please your ~ /. Vimrc file add the following two sentences:

let Tlist_Show_One_File = 1
let Tlist_Exit_OnlyWindow = 1

At this point with vim try to open a source file c:

$ Vim ~ / vim / src / main.c

After entering vim taglist with the following command to open the window, as shown in Figure 5:

: Tlist

Taught you how to put Vim into an IDE programming environment converted 1

(--- Figure 5 ---)
The left front of the window is described TagList window, which lists the main.c file in the tag, and in accordance with the "typedef", "variable", "function" and so are classified. To move the cursor VimMain on, as shown in the left of the red box, press Enter, the source will automatically jump to the definition of VimMain Department, shown in the red box on the right. This is the most basic and most commonly used TagList operation. and then teach you a common operation, you browse TagList window, if the source does not want to jump, but would like to see the complete tag in the source expression, you can move the cursor to the tag you want to see on the yellow box shown in the above , then press the space bar, command bar in the following figure below the yellow box, it displays the tag in the source code is written in full, and not jump to the source place.

TagList plug-in I will introduce here, in fact, it also has many uses and settings, I can not teach you one by one, the good news TagList have a detailed help manual, with the following command to open the manual, learn about it:

: Help taglist.txt

7. File browser and window manager - plug-in: WinManager
Download http://www.vim.org/scripts/script.php?script_id=95
Version 2.x
Installation In ~ /. Vim directory decompression winmanager.zip
Manual : Help winmanager

In Figure 1 we can see where the icon is a 2 identifies the file browser, which lists the files in the current directory, you can browse through the browser works in the source file is not more like common the IDE, and when the cursor is in a file or folder, hit Enter, you can open the file or folder.
This stuff is how to adjust out? In fact, this is achieved by the plug, this plug-in is netrw.vim, but you do not have to download and install, this plugin is the standard vim plugin has been installed along with the vim into your system, and now to briefly show you how to enter "~ / vim71" folder to run vim, vim and then run the command:

: E ~ / vim71

Vim you will see the interface as shown below:

Taught you how to put Vim into an IDE programming environment converted 1

(--- Figure 6 ---)
In this interface you can use the following commands for commonly used directories and files:

Display help
If the cursor is a directory, enter the directory; if the file under the cursor, then open the file
- Back to parent directory
c Vim switch the current working directory is a directory browsing
d Create a directory
D Delete the directory or file
i Switch display
R Rename the file or directory
s Select Sort
x Custom navigation, using a program you open the file

I'm not here to teach you how to use netrw.vim plug-in, but to teach you to be TagList by WinManager plug-in window and integrate netrw window, just like the icon shown in Figure 1 consisting of 2 and 3 that the effect is now in your ~ / . vimrc add the following two

let g: winManagerWindowLayout ='''''''''''''''' FileExplorer | TagList''''''''''''''''
nmap wm: WMToggle

Then restart vim, open ~ / vim71/src/main.c, in the normal state, the input "wm", you will see looks like Figure 7:

Taught you how to put Vim into an IDE programming environment converted 1

(Figure 7 --- ---)
The left top is the netrw window, left window below is TagList, when re-enter "wm" command, two windows were closed.

WinManager main function is to me about these, but it also has other advanced features, you can also support several other plug-in, if you think enough I introduced you, I suggest you put it with the help of a good study guide, with The following command brings up the manual page:

: Help winmanager

8. Use of Cscope
This time even more powerful, with Cscope own words - "You can think of it as more than the frequency of the ctags", its features and powerful it is evident, on the presentation I will not detail it said, if you installed the introduced earlier to help the Chinese manual describes the following command to see it:
: Help if_cscop.txt

I excerpt here a little simple for friends to see still hesitant:
Cscope is an interactive screen to use the tool to help you:
* Not in the thick of the program list can be flipped downwards know a C program works.
* Not familiar with the whole program to program bug can know clearly the position you want to modify the code.
* Check the proposed changes (such as adding an enum value) may produce results.
* Verify that all source documents have been made necessary modifications; for example, an existing function to a add a parameter.
* In all source files renamed to a global variable.
* The location of all a constant to a preprocessor symbol.

It is designed to answer the following questions:
* Where to use this symbol?
* This is where the definition?
* Where this variable is assigned?
* The definition of a global symbol, where?
* This function of where the source file?
* What functions call this function?
* What functions call this function?
* Information "out of space" come from?
* This source file in the directory structure in what position?
* Which file contains the header files?

Installation Cscope:
If your system has cscope command, you can skip this bit, if not, to be followed to install a bar with me.
In Cscope Home: http://cscope.sourceforge.net download a source package, compile and install after decompression:

#. / Configure
# Make
# Make install / / require root privileges

First in ~ / vimrc add one:

: Set cscopequickfix = s-, c-, d-, i-, t-, e-

This is to set whether to use quickfix window to show the cscope results, usage will be said later.

As with the Ctags to use its features to your code must first generate a cscope database in the project root directory run the following command:

$ Cd / home/wooin/vim71 /
$ Cscope-Rbq
# After that will generate three files
$ Ll cscope .*
-Rw-rw-r - 1 wooin wooin 1.1M 2007-09-30 10:56 cscope.in.out
-Rw-rw-r - 1 wooin wooin 6.7M 2007-09-30 10:56 cscope.out
-Rw-rw-r - 1 wooin wooin 5.1M 2007-09-30 10:56 cscope.po.out
# Open the file, starting Coding
$ Cd src
$ Vi main.c

Vim entered the first thing is to just cscope generated files into the vim in the past, with the following command:

: Cs add / home/wooin/vim71/cscope.out / home/wooin/vim71

This command is very important to the above, you must write the whole, not just write the first phrase:
: Cs add / home/wooin/vim71/cscope.out
Because the source is a multi-level directory, and if so to write, cscope is a subdirectory of the source can not work, of course, if you are on the same level source directory and do not care. If you often use cscope, you can add the phrase above ~ /. vimrc to go.

Let's drill bit, find the function vim_strsave () of the definition, use the command:

: Cs find g vim_strsave

Below:

Taught you how to put Vim into an IDE programming environment converted 1

(Figure 8 --- ---)
After pressing Enter will automatically jump to the vim_strsave () of the definition of place. At this point you would certainly say Ctags can do this Yeah, it says the following can not do this Ctags, and I want to find vim_strsave () in the end in the been called in those places, and with the command:

: Cs find c vim_strsave

After pressing the Enter vim will automatically jump to meet the requirements of a place, and in the command bar on the number of results to meet the requirements, as shown:

Taught you how to put Vim into an IDE programming environment converted 1

(Figure 9 --- ---)
If you are not satisfied with the location of auto-jump, want to see the results of the other, you can use the following command to open the QuickFix window:

: Cw

Figure:

Taught you how to put Vim into an IDE programming environment converted 1

(Figure 10 --- ---)
Then you can slowly pick out ^ _ ^

cscope main function is through the same sub-command "find" to achieve
"Cscope find" usage:
cs find c | d | e | f | g | i | s | t name

0 or s Find this C symbol (you can skip the comments)
1 or g Find the definition of
2 or d Find a function of the function call
3 or c Find functions calling this function
4 or t Find the string
6 or e Find this egrep pattern
7 or f Find this document
8 or i Find the file that contains the

If you have time to find a long list of commands, then the input is a really annoying thing, Cscope help manual recommends the use of a number of shortcut keys, here is one of the group, which I use, will add the following to the ~ /. vimrc in and restart vim:

nmap s: cs find s = expand ("")
nmap g: cs find g = expand ("")
nmap c: cs find c = expand ("")
nmap t: cs find t = expand ("")
nmap e: cs find e = expand ("")
nmap f: cs find f = expand ("")
nmap i: cs find i ^ = expand ("")$
nmap d: cs find d = expand ("")

When the cursor is a word you're looking for on, press g, is to find the definition of the object, the other the same way.
Press this key combination a little bit tricky, according to the press of a button immediately after, or the screen flashed back to nomal state of the
g, according to law is press "Ctrl + Shift + -", then quickly press the "g"

Very strange, in which the sentence:
nmap i: cs find i ^ = expand ("")$
Vim can not in my work, but I changed to:
nmap i: cs find i = expand ("")
Can work, and do not know why? Have friends who know please tell me.

cscope other functions you can help guide their own learning slowly

reset: re-initialize all connections.
Usage: cs reset

9. QuickFix window
In the previous section we can see in Figure 10 has a display in the window below the query results window, this window lists the results of the query command, the user can select from this window to view each result, the window called "QuickFix" window, used to be a vim plug-come, but now has become the standard plug-in vim, do not you go to install, QuickFix window above the main role is to see that the function: output some alternative result, many commands can be invoked, a more detailed description and use please use the following command to open the manual to learn it QuickFix:
: Help quickfix

Here I am again a common example to introduce a QuickFix window is used. This example is usually to imitate our programming, when the compilation error, QuickFix error messages will be listed for us to view and modify an article. First of all, or with vim open ~ / vim71/src/main.c, best to pre-compiled vim71, or compile time while a bit slow, or you can write a small program to follow the wrong I did the following steps, see below:

Taught you how to put Vim into an IDE programming environment converted 1

(Figure 11 --- ---)
We changed a bit main.c, artificially causing several errors in the first line adds a baobao_wu 1019 with no strings of any definition, delete the first line of the last 1020 of a bracket ")", and then compiled with the following command :

: Make

Obviously a lot of compiler errors will be reported when compiling the end and exit to the source interface, just the compiler errors have been reported not see, but we can use QuickFix window error message and then find out, use the following command to bring up the QuickFix window :

: Cw

At this point you can see the QuickFix window as shown below: the

Taught you how to put Vim into an IDE programming environment converted 1

(Figure 12 --- ---)
QuickFix window in the following we can find a compilation of each error, as you can right click on each record, the code will automatically jump to the wrong place at once, you can also use the following command to Jump:

: Cn / / switch to the next result
: Cp / / Switch to the previous results

If you frequently use these two commands, you can also set shortcut keys for them, as in ~ /. Vimrc add:

nmap: cn
nmap: cp

The other command / plug-in also uses the QuickFix window, but are basically similar usage, will be used later in this article QuickFix window, then read on.

10. Fast browsing and operating Buffer - Plug: MiniBufExplorer
Download http://www.vim.org/scripts/script.php?script_id=159
Version 6.3.2
Installation Files will be downloaded minibufexpl.vim throw ~ / .vim / plugin folder, you can
Manual The head of the minibufexpl.vim file

When in the programming can not always just edit a file, you will certainly open a lot of the source file for editing, if each file to open a vim for editing, then it will operate much trouble ah, so there is vim buffer (buffer) The concept, you can see vim's help:
: Help buffer
vim buffer management tool that comes with just: ls,: bnext,: bdelete such order, neither useful nor intuitive. now recommend to you a grand vim plugin (plugin): MiniBufExplorer

Usage:
Restart vim, when you edit a buffer only when the MiniBufExplorer useless when you open the buffer a second time, MiniBufExplorer window to automatically pop up here, see below:

Taught you how to put Vim into an IDE programming environment converted 1

(Figure 13 --- ---)
That narrow the window above is MiniBufExplorer window, which lists all currently have open buffer, when you put the cursor at the window, there are several shortcut keys can be used:

Cycle forward to each name on the buffer
Cycle back to each name on the buffer
Buffer in the open cursor
d Remove the buffer cursor

The following two functions need to ~ /. Vimrc add:

let g: miniBufExplMapCTabSwitchBufs = 1

Cycle forward on to each buffer, but before the window opens in
Cycle back to each buffer on and on, but before the window opens

If the ~ /. Vimrc set in the following sentence:

let g: miniBufExplMapWindowNavVim = 1

You can use to switch to the window to go up and down, like:
Cw, hjkl to the "left, down, right" switch window.
In ~ /. Vimrc set:

let g: miniBufExplMapWindowNavArrows = 1

Is about to switch to the window to go up and down

11. c / h files with each other to switch - plug-in: A
Download http://www.vim.org/scripts/script.php?script_id=31
Version
Installation Will a.vim into ~ / .vim / plugin folder
Manual No

Here it is used:
As a C programmer, when the daily Coding and header files in the source file to switch between a very ordinary things, the direct use vim to open its source / header file in fact is not a hassle, but with only one button to switch over , and this is how close the function ah ....
A.vim installed after following a few commands can be used:

: A Buffer in the new switch to c \ h file
: AS Horizontal split window and open the c \ h file
: AV Vertical split window and open the c \ h file
: AT Create a new tab and open the c \ h file

There are several more commands, you can see in its pages, I have not used, in fact, are very much the same, find their most comfortable on the line.

I am in ~ /. Vimrc add the sentence:

nnoremap: A

Press F12 when the meaning of a new buffer in the open c \ h file, so when you can write programs without hesitation in the c / h switch between files, reducing the number of keys, thinking it is even more fluent, Amitabha ....

I will show you the next chapter. . .

相关文章
  • Taught you how to put Vim into an IDE programming environment converted 1 2010-10-01

    Taught you how to put Vim into an IDE programming environment modification (Photo) By: Wu Yin Date: 2007-09-07 Version: 0.5 Email: lazy.fox.wu # gmail.com Homepage: http://blog.csdn.net/wooin Copyright: Copyright of the article by Wu Yin and his love

  • Taught you how to put Vim into an IDE programming environment modification (Photo) 2 2010-10-01

    12. Find in the project - plug-in: Grep Download http://www.vim.org/scripts/script.php?script_id=311 Version 1.8 Installation Throw the grep.vim file ~ / .vim / plugin folder just fine Manual Head in the grep.vim file Here it is used: vim has its own

  • Configuration of the Python programming environment based on VIM 2010-03-17

    1, configuration files in the directory / etc / or / etc / vim / Here, there is a document called the vimrc, which is the system common vim configuration files are valid for all users. In each user's home directory, can build their own private config

  • 谁说Vim不是IDE?--VIM的基础概念和配置 2014-10-13

    话说操作系统.编程语言和编辑器似乎是程序员永恒的吐槽话题,技术发展了几十年,大家讨论起这几个"之争"还是充满愤怒.津津乐道.有人描述过Emacs和VI程序员,大家沿着不同的道路和目标前进,但总是会在某个点交叉相遇,互相扔石头,砸到对方鼻青脸肿,然后收拾心情又继续前行. 前一阵子我在微博上写了一条微博回复,是关于Vim和IDE讨论的:Vim和那些IDE的应用场景还是有区别的,在我看来Vim也是IDE,是程序员的必备技能之一.这基本表达了我的观点. 原微博是@玉伯也叫射雕发布的,这条微博转

  • 笨笨的我---终于完成了vim下php IDE的配置 2012-02-15

    笨笨的我---终于完成了vim下php IDE的配置,下面是我的截图,太兴奋了,呵呵

  • Vim as Python IDE on windows 2013-01-02

    下载安装Python. 从Vim的网站下载vim,建议下Self-installing executable的版本. 编辑vim的配置文件_vimrc 拷贝vimrc_example里面的东东到_vimrc 去掉_vimrc里面的source $VIMRUNTIME/vimrc_example.vim 设置中文支持 " 设置编码自动识别, 中文引号显示 " set fileencodings=utf-8,cp936,big5,euc-jp,euc-kr,latin1,ucs-bom s

  • vim的python IDE开发环境 2015-02-25

    vim是一个强大的编辑器,它使得我们全键盘操作成为可能,但是它是否是一个好的编程工具,它是否可以跟visual studio相 提并论呢,也许这是vim的短板,但是通过一些实用的插件,可以让vim成为一个IDE,这实在太棒了. vim的高效一直都让人崇拜,先让它成为python的开发环境,随后再在实践中进一步学习和总结. 环境CentOS 安装vim-enhanced [[email protected] ~]# vi ~/.bashrc 1 # .bashrc 2 3 # User specific al

  • ZT --- VIM as Python IDE 2010-03-26

    Original Article please Go to http://blog.dispatched.ch/2009/05/24/vim-as-python-ide/ Finding the perfect IDE for Python isn't an easy feat. There are a great many to chose from, but even though some of them offer really nifty features, I can't help

  • vim plugin conqueterm: build REPL Environment 2010-10-03

    REPL , the read-eval-print loop, first appeared in the Lisp, Emacs's Slime mode is very easy to write lisp. In the Slime in the process is this: Write small pieces of code <Cc> <Cc> Run a small code See the results and continue to write small

  • vim --- create a rails development environment 2011-05-13

    First, the introduction of these two plug-ins rails.vim and nerdtree.vim. rails.vim provides commonly used commands, you can help develop, for example: Rgenerate, Rake, Rfind, RTview etc., very convenient and very practical. nerdtree the tree menu pr

  • 谁说Vim不是IDE?--Vim常用插件 2015-01-13

    常用插件 之所以说Vim形成了自己的生态环境,就是因为Vim具备开放的插件体系,开发者为了提升开发效率,为Vim编写了数以万计的插件,我们可以根据需要任意选择,也可以基于Vimscript语言开发自己的专属插件. 每个插件都是以Vim为后缀的脚本文件,编写插件的语言一般采用Vimscript.Vimscript是Vim自己的编程语言,我们在后续会介绍到它.尽管Vimscript几乎为可以Vim做任何事,但还是会存在一些场景,用其他语言更好更快.考虑到这一点,Vim的开发者为其他脚本语言设计了接口

  • [转] 把vim打造成IDE 2012-08-08

    http://blog.csdn.net/fbfsber008/article/details/7055842

  • Two very cattle vim tips (Reprinted) 2010-10-20

    Two very cattle vim tips (1) Please note before reading this article: 1. This paper aims to provide skills in the use of vim, vim use of these techniques can improve operational efficiency. Some skills can also be used in vi, but now basically use th

  • vi / vim to use summary 2010-11-05

    vim using the notes V1. Default character encoding is utf8, open the file using the gb2312 encoding, the Chinese are all garbled, how to restore the normal display? Enter the edit + + enc = cp936 V2. How to execute a command in vim system? Enter! Cmd

  • A suitable vim settings. 2011-01-06

    After 3 days of suffering, finally broke a variety of information to find the basic configurations conform to the vim. After this article will be updated from time to time. Use of plug-ins: a.vim // Header files and programming files to switch betwee

  • Two very cattle vim tips (reproduced) 2010-10-20

    Two very cattle vim tips (1) Before reading this note: 1 This article aims to provide some of the tips of vim, vim use of these techniques can improve operational efficiency. Some skills can also be used in vi, but now basically a with vim. 2 This ar

  • Vim use of experience 2011-04-04

    This period has been dealing with Linux, just by the way also learned about the use of Vi, this ready to go on long-term use. Purpose is simply to be more proficient in using Linux and preparation. Vi and the other under Windows text editor different

  • (R) is cattle vim tips 2011-09-08

    Before reading this note: 1 This article aims to provide some of the tips of vim, vim use of these techniques can improve operational efficiency. Some skills can also be used in vi, but now basically a with vim. 2 This article is collated and summari

  • Vim实战手册(8)Vimide--打造你自己的IDE(A) 2012-03-20

    转载请注明来自"柳大的CSDN博客":http://blog.csdn.net/poechant 就让我姑且称它为VIM-IDE吧,这样听起来好像和Eclipse.Visual Studio.Xcode之流的IDE有一拼,更好玩一点,你可以叫它Vimide,是不是更像:) 言归正传,把你的Vim打造成IDE,首先要熟悉一些基本的Vim使用. 1.ctags的安装 首先下载ctags插件,地址为[参考1](目前最新版本为5.8) 然后使用如下命令安装: tar zxvf ctags-5.

  • VIM as a PHP IDE 2012-05-08

    UPDATE: I'm using Emacs since some months and consider it superior to VIM for most use cases after using VIM for 4 years. (And I also came to hate PHP by the way.) Today I read an article from Matthew Weier O'Phinney on Planet-PHP about Programming P