Vim auto-complete and vim auto-complete brackets

Source: Internet
Author: User


Vim auto-complete, vim auto-complete, and so on. In summary, copy and paste the following code ~ /. Vimrc, save, close all vim, and open it. Enter the cursor inside the brackets. Www.2cto.com [plain]: inoremap () <ESC> I: inoremap) <c-r> = ClosePair (') <CR>: inoremap {{}< ESC> I: inoremap} <c-r >= ClosePair ('}') <CR>: inoremap [[] <ESC> I: inoremap] <c-r> = ClosePair (']') <CR>: inoremap <> <ESC> I: inoremap> <c-r> = ClosePair ('>') <CR> function ClosePair (char) if getline ('. ') [col ('. ')-1] = a: char return "/<Right>" else return a: char endif endf www.2cto.com Auto completion 1: Ctrl + p and Ctrl + n For example, enter [plain] $ total = $ ch_arrary [1] + in a row, and press "Ctrl + p" in vim to display two options, $ total and $ ch_arrary options. You can press ctrl + p in the two options to select the same principle. ctrl + n is also the same Automatic completion vim option: 1: case-insensitive ": After set ignorecase enables this option, if you want to complete the ins, INSERT, InSide or instep will be the most candidates. Www.2cto.com 2: Case Sensitive ": set infercase". If you want to complete the ins, there will be such words as instep, inside, and insert. The most basic usage is. Of course there are still complicated designs.

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.