Some Vim plug-ins and configurations

Source: Internet
Author: User

One of the advantages of VIM is that the vast majority of vimmer plug-ins are selflessly dedicated, so that I am not familiar with vim scripts. This section describes some plug-ins and configurations that I have installed.ProgramNo text editing, no calendar, or coffee.

1)

A simple but useful plug-in. Type A to switch the header file and source file. C and C ++ are supported by default, but objc is not supported. You can modify a. vim and add the following statement to A. VIM:

Call <Sid> addalternateextensionmapping ('M', "H") "objective-C file

Call <Sid> addalternateextensionmapping ('mm', "H") "objective-C ++ File

2) autocomplpop

In vim, press <Ctrl-N> to bring up the auto-completion menu. This plug-in automatically pops up the auto-completion menu during the typing process, which is sometimes convenient and sometimes annoying.

3) c

Quickly enter some C, C ++ ProgramCodeFragments, common statements, and quick comments. For example, in normal or insert mode, you can enter the do while statement by typing \ SD, or comment out the selected text block by typing \ CC.

As the \ key is far away ~ /. Add the following to vimrc:

Let G: c_mapleader = ','

Then, the prefix key is changed to a comma.

The default file type is not enough. To support objc ~ /. Add the following to vimrc:

Let G: c_sourcecodeextensions = 'C cc cp cxx cpp c ++ c I II M mm'

It is said that GCC can also be called directly in Vim, but it has never been tried.

3) Cocoa

Cocoa is the official framework developed by ios. This plug-in is intended to replace xcode's text editing function.

In my experience, xcode's text editing function is tailored to objc and has poor customization. It is used to write c ++ errors, therefore, writing objective-C ++ is a tragedy, so I want to write IOS applications on VIM, so I have this plug-in.

Automatically complete the official API-this is the most important function, because the Class Name of the ios api, method name is usually very long, very long ......

This plug-in has a defect-some features do not support. MM files. Vim thinks that the. MM file is not an objc file and does not know how to solve it.

4) echofunc

C, C ++ plug-ins. When the function name is input and then input (the function definition is provided in the status bar, which is very useful. It depends on ctags.

5) grep

You can search for keywords within the folder range.

6) nerdtree

You can also set bookmarks in the tree-like file browsing window, which is better than the default file explorer. Organize file views like IDE.

I am in ~ /. Relevant settings in vimrc are as follows:

 

Let G: nerdtree_title = "[nerdtree]"

 

Function! Nerdtree_start ()

Exec 'nerdtree'

Endfunction

 

Function! Nerdtree_isvalid ()

Return 1

Endfunction

 

 

 

Let nerdchristmastree = 0

Let nerdtreeshowbookmarks = 1

Let nerdtreeshowfiles = 1

Let nerdtreeshowlinenumbers = 1

Let nerdtreeminimalui = 1

Let nerdtreechdirmode = 2

 

7) snipmate

Similar to the code snippet function of textmate.

8) supertab

In the auto-completion menu, press <tab> to replace <CTR-N> and switch.

9) taglist

Generate a list window for C and C ++ functions.

In ~ /. The settings in vimrc are as follows:

 

Let tlist_ctags_cmd = "/usr/local/bin/ctags"

Let tlist_auto_open = 0

Let tlist_process_file_always = 1

Let tlist_file_fold_auto_close = 1

Let tlist_sort_type = "name"

Let tlist_winwidth = 30

Let tlist_compact_format = 1

Let tlist_enable_fold_column = 0

Let tlist_display_prototype = 1

Let tlist_show_one_file = 1

Let tlist_exit_onlywindow = 1

Let tlist_use_right_window = 1

10) vimball

Install the vim plug-in VBA format.

11) objc_matchbracket

This is also the objc plug-in.

The Visual Feature of objc is that the brackets are enclosed in brackets, so it is easy to make mistakes during writing, which is very painful. The xcode editor can automatically complete the brackets. This plug-in is also supported. The disadvantage is that. MM files are not supported. I don't know how to change it.

12) omnicppcomplete

If writing C ++, this plug-in is too useful and prompts member functions and data like IDE. It depends on ctags. You can ~ /. Add the following sentence to vimrc:

Map <F3> :! Ctags-r -- C ++-kinds = + p -- fields = + IALS -- extra = + q. <CR>

-- In this way, press <F3> in VIM to generate the tags file.

My space has ~ /. The code of the vimrc file may be a tragedy if it is lost.

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.