Download Vim and vim

Source: Internet
Author: User

Download Vim and vim

From song4

Vim helps you complete text editing in a almost natural language.

You just need to get familiar with a few simple syntaxes, and then you will sit on the rotating seat and turn around, and feel the wonderful life is back.

Okay, let's get started.

Vim helps you complete text editing in a almost natural language.

You just need to get familiar with a few simple syntaxes, and then you will sit on the rotating seat and turn around, and feel the wonderful life is back.

Okay, let's get started.

Verb

Verbs represent the operations we intend to perform on the text. For example:

  • dDelete)
  • rReplace)
  • cChange)
  • yIndicates copying (yank)
  • vVisual select)
Term

Nouns represent the text we are going to process. Vim has a special term called a Text object. Below are some examples of text objects:

  • wIndicates a word)
  • sRepresents a sentence (sentence)
  • pParagraph)
  • tIndicates an HTML tag)
  • The text enclosed by quotation marks or brackets is called a text block.
Prepositions

The prefix defines the range or location of the text to be edited. For example:

  • iIndicates "within..." (inside)
  • aIndicates "surround..." (around)
  • tIndicates "before the... position" ()
  • fForward)
The following are some related scopes:

Group word as sentence

With these basic language elements, we can start to construct some simple commands. The basic syntax of the text editing command is as follows:

Verb prefix noun

Below are some examples (if you are familiar with the above concepts, you will see these examples are very easy to understand), Please experiment with Vim in person.

# Delete a paragraph: delete inside paragraphdip # select a sentence: visual select inside sentencevis # modify a word: change inside wordciw # modify a word: change und wordcaw # delete text until the character "x" (excluding the character "x"): delete to xdtx # delete text until the character "x" (including the character "x "): delete forward xdfx
Number words

A number word specifies the number of text objects to be edited. From this perspective, a number word can also be considered as a prefix. After several words are introduced, the syntax of the text editing command is upgraded to the following:

Verb prefix/count term

The following are examples:

# Modify three words: change three wordsc3w # delete two words: delete two wordsd2w

In addition, the number word can also modify the verb, indicating that the operation is executed n times. So we have the following syntax:

Number word Verb noun

See the example:

# Delete a word twice (equivalent to deleting two words): twice delete word2dw # delete three characters (equivalent to deleting three characters): three times delete character3x

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.