Vim creates its own Vim interface!

Source: Internet
Author: User
Tags autoload blank page

1 Zen Coding

More about the function! See:

Download zencoding first!

Http://code.google.com/p/zen-coding/

Put zecoding. Vim in the Vim \ vimfiles \ plugin folder.

Place zencoding.txt in the Vim \ vimfiles \ doc folder.

Copy the files in the autoload folder to the corresponding directory. (This operation was missing at the beginning, causing installation failure)

2 nerdtree

Download the nerdtree and decompress it to the vim \ vimfiles \ plugin directory. The configuration is as follows:

"Nerdtree execute quick key setupmap <F4>: nerdtree <CR>" place nerdtree on the right of the editing area "Let nerdtreewinpos = 1" to set the width of nerdtree, the default value is 30let nerdtreewinsize = 25 "Let nerdtreeminimalui = 1" show bookmarks let users = 0 "Show Hidden Files" Let nerdtreeshowhidden = 1 Let nerdtreestatusline = 0let nerdchristmastree = 1

 

3 javacomplete

Many people may want to use code prompts. After all, IDE is widely used! However, it seems that Vim does not have the Java automatic prompt function.

So what should we do!

Javacomplete is useful at this time.

First download javacomplete.from the vim network and decompress javacomplete.doc to the Vim \ vimfiles \ doc directory.

Then place javacomplete. Vim in autoload to the autoload directory.

The class file compiled by reflection. Java is also stored in the autoload directory. At the same time, put the class file under the lib directory of JDK.

At the same time, configure the autodrop directory in your vim to the environment variable classpath. For example, my files are c: \ Program Files \ Vim \ vim73 \ autoload;

Add the following to your _ vimrc file:

"Other languages, such as PHP Java JavaScript, can automatically complete filetype plugin indent on" open the file and configure autocmd filetype Ruby, eruby set omnifunc = rubycomplete # completeautocmd filetype Python set omnifunc = bytes # completeautocmd filetype JavaScript set encoding = bytes # define filetype HTML set encoding = htmlcomplete # define filetype CSS set omnifunc = csscomplete # define filetype XML set omnifunc = xmlcomplete # completetagsautocmd filetype Java set omnifunc = javacomplete # completeif has ("autocmd ") & exists ("+ omnifunc") autocmd filetype * \ If & omnifunc = "" | \ setlocal omnifunc = syntaxcomplete # complete | \ endifendiflet G: bytes = 1let G: rubycomplete_classes_in_global = 1 "Let G: rubycomplete_rails = 1 autocmd filetype Java inoremap <buffer> .. <C-X> <C-O> <C-P>

 

Use Vim to open your file. In input mode, enter <c-x> <c-o> <c-P> to see the auto-completion effect.

Here are the reasons why my configuration was unsuccessful at the beginning:

First, because the file configuration is not opened:

Filetype plugin indent on "open file configuration

In addition, the following statement is not written:

if has("autocmd") && exists("+omnifunc")  autocmd Filetype *  \ if &omnifunc == "" |  \ setlocal omnifunc=syntaxcomplete#Complete |  \ endifendif

 

Since the last sentence is not configured at the beginning

autocmd FileType java inoremap <buffer> . .<C-X><C-O><C-P>

As a result, the first selection will be automatically selected if no prompt is displayed, and the selection will be deleted each time.

The last sentence can be automatically selected.

4 taglist

Download the taglist package first.

Put the files in the folder to the corresponding directory.

Then, configure the following in the _ vimrc file:

"Taglist configuration let tlist_show_one_file = 1" Exit vimlet when only taglist is in one window. "Let tlist_use_right_window = 1 Let tlist_winheight = 30" set the width of let tlist_winwidth = 20 "reduced in the tag List window, the blank line Let tlist_compact_format = 1 "automatically folds the list of methods of the currently unedited files. Let tlist_file_fold_auto_close = 1" display the taglist menu let tlist_show_menu = 1 "if the taglist window is is the last window exit vimlet tlist_exit_onlywindow = 1 "Configure quick map <F3>: tlisttoggle <CR>

4 minibufexpl

Download minibufexpl from the official website, decompress it, and copy it to the vim \ vimfiles \ plugin directory.

Then add the following to the _ vimrc file:

