Vim user manual reading guide

Source: Internet
Author: User

I encountered difficulties in learning vim, so I want to do some work to reduce the threshold...

Let's take an example to illustrate the representation structure and method of the document...
# Vim
: Help e117
The content is as follows:

                                                :cal :call E107 E117:[range]cal[l] {name}([arguments])                Call a function.  The name of the function and its arguments                are as specified with :function.  Up to 20 arguments can be                used.  The returned value is discarded.                Without a range and for functions that accept a range, the                function is called once.  When a range is given the cursor is                positioned at the start of the first line before executing the                function.                When a range is given and the function doesn't handle it                itself, the function is executed for each line in the range,                with the cursor in the first column of that line.  The cursor                is left at the last line (possibly moved by the last function                call).  The arguments are re-evaluated for each line.  Thus                this works:                                                function-range-example  >        :function Mynumber(arg)        :  echo line(".") . " " . a:arg        :endfunction        :1,5call Mynumber(getline("."))<                The "a:firstline" and "a:lastline" are defined anyway, they                can be used to do something different at the start or end of                the range.                Example of a function that handles the range itself: >        :function Cont() range        :  execute (a:firstline + 1) . "," . a:lastline . 's/^/\t\\ '        :endfunction        :4,8call Cont()<                This function inserts the continuation character "\" in front                of all the lines in the range, except the first one.                When the function returns a composite value it can be further                dereferenced, but the range will not be used then.  Example: >        :4,8call GetDict().method()<               Here GetDict() gets the range but method() does not.

Each> (including the previous block) <(including the following block), including> <the middle block (Block), constitutes a complete module.

Command details:

: Indicates the command mode.
[Range] indicates the range, and [] indicates option (optional ).
Cal indicates the call, which is fixed and required.
{Name} indicates the name of the function to be called. Name is a non-fixed value and is required.

([Arguments]) indicates that the Left and Right brackets of the parameter are required. [arguments] is non-fixed and optional.

Next, we will start to navigate the learning process:

In command mode:

: Help user-Manual

Open the user manual. This is the best tutorial for VIM. Hey, move the cursor hjkl to the highlighted labels such as usr_02.txt and press <c-]> to jump to the past, <c-o> yes, it is returned (press Ctrl + O), and <c-t> it is returned.

: Help usr_02.txt is a quicktutor

Next, let's look at the existing ing:

: Map is used to view ing information.

: NMAP is used to view mappings in normal mode.

: Vmap is used to view the visual ing in visual mode.

: IMAP is used to view the insert ing in insert mode.
: Set, you can see some existing settings, such as runtimepath.

The English language is really half a bucket of water. In some places, it seems that I have to understand it, so I still need to use Chinese translation.

Http://vimcdoc.sourceforge.net/(download Chinese Document)

# Wget http://prdownloads.sourceforge.net/vimcdoc/vimcdoc-1.8.0.tar.gz? Download

# Tar zxvf vimcdoc-1.8.0.tar.gz

Run the installation script as a normal user to copy the file to $ home/. vim.

# Cd vimcdoc-1.8.0

#./Vimcdoc. Sh-I

In this way, you can use: Set helplang = EN and: Set helplang = cn to switch.

The online Chinese user manual can be viewed here, including the directory tree and retrieval:
Http://vimcdoc.sourceforge.net/doc/help.html
Search by Google for example: "Uganda site: vimcdoc.sourceforge.net"

After learning some basic operations, you need to configure and drum up the plug-in. Here are two tips.

1. "The configuration file. vimrc is automatically reloaded after modification to make the settings take effect without restarting Vim
Autocmd! Bufwritepost. vimrc source ~ /. Vimrc

2. At the same time, use the plug-in management system vbundle to update and install the plug-in.

Https://github.com/gmarik/vundle

The configuration method is also available on this page.

In fact, there are still a lot of difficulties, you can only slowly explore...

QQ group: 213572677, just created. If you are interested, contact us.

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.