Vim (4) -- plug-in (plugin)

Source: Internet
Author: User
Tags set background

I think Vim is a powerful text editing software because it supports function expansion in the form of plug-ins (plugin. Many Vim enthusiasts write plug-ins to implement the required functions and customize their own vim. Vim supports the following types of plug-ins:

    • Vimrc: vimrc is similar to a configuration file. When Vim is started, content is read and configured accordingly. In vim, you can set vimrc and gvimrc in two files. Vimrc is used for some common settings, and gvimrc is used for GUI-related settings. They are located in the vim installation directory.
    • Global Plugin: used to provide global or general functions. Vim provides some global plug-ins by default during installation. These plug-ins are located under <Vim installation directory>/<$ vimruntime>/plugin. You can also install some plug-ins to store them in your own plug-in directory, for example, on Linux/MacOS, the <Vim installation directory> /. vim/plugin/, which is the <Vim installation directory>/vimfiles/plugin/on Windows (note that the plug-in folder may need to be created by yourself ).
    • File Type Plugin: used to support specific types of files, such as C and XML files. Similar to the global plug-in, VIM provides some default file type plug-ins, and allows you to install some file type plug-ins on your own. The storage location of file-type plug-ins is similar to that of global plug-ins.
    • Syntax highlighting plug-ins: store the plug-ins that provide syntax highlighting support for some languages under <Vim installation directory>/<$ vimruntime>/syntax/, such as C. vim, Python. vim. To use these plug-ins, you may want to execute: Set filetype = language in Vim, for example: Set filetype = python.
    • Compile plug-ins: Compile plug-ins. As the name suggests, they are compiled in some languages that can be compiled directly in Vim.ProgramSupported. These plug-ins are stored in <Vim installation directory>/<$ vimruntime>/Compiler.

The following describes some common vimrc setting commands.

 Set nocompatible  "  Explictly get out of vi-compatible mode  

Set background = Dark " We plan to use a dark background

Syntax on " Syntax highlighting on

Set number " Turn on line numbers

Set ruler " Always show current position along the bottom

Set incsearch " Do highlight as you type you search phrase

Set ignorecase " Case Insensitive by default

Set smartcase " If there are caps, go case-sensitive

Colorscheme macvim " The color scheme I am using now

Here we only list some of the most common setting commands for beginners of vim. There are also a lot of vim setup commands you can't imagine. I believe you can find them online. We recommend two templates here to find your favorite VIM: http://www.vi-improved.org/vimrc.php and http://amix.dk/vim/vimrc.html.

Finally, let's preview: in the next section, I will introduce how to use the various plug-ins introduced in this section to create a python IDE.

References:

1. http://www.swaroopch.com/notes/Vim

2. http://www.vi-improved.org/vimrc.php

3. http://amix.dk/vim/vimrc.html

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.