let g:miniBufExplMapWindowNavVim = 1   let g:miniBufExplMapWindowNavArrows = 1   let g:miniBufExplMapCTabSwitchBufs = 1   let g:miniBufExplModSelTarget = 1  let g:miniBufExplMoreThanOne=0  

 

5. winmanager combines nerdtree and taglist

Download winmanager, decompress it, and copy the file to VIM \ vimfiles \ plugin.

Configure the following in the _ vimrc file:

let g:NERDTree_title="[NERDTree]"  let g:winManagerWindowLayout="NERDTree|TagList"    function! NERDTree_Start()      exec 'NERDTree'  endfunction    function! NERDTree_IsValid()      return 1  endfunction    nmap wm :WMToggle<CR> 

 

If you need to enable it automatically:

"Automatically enable. If you can enable Vim to enable winmanaer, You Need To uncomment autoopenwinmanger in vimmanager. vim. "Let G: autoopenwinmanager = 1

 

Here, winmanager has a small bug, that is, a blank page will appear when it is enabled. If you need to clear it.

Two methods are used.

For Automatic startup, you need to add the following code in vimmanager. VIM:

"Set auto open winmanager" If G: autoopenwinmanager "" nerdtree left-side configuration method "autocmd vimenter * nested call S: startwindowsmanager () | 1 wincmd Q "" nerdtree placed on the right configuration mode "" autocmd vimenter * nested call S: startwindowsmanager () | 1 wincmd w | Q "endif

If winmanager is placed on the left of the editing area, the first method is used. If winmanager is on the right, the second method is used.

Of course, the first type is used by default.

If it is not automatically started:

Just go to winmanager. Vin and change togglewindowsmanager to the following:

function! <SID>ToggleWindowsManager()if IsWinManagerVisible()call s:CloseWindowsManager()elsecall s:StartWindowsManager()"exe 'q'endendfunction

6. Use Vim to view data in the browser in editplus. (Multiple files can be viewed, such as php html jsp)

Configure the following in _ vimrc:

 

"Directly input run in VIM to call the browser to access the page function! Viewinbrowser (name) Let file = expand ("%: P") EXEC ": Update ". file Let L: browsers = {\ "cr": "D:/webdevelopment/Browser/Chrome/chrome.exe", \ "FF": "D: /webdevelopment/Browser/Firefox/firefox.exe ", \" op ":" D:/webdevelopment/Browser/Opera/opera.exe ", \" ie ":" C:/progra ~ 1/intern ~ 1/iexplore.exe ", \" IE6 ":" D:/webdevelopment/Browser/ietester/ietester.exe-IE6 ", \" IE7 ":" D: /webdevelopment/Browser/ietester/ietester.exe-IE7 ", \" IE8 ":" D:/webdevelopment/Browser/ietester/ietester.exe-IE8 ", \" ie9 ":" D: /webdevelopment/Browser/ietester/ietester.exe-ie9 ", \" IEA ":" D:/webdevelopment/Browser/ietester/ietester.exe-all "\} Let htdocs = 'C: \ appserv \ www \ 'let strpos = stridx (file, substitut E (htdocs, '\\\\', '\', "G") If strpos =-1 EXEC ": silent! Start ". l: browsers [A: Name]. "file ://". file else let file = substitute (file, htdocs, "http: // localhost: 81/", "G") Let file = substitute (file ,'\\', '/', "G") EXEC ": silent! Start ". L: browsers [A: Name] File endifendfunction: Command runie call viewinbrowser (" ie ")

 

Here, as long as your file is in the htdocs directory, it will be accessed through the HTTP protocol. That is, it will be opened in a browser.

7 tcomment

Download tcomment. VBA from Vim Official Website

Open it with vim and enter so %. Vim will automatically put the plug-in ~ /. Vim/plugin.

Open the file with vim, select the line you want to comment out, and enter GC in normal mode to comment out.

 

8 snipmate

Put the snipmate downloaded from the official website to the corresponding directory.

Open a Java file, Enter main, and press the tab key.

The following code is displayed:

public static void main (String [] args){/* code */}

The display scheme can be customized and modified in the corresponding files in the snippets folder.

The Vim page configured for one day is attached. I feel pretty good!

 

 

 

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